* Re: [git-svn PATCH] Add --no-rebase option to git-svn dcommit
From: Eric Wong @ 2007-05-04 8:04 UTC (permalink / raw)
To: Karl Hasselström; +Cc: Junio C Hamano, git
In-Reply-To: <20070504075908.GB17526@muzzle>
Eric Wong <normalperson@yhbt.net> wrote:
> Karl Hasselström <kha@treskal.com> wrote:
> > git-svn dcommit exports commits to Subversion, then imports them back
> > to git again, and last but not least rebases or resets HEAD to the
> > last of the new commits. I guess this rebasing is convenient when
> > using just git, but when the commits to be exported are managed by
> > StGIT, it's really annoying. So add an option to disable this
> > behavior. And document it, too!
>
> Cool, I've been planning to add this myself, too.
>
> Acked-by: Eric Wong <normalperson@yhbt.net>
>
> > Signed-off-by: Karl Hasselström <kha@treskal.com>
> > ---
> >
> > Arguably, the switch should be --rebase instead, and default to not
> > rebase. But that would change the existing behavior, and possibly make
> > dcommit less convenient to use for at least the person who implemented
> > the existing behavior. Opinions?
Erm, sorry, I skipped over this part. No. I like rebase being the
default behavior.
> > Documentation/git-svn.txt | 3 +++
> > git-svn.perl | 33 ++++++++++++++++++---------------
> > 2 files changed, 21 insertions(+), 15 deletions(-)
> >
> > diff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt
> > index 62d7ef8..fcdeeaa 100644
> > --- a/Documentation/git-svn.txt
> > +++ b/Documentation/git-svn.txt
> > @@ -125,6 +125,9 @@ and have no uncommitted changes.
> > alternative to HEAD.
> > This is advantageous over 'set-tree' (below) because it produces
> > cleaner, more linear history.
> > ++
> > +--no-rebase;;
> > + After committing, do not rebase or reset.
> > --
> >
> > 'log'::
> > diff --git a/git-svn.perl b/git-svn.perl
> > index 6657e10..3c4f490 100755
> > --- a/git-svn.perl
> > +++ b/git-svn.perl
> > @@ -55,7 +55,7 @@ $sha1_short = qr/[a-f\d]{4,40}/;
> > my ($_stdin, $_help, $_edit,
> > $_message, $_file,
> > $_template, $_shared,
> > - $_version, $_fetch_all,
> > + $_version, $_fetch_all, $_no_rebase,
> > $_merge, $_strategy, $_dry_run, $_local,
> > $_prefix, $_no_checkout, $_verbose);
> > $Git::SVN::_follow_parent = 1;
> > @@ -114,6 +114,7 @@ my %cmd = (
> > 'verbose|v' => \$_verbose,
> > 'dry-run|n' => \$_dry_run,
> > 'fetch-all|all' => \$_fetch_all,
> > + 'no-rebase' => \$_no_rebase,
> > %cmt_opts, %fc_opts } ],
> > 'set-tree' => [ \&cmd_set_tree,
> > "Set an SVN repository to a git tree-ish",
> > @@ -413,21 +414,23 @@ sub cmd_dcommit {
> > return;
> > }
> > $_fetch_all ? $gs->fetch_all : $gs->fetch;
> > - # we always want to rebase against the current HEAD, not any
> > - # head that was passed to us
> > - my @diff = command('diff-tree', 'HEAD', $gs->refname, '--');
> > - my @finish;
> > - if (@diff) {
> > - @finish = rebase_cmd();
> > - print STDERR "W: HEAD and ", $gs->refname, " differ, ",
> > - "using @finish:\n", "@diff";
> > - } else {
> > - print "No changes between current HEAD and ",
> > - $gs->refname, "\nResetting to the latest ",
> > - $gs->refname, "\n";
> > - @finish = qw/reset --mixed/;
> > + unless ($_no_rebase) {
> > + # we always want to rebase against the current HEAD, not any
> > + # head that was passed to us
> > + my @diff = command('diff-tree', 'HEAD', $gs->refname, '--');
> > + my @finish;
> > + if (@diff) {
> > + @finish = rebase_cmd();
> > + print STDERR "W: HEAD and ", $gs->refname, " differ, ",
> > + "using @finish:\n", "@diff";
> > + } else {
> > + print "No changes between current HEAD and ",
> > + $gs->refname, "\nResetting to the latest ",
> > + $gs->refname, "\n";
> > + @finish = qw/reset --mixed/;
> > + }
> > + command_noisy(@finish, $gs->refname);
> > }
> > - command_noisy(@finish, $gs->refname);
> > }
> >
> > sub cmd_find_rev {
--
Eric Wong
^ permalink raw reply
* Re: [PATCH] Support ent:relative_path
From: Dana How @ 2007-05-04 8:45 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Git Mailing List, danahow
In-Reply-To: <7v7irpuhhr.fsf@assigned-by-dhcp.cox.net>
On 5/4/07, Junio C Hamano <junkio@cox.net> wrote:
> I do not think it is wrong per-se, to want to make this hold true:
>
> A=$(git rev-parse :somedir/file)
> B=$(cd somedir && git rev-parse :file)
> test "$A" = "$B"
>
> One thing I am reasonably certain however is that this should
> NOT be conditional to a config setting. Doing so would force
> scripts that take (or compute) path and commit and concatenate
> them to make "${commit}:${path}" to name a blob (or tree) to
> first inspect the current setting of core.relativepaths and undo
> what the new code does by prefixing/subtracting the prefix
> string depending on the config.
>
> In other words, having that config is not really helping scripts
> or compatibility.
>
> I think the choices are:
>
> (1) we say it was a mistake that we did not make it relative to
> the current directory when we introduced the X:<path>
> syntax (X could be empty or :[0-3]: for index, or a commit
> or tree object name), and change the semantics in a future
> major release for everybody, apologizing for potentially
> breaking existing scripts; or
>
> (2) keep the current behaviour as is, and come up with a
> different syntax to use relative; or
>
> (3) do nothing.
>
> My preference is (2), (3) and then (1), but I do not have
> offhand a suggestion for a good metacharacter we could use.
Let us require:
* No config settings as you prefer
* Current interpretations are unchanged.
The current path supports
:fullpath
:/string
:./relpath
[assuming core.relativepaths=no always since it goes away].
(:/string is the "find string in commit msg" feature.)
A new metacharacter lets us drop the "./" ,
and I think that's desirable.
How about = ? It's not even shifted on my keyboard:
ent=relpath
ent=2=relpath
ent=/fullpath
1. We would accept the same new metacharacter before stage if any.
2, You could still use ent:/string , or ent:fullpath .
The patch should also be extended so relpath can start
with a sequence of ./ or ../ prefixes,
which is easily handled in prepend_prefix()..
What do you think of "=" ?
--
Dana L. How danahow@gmail.com +1 650 804 5991 cell
^ permalink raw reply
* Re: [PATCH] Support ent:relative_path
From: Alex Riesen @ 2007-05-04 8:47 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Dana How, Git Mailing List
In-Reply-To: <7v7irpuhhr.fsf@assigned-by-dhcp.cox.net>
On 5/4/07, Junio C Hamano <junkio@cox.net> wrote:
> (1) we say it was a mistake that we did not make it relative to
> the current directory when we introduced the X:<path>
> syntax (X could be empty or :[0-3]: for index, or a commit
> or tree object name), and change the semantics in a future
> major release for everybody, apologizing for potentially
> breaking existing scripts; or
That would be my first prio preference
> (2) keep the current behaviour as is, and come up with a
> different syntax to use relative; or
>
> (3) do nothing.
>
> My preference is (2), (3) and then (1), but I do not have
> offhand a suggestion for a good metacharacter we could use.
"./" :)
^ permalink raw reply
* Re: [PATCH] Support ent:relative_path
From: Dana How @ 2007-05-04 8:53 UTC (permalink / raw)
To: Alex Riesen; +Cc: Junio C Hamano, Git Mailing List, danahow
In-Reply-To: <81b0412b0705040147h1bab8f6ao3ce2c486637a0d4f@mail.gmail.com>
On 5/4/07, Alex Riesen <raa.lkml@gmail.com> wrote:
> On 5/4/07, Junio C Hamano <junkio@cox.net> wrote:
> > (1) we say it was a mistake that we did not make it relative to
> > the current directory when we introduced the X:<path>
> > syntax (X could be empty or :[0-3]: for index, or a commit
> > or tree object name), and change the semantics in a future
> > major release for everybody, apologizing for potentially
> > breaking existing scripts; or
>
> That would be my first prio preference
Mine too, but I don't want to break anything.
> > (2) keep the current behaviour as is, and come up with a
> > different syntax to use relative; or
> >
> > (3) do nothing.
> >
> > My preference is (2), (3) and then (1), but I do not have
> > offhand a suggestion for a good metacharacter we could use.
>
> "./" :)
Heh. Yes, that works in the current patch.
I'm really starting to like the idea of introducing "="
as an alternative for ":" :
"=" assumes relative paths, ":" assumes absolute (full) paths.
That could be Junio's new metacharacter.
Since "=" is slightly easier to type [ ;-) ], and looks like a stretched ":",
it's almost ingenious...
(Definitely getting carried away!)
--
Dana L. How danahow@gmail.com +1 650 804 5991 cell
^ permalink raw reply
* Re: [PATCH] Support ent:relative_path
From: Alex Riesen @ 2007-05-04 9:17 UTC (permalink / raw)
To: Dana How; +Cc: Junio C Hamano, Git Mailing List
In-Reply-To: <56b7f5510705040153i65ba6260v9fbe7a90e040cab3@mail.gmail.com>
On 5/4/07, Dana How <danahow@gmail.com> wrote:
> > > (1) we say it was a mistake that we did not make it relative to
> > > the current directory when we introduced the X:<path>
> > > syntax (X could be empty or :[0-3]: for index, or a commit
> > > or tree object name), and change the semantics in a future
> > > major release for everybody, apologizing for potentially
> > > breaking existing scripts; or
> >
> > That would be my first prio preference
>
> Mine too, but I don't want to break anything.
It probably wont break anything which is not already broken.
It's somehow hard to imagine someone would use the
syntax to check for absence of a file in non-top-level
subdirectory. Besides, the existing syntax is ambiguous:
for anyone using pathname tab completion.
Besides, you can give a warning of ambiguity in case there are
equal relative and a top-level paths. Return the relative, but print
the warning, so people can fix their scripts.
> > > My preference is (2), (3) and then (1), but I do not have
> > > offhand a suggestion for a good metacharacter we could use.
> >
> > "./" :)
> Heh. Yes, that works in the current patch.
>
> I'm really starting to like the idea of introducing "="
> as an alternative for ":" :
> "=" assumes relative paths, ":" assumes absolute (full) paths.
> That could be Junio's new metacharacter.
Just keep in mind: "once introduced, you'll never be able to remove it".
And I don't share your feelings regarding the special character, for instance.
I'd suggest to define a special character for _top_ level. Real pity
":/" is taken.
^ permalink raw reply
* Re: [PATCH] Support ent:relative_path
From: Johannes Sixt @ 2007-05-04 9:19 UTC (permalink / raw)
To: git
In-Reply-To: <81b0412b0705040147h1bab8f6ao3ce2c486637a0d4f@mail.gmail.com>
Alex Riesen wrote:
> On 5/4/07, Junio C Hamano <junkio@cox.net> wrote:
> > My preference is (2), (3) and then (1), but I do not have
> > offhand a suggestion for a good metacharacter we could use.
>
> "./" :)
+1, without the :)
and ../ should DWIM, too.
-- Hannes
^ permalink raw reply
* repack: handling of .keep files
From: Alex Riesen @ 2007-05-04 9:25 UTC (permalink / raw)
To: Git Mailing List
It does not seem to be consistent with the name:
"git repack -a -d" removes .keep files anyway.
How can I pin down a pack file so that it is never repacked?
(Windows doesn't like big files, they get fragmented heavily
and are hard to read and defragment. So I try keep them
relatively small).
P.S. Experimenting with the .keep-files I had a crash in git-log,
when the pack was renamed into .keep.pack, but the
index was not. git-log complained about two objects it could not
read and than crashed. It's cygwin.
^ permalink raw reply
* Re: [PATCH] Support ent:relative_path
From: Dana How @ 2007-05-04 9:26 UTC (permalink / raw)
To: Alex Riesen; +Cc: Junio C Hamano, Git Mailing List, danahow
In-Reply-To: <81b0412b0705040217o54d1d028j6e768bdc3eb0bad0@mail.gmail.com>
On 5/4/07, Alex Riesen <raa.lkml@gmail.com> wrote:
> > > > My preference is (2), (3) and then (1), but I do not have
> > > > offhand a suggestion for a good metacharacter we could use.
> > >
> > > "./" :)
> > Heh. Yes, that works in the current patch.
> >
> > I'm really starting to like the idea of introducing "="
> > as an alternative for ":" :
> > "=" assumes relative paths, ":" assumes absolute (full) paths.
> > That could be Junio's new metacharacter.
>
> Just keep in mind: "once introduced, you'll never be able to remove it".
> And I don't share your feelings regarding the special character, for instance.
Indeed.
> I'd suggest to define a special character for _top_ level. Real pity
> ":/" is taken.
We could use ://fullpath for top level,
and :relpath for relative. Then "string" in :/string couldn't start with /,
which shouldn't be a problem (right?). I've certainly seen double
slashes before;
perforce in fact uses them for the root of the repository (depot).
This all depends on deciding that :relpath should be the (incompatible)
new default, and I'm not sure that's going to happen.
--
Dana L. How danahow@gmail.com +1 650 804 5991 cell
^ permalink raw reply
* Re: [RFC?] Telling git about more complex relationships between commits (Was: Re: FFmpeg considering GIT)
From: Alex Riesen @ 2007-05-04 9:36 UTC (permalink / raw)
To: Johan Herland; +Cc: git
In-Reply-To: <200705040921.33443.johan@herland.net>
On 5/4/07, Johan Herland <johan@herland.net> wrote:
> 1. "Reverts": Mark a commit as reverting another commit. This could be
> used by git-log to cancel out pairs of commits, resulting in a cleaner
> view of history. It can help blame/annotate. There are probably other
> tools that can benefit from this information also.
>
> 2. "Cherry-Pick": When cherry-picking a commit onto another branch, you
> should be able to tell git which commit you are cherry-picking
> (git-cherry-pick would of course do this automatically). This could
> enable git to make smarter decisions when merging the two branches: If
> the cherry-picked commit would cause a conflict with the original
> commit, git can either skip it (since it knows that one version of this
> patch is already present), or it can at least present the conflict to
> the user with some more context than what is available today. Not to
> mention how this information could be used by blame/annotate.
These are completely useless after the first "git gc --prune" or "git clone"
unless these tools taught to preserve the reverted or cherry-picked commits
(and all their history). And if you are about to teach them that, please notice
that as for now cloning and repacking does not even look at the
objects contents.
You'll absolutely kill their performance.
^ permalink raw reply
* Re: [PATCH] Support ent:relative_path
From: Alex Riesen @ 2007-05-04 9:46 UTC (permalink / raw)
To: Dana How; +Cc: Junio C Hamano, Git Mailing List
In-Reply-To: <56b7f5510705040226o14d55b6euda7df1da7ad9b08a@mail.gmail.com>
On 5/4/07, Dana How <danahow@gmail.com> wrote:
> > I'd suggest to define a special character for _top_ level. Real pity
> > ":/" is taken.
> We could use ://fullpath for top level,
No good. How'd you find a commit starting with "/" than? (without
changing ":/" syntax).
> and :relpath for relative. Then "string" in :/string couldn't start with /,
> which shouldn't be a problem (right?). I've certainly seen double
> slashes before;
> perforce in fact uses them for the root of the repository (depot).
And I really hate perforce for its stupid redundancy (and changing of
meaning of well-known idioms: why should // be anything special
but plain top level or root?! Why the hell do they need them at if
you cannot use relative paths in client specs at all?! Why can't the
p4 command-line tool figure the fact from context or request the
context be provided by user?! IOW, Perforce is a real bad example
of how you do version control).
> This all depends on deciding that :relpath should be the (incompatible)
> new default, and I'm not sure that's going to happen.
If we are to stay that compatible, maybe ":./" for relative paths and the
old syntax left to mean top-level would the best choice for now.
^ permalink raw reply
* Re: repack: handling of .keep files
From: Junio C Hamano @ 2007-05-04 9:56 UTC (permalink / raw)
To: Alex Riesen; +Cc: Git Mailing List
In-Reply-To: <81b0412b0705040225p26679dbib6a1261a1a43ee67@mail.gmail.com>
"Alex Riesen" <raa.lkml@gmail.com> writes:
> ... Experimenting with the .keep-files I had a crash in git-log,
> when the pack was renamed into .keep.pack, but the
> index was not. git-log complained about two objects it could not
> read and than crashed. It's cygwin.
This part makes me suspect you are not even using the .keep
properly. In addition to pack-[0-9a-f]{40}.(pack|idx), you
would have a corresponding pack-[0-9a-f]{40}.keep file (whose
contents does not matter) to mark that these should not get
repacked.
^ permalink raw reply
* Re: how to filter a pull
From: Karl Hasselström @ 2007-05-04 10:13 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Peter Baumann, git, marc.zonzon
In-Reply-To: <7vwszpzs33.fsf@assigned-by-dhcp.cox.net>
On 2007-05-03 11:21:04 -0700, Junio C Hamano wrote:
> If I were doing this today, I would probably use separate
> repositories, next to the primary project, to host the whole tree of
> other projects, adjust the build procedure of the primary project to
> borrow the whole of these other projects not just subtree -- and/or
> have appropriate symlinks in the primary project that point into
> relevant subtrees in the neighbouring repositories that host these
> other projects.
It should be straightforward (and efficient) to make a script that
takes an existing branch and makes a parallel branch that contains
only one subtree of the first branch. This derived branch can then be
used as a subproject or whatever.
Or is there some obvious reason why this wouldn't work, or would be
inconvenient?
--
Karl Hasselström, kha@treskal.com
www.treskal.com/kalle
^ permalink raw reply
* Re: [git-svn PATCH] Add --no-rebase option to git-svn dcommit
From: Karl Hasselström @ 2007-05-04 10:26 UTC (permalink / raw)
To: Eric Wong; +Cc: Junio C Hamano, git
In-Reply-To: <20070504080424.GA30555@muzzle>
On 2007-05-04 01:04:24 -0700, Eric Wong wrote:
> Erm, sorry, I skipped over this part. No. I like rebase being the
> default behavior.
As did everyone else. So I guess that's settled, then. :-)
--
Karl Hasselström, kha@treskal.com
www.treskal.com/kalle
^ permalink raw reply
* Re: repack: handling of .keep files
From: Alex Riesen @ 2007-05-04 10:42 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Git Mailing List
In-Reply-To: <7vy7k4ud3d.fsf@assigned-by-dhcp.cox.net>
On 5/4/07, Junio C Hamano <junkio@cox.net> wrote:
> "Alex Riesen" <raa.lkml@gmail.com> writes:
>
> > ... Experimenting with the .keep-files I had a crash in git-log,
> > when the pack was renamed into .keep.pack, but the
> > index was not. git-log complained about two objects it could not
> > read and than crashed. It's cygwin.
>
> This part makes me suspect you are not even using the .keep
> properly. In addition to pack-[0-9a-f]{40}.(pack|idx), you
> would have a corresponding pack-[0-9a-f]{40}.keep file (whose
> contents does not matter) to mark that these should not get
> repacked.
This is it (described in git-index-pack.txt, maybe git-repack.txt should
reference it too), thanks.
Still, git-log shouldn't crash (nothing should, of course).
And, the temporary pack is created in working tree, instead of in GIT_DIR
(why not GIT_OBJECT_DIR, btw?)
^ permalink raw reply
* [PATCH 4/5] git-config: read remote config files over HTTP
From: Sven Verdoolaege @ 2007-05-04 10:56 UTC (permalink / raw)
To: git; +Cc: Sven Verdoolaege
In-Reply-To: <11782762032207-git-send-email-skimo@liacs.nl>
From: Sven Verdoolaege <skimo@kotnet.org>
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
---
Makefile | 6 +++++-
config.c | 14 ++++++++++++++
http.c | 10 ++++++++--
http_config.h | 1 +
http_config_curl.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
http_config_none.c | 6 ++++++
6 files changed, 83 insertions(+), 3 deletions(-)
create mode 100644 http_config.h
create mode 100644 http_config_curl.c
create mode 100644 http_config_none.c
diff --git a/Makefile b/Makefile
index 0185386..b782111 100644
--- a/Makefile
+++ b/Makefile
@@ -311,7 +311,7 @@ LIB_OBJS = \
write_or_die.o trace.o list-objects.o grep.o match-trees.o \
alloc.o merge-file.o path-list.o help.o unpack-trees.o $(DIFF_OBJS) \
color.o wt-status.o archive-zip.o archive-tar.o shallow.o utf8.o \
- convert.o attr.o decorate.o progress.o mailmap.o
+ convert.o attr.o decorate.o progress.o mailmap.o $(HTTP_CONFIG_OBJ)
BUILTIN_OBJS = \
builtin-add.o \
@@ -518,6 +518,10 @@ ifndef NO_CURL
ifndef NO_EXPAT
EXPAT_LIBEXPAT = -lexpat
endif
+ HTTP_CONFIG_OBJ = http_config_curl.o http.o
+ EXTLIBS += $(CURL_LIBCURL)
+else
+ HTTP_CONFIG_OBJ = http_config_none.o
endif
ifndef NO_OPENSSL
diff --git a/config.c b/config.c
index 0da74e0..36e3b97 100644
--- a/config.c
+++ b/config.c
@@ -7,6 +7,7 @@
*/
#include "cache.h"
#include "pkt-line.h"
+#include "http_config.h"
#define MAXNAME (256)
@@ -395,6 +396,16 @@ int git_config_from_file(config_fn_t fn, const char *filename)
return ret;
}
+static int config_from_http(config_fn_t fn, char *dest)
+{
+ static char *config_temp = "config.temp";
+ if (git_http_fetch_config(dest, config_temp))
+ return 1;
+ git_config_from_file(fn, config_temp);
+ unlink(config_temp);
+ return 0;
+}
+
int git_config_from_remote(config_fn_t fn, char *dest)
{
int ret;
@@ -403,6 +414,9 @@ int git_config_from_remote(config_fn_t fn, char *dest)
static char var[MAXNAME];
static char value[1024];
+ if (!prefixcmp(dest, "http://"))
+ return config_from_http(fn, dest);
+
pid = git_connect(fd, dest, dumpconfig);
if (pid < 0)
return 1;
diff --git a/http.c b/http.c
index ae27e0c..3e1ccce 100644
--- a/http.c
+++ b/http.c
@@ -25,6 +25,10 @@ long curl_low_speed_limit = -1;
long curl_low_speed_time = -1;
int curl_ftp_no_epsv = 0;
+#ifdef USE_CURL_MULTI
+void (*fill_active_slots)(void) = NULL;
+#endif
+
struct curl_slist *pragma_header;
struct active_request_slot *active_queue_head = NULL;
@@ -394,7 +398,8 @@ void step_active_slots(void)
} while (curlm_result == CURLM_CALL_MULTI_PERFORM);
if (num_transfers < active_requests) {
process_curl_messages();
- fill_active_slots();
+ if (fill_active_slots)
+ fill_active_slots();
}
}
#endif
@@ -459,7 +464,8 @@ void release_active_slot(struct active_request_slot *slot)
slot->curl = NULL;
}
#ifdef USE_CURL_MULTI
- fill_active_slots();
+ if (fill_active_slots)
+ fill_active_slots();
#endif
}
diff --git a/http_config.h b/http_config.h
new file mode 100644
index 0000000..0fddf98
--- /dev/null
+++ b/http_config.h
@@ -0,0 +1 @@
+int git_http_fetch_config(const char *repo, const char *config_file);
diff --git a/http_config_curl.c b/http_config_curl.c
new file mode 100644
index 0000000..3047ea2
--- /dev/null
+++ b/http_config_curl.c
@@ -0,0 +1,49 @@
+#include "http_config.h"
+#include "http.h"
+
+int git_http_fetch_config(const char *repo, const char *config)
+{
+ char url[PATH_MAX];
+ int len = strlen(repo);
+
+ FILE *configfile;
+ struct active_request_slot *slot;
+ struct slot_results results;
+
+ strcpy(url, repo);
+ while (len > 0 && url[len-1] == '/')
+ --len;
+ snprintf(url+len, sizeof(url)-len, "/config");
+
+ configfile = fopen(config, "w");
+ if (!configfile)
+ return error("Unable to open local file %s for config",
+ config);
+
+ http_init();
+
+ slot = get_active_slot();
+ slot->results = &results;
+ curl_easy_setopt(slot->curl, CURLOPT_FILE, configfile);
+ curl_easy_setopt(slot->curl, CURLOPT_WRITEFUNCTION, fwrite);
+ curl_easy_setopt(slot->curl, CURLOPT_URL, url);
+ slot->local = configfile;
+
+ if (start_active_slot(slot)) {
+ run_active_slot(slot);
+ if (results.curl_result != CURLE_OK) {
+ fclose(configfile);
+ return error("Unable to get config %s\n%s", url,
+ curl_errorstr);
+ }
+ } else {
+ fclose(configfile);
+ return error("Unable to start request");
+ }
+
+ http_cleanup();
+
+ fclose(configfile);
+
+ return 0;
+}
diff --git a/http_config_none.c b/http_config_none.c
new file mode 100644
index 0000000..303160b
--- /dev/null
+++ b/http_config_none.c
@@ -0,0 +1,6 @@
+#include "http_config.h"
+
+int git_http_fetch_config(const char *repo, const char *config_file)
+{
+ return error("Reading http config files not supported");
+}
--
1.5.2.rc1.25.g889f-dirty
^ permalink raw reply related
* [PATCH 2/5] git-config: add --remote option for reading config from remote repo
From: Sven Verdoolaege @ 2007-05-04 10:56 UTC (permalink / raw)
To: git; +Cc: Sven Verdoolaege
In-Reply-To: <11782762032207-git-send-email-skimo@liacs.nl>
From: Sven Verdoolaege <skimo@kotnet.org>
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
---
Documentation/git-config.txt | 33 +++++++++++++++++++++---------
builtin-config.c | 44 ++++++++++++++++++++++++++++++++---------
cache.h | 1 +
config.c | 26 ++++++++++++++++++++++++
4 files changed, 84 insertions(+), 20 deletions(-)
diff --git a/Documentation/git-config.txt b/Documentation/git-config.txt
index 280ef20..76398ab 100644
--- a/Documentation/git-config.txt
+++ b/Documentation/git-config.txt
@@ -9,16 +9,25 @@ git-config - Get and set repository or global options
SYNOPSIS
--------
[verse]
-'git-config' [--system | --global] [type] name [value [value_regex]]
-'git-config' [--system | --global] [type] --add name value
-'git-config' [--system | --global] [type] --replace-all name [value [value_regex]]
-'git-config' [--system | --global] [type] --get name [value_regex]
-'git-config' [--system | --global] [type] --get-all name [value_regex]
-'git-config' [--system | --global] [type] --unset name [value_regex]
-'git-config' [--system | --global] [type] --unset-all name [value_regex]
-'git-config' [--system | --global] [type] --rename-section old_name new_name
-'git-config' [--system | --global] [type] --remove-section name
-'git-config' [--system | --global] -l | --list
+'git-config' [--system | --global | --remote=[<host>:]<directory ]
+ [type] name [value [value_regex]]
+'git-config' [--system | --global | --remote=[<host>:]<directory ]
+ [type] --add name value
+'git-config' [--system | --global | --remote=[<host>:]<directory ]
+ [type] --replace-all name [value [value_regex]]
+'git-config' [--system | --global | --remote=[<host>:]<directory ]
+ [type] --get name [value_regex]
+'git-config' [--system | --global | --remote=[<host>:]<directory ]
+ [type] --get-all name [value_regex]
+'git-config' [--system | --global | --remote=[<host>:]<directory ]
+ [type] --unset name [value_regex]
+'git-config' [--system | --global | --remote=[<host>:]<directory ]
+ [type] --unset-all name [value_regex]
+'git-config' [--system | --global | --remote=[<host>:]<directory ]
+ [type] --rename-section old_name new_name
+'git-config' [--system | --global | --remote=[<host>:]<directory ]
+ [type] --remove-section name
+'git-config' [--system | --global | --remote=[<host>:]<directory ] -l | --list
DESCRIPTION
-----------
@@ -80,6 +89,10 @@ OPTIONS
Use system-wide $(prefix)/etc/gitconfig rather than the repository
.git/config.
+--remote=[<host>:]<directory
+ Use remote config instead of the repository .git/config.
+ Only available for reading options.
+
--remove-section::
Remove the given section from the configuration file.
diff --git a/builtin-config.c b/builtin-config.c
index b2515f7..3a1e86c 100644
--- a/builtin-config.c
+++ b/builtin-config.c
@@ -2,8 +2,10 @@
#include "cache.h"
static const char git_config_set_usage[] =
-"git-config [ --global | --system ] [ --bool | --int ] [--get | --get-all | --get-regexp | --replace-all | --add | --unset | --unset-all] name [value [value_regex]] | --rename-section old_name new_name | --remove-section name | --list";
+"git-config [ --global | --system | --remote=[<host>:]<directory ] "
+"[ --bool | --int ] [--get | --get-all | --get-regexp | --replace-all | --add | --unset | --unset-all] name [value [value_regex]] | --rename-section old_name new_name | --remove-section name | --list";
+static char *dest;
static char *key;
static regex_t *key_regexp;
static regex_t *regexp;
@@ -104,15 +106,19 @@ static int get_value(const char* key_, const char* regex_)
}
}
- if (do_all && system_wide)
- git_config_from_file(show_config, system_wide);
- if (do_all && global)
- git_config_from_file(show_config, global);
- git_config_from_file(show_config, local);
- if (!do_all && !seen && global)
- git_config_from_file(show_config, global);
- if (!do_all && !seen && system_wide)
- git_config_from_file(show_config, system_wide);
+ if (dest)
+ git_config_from_remote(show_config, dest);
+ else {
+ if (do_all && system_wide)
+ git_config_from_file(show_config, system_wide);
+ if (do_all && global)
+ git_config_from_file(show_config, global);
+ git_config_from_file(show_config, local);
+ if (!do_all && !seen && global)
+ git_config_from_file(show_config, global);
+ if (!do_all && !seen && system_wide)
+ git_config_from_file(show_config, system_wide);
+ }
free(key);
if (regexp) {
@@ -155,8 +161,14 @@ int cmd_config(int argc, const char **argv, const char *prefix)
}
else if (!strcmp(argv[1], "--system"))
setenv("GIT_CONFIG", ETC_GITCONFIG, 1);
+ else if (!prefixcmp(argv[1], "--remote="))
+ dest = xstrdup(argv[1]+9);
else if (!strcmp(argv[1], "--rename-section")) {
int ret;
+ if (dest) {
+ fprintf(stderr, "Cannot rename on remote\n");
+ return 1;
+ }
if (argc != 4)
usage(git_config_set_usage);
ret = git_config_rename_section(argv[2], argv[3]);
@@ -170,6 +182,10 @@ int cmd_config(int argc, const char **argv, const char *prefix)
}
else if (!strcmp(argv[1], "--remove-section")) {
int ret;
+ if (dest) {
+ fprintf(stderr, "Cannot remove on remote\n");
+ return 1;
+ }
if (argc != 3)
usage(git_config_set_usage);
ret = git_config_rename_section(argv[2], NULL);
@@ -191,6 +207,10 @@ int cmd_config(int argc, const char **argv, const char *prefix)
case 2:
return get_value(argv[1], NULL);
case 3:
+ if (dest && prefixcmp(argv[1], "--get")) {
+ fprintf(stderr, "Cannot (un)set on remote\n");
+ return 1;
+ }
if (!strcmp(argv[1], "--unset"))
return git_config_set(argv[2], NULL);
else if (!strcmp(argv[1], "--unset-all"))
@@ -209,6 +229,10 @@ int cmd_config(int argc, const char **argv, const char *prefix)
return git_config_set(argv[1], argv[2]);
case 4:
+ if (dest && prefixcmp(argv[1], "--get")) {
+ fprintf(stderr, "Cannot (un)set on remote\n");
+ return 1;
+ }
if (!strcmp(argv[1], "--unset"))
return git_config_set_multivar(argv[2], NULL, argv[3], 0);
else if (!strcmp(argv[1], "--unset-all"))
diff --git a/cache.h b/cache.h
index 8e76152..e8c7791 100644
--- a/cache.h
+++ b/cache.h
@@ -499,6 +499,7 @@ extern int update_server_info(int);
typedef int (*config_fn_t)(const char *, const char *);
extern int git_default_config(const char *, const char *);
extern int git_config_from_file(config_fn_t fn, const char *);
+extern int git_config_from_remote(config_fn_t fn, char *dest);
extern int git_config(config_fn_t fn);
extern int git_config_int(const char *, const char *);
extern int git_config_bool(const char *, const char *);
diff --git a/config.c b/config.c
index 70d1055..0da74e0 100644
--- a/config.c
+++ b/config.c
@@ -6,9 +6,12 @@
*
*/
#include "cache.h"
+#include "pkt-line.h"
#define MAXNAME (256)
+static const char *dumpconfig = "git-dump-config";
+
static FILE *config_file;
static const char *config_file_name;
static int config_linenr;
@@ -392,6 +395,29 @@ int git_config_from_file(config_fn_t fn, const char *filename)
return ret;
}
+int git_config_from_remote(config_fn_t fn, char *dest)
+{
+ int ret;
+ int fd[2];
+ pid_t pid;
+ static char var[MAXNAME];
+ static char value[1024];
+
+ pid = git_connect(fd, dest, dumpconfig);
+ if (pid < 0)
+ return 1;
+ ret = 0;
+ while (packet_read_line(fd[0], var, sizeof(var))) {
+ if (!packet_read_line(fd[0], value, sizeof(value)))
+ die("Missing value");
+ fn(var, value);
+ }
+ close(fd[0]);
+ close(fd[1]);
+ ret |= finish_connect(pid);
+ return !!ret;
+}
+
int git_config(config_fn_t fn)
{
int ret = 0;
--
1.5.2.rc1.25.g889f-dirty
^ permalink raw reply related
* [PATCH 5/5] git-clone: add --submodules for cloning submodules
From: Sven Verdoolaege @ 2007-05-04 10:56 UTC (permalink / raw)
To: git; +Cc: Sven Verdoolaege
In-Reply-To: <11782762032207-git-send-email-skimo@liacs.nl>
From: Sven Verdoolaege <skimo@kotnet.org>
When the --submodules option is specified, git-clone will search
for submodule.<submodule>.url options in the remote configuration
and clone each submodule using the first url that it can use from
the local site.
The submodules are currently not checked out.
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
---
Documentation/config.txt | 3 ++
Documentation/git-clone.txt | 6 +++-
git-clone.sh | 68 ++++++++++++++++++++++++++++++++++++++++++-
3 files changed, 75 insertions(+), 2 deletions(-)
diff --git a/Documentation/config.txt b/Documentation/config.txt
index 24f9655..92747d8 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -597,6 +597,9 @@ showbranch.default::
The default set of branches for gitlink:git-show-branch[1].
See gitlink:git-show-branch[1].
+submodule.<submodule>.url
+ The URL of a submodule. See gitlink:git-clone[1].
+
tar.umask::
By default, gitlink:git-tar-tree[1] sets file and directories modes
to 0666 or 0777. While this is both useful and acceptable for projects
diff --git a/Documentation/git-clone.txt b/Documentation/git-clone.txt
index 6d32c49..b112a6a 100644
--- a/Documentation/git-clone.txt
+++ b/Documentation/git-clone.txt
@@ -11,7 +11,7 @@ SYNOPSIS
[verse]
'git-clone' [--template=<template_directory>] [-l [-s]] [-q] [-n] [--bare]
[-o <name>] [-u <upload-pack>] [--reference <repository>]
- [--depth <depth>] <repository> [<directory>]
+ [--depth <depth>] [--submodules] <repository> [<directory>]
DESCRIPTION
-----------
@@ -105,6 +105,10 @@ OPTIONS
with a long history, and would want to send in a fixes
as patches.
+--submodules::
+ Clone submodules specified in (remote) configuration parameters
+ submodule.<submodule>.url.
+
<repository>::
The (possibly remote) repository to clone from. It can
be any URL git-fetch supports.
diff --git a/git-clone.sh b/git-clone.sh
index cad5c0c..3a9b09c 100755
--- a/git-clone.sh
+++ b/git-clone.sh
@@ -14,7 +14,7 @@ die() {
}
usage() {
- die "Usage: $0 [--template=<template_directory>] [--reference <reference-repo>] [--bare] [-l [-s]] [-q] [-u <upload-pack>] [--origin <name>] [--depth <n>] [-n] <repo> [<dir>]"
+ die "Usage: $0 [--template=<template_directory>] [--reference <reference-repo>] [--bare] [-l [-s]] [-q] [-u <upload-pack>] [--origin <name>] [--depth <n>] [-n] [--submodules] <repo> [<dir>]"
}
get_repo_base() {
@@ -67,6 +67,60 @@ Perhaps git-update-server-info needs to be run there?"
rm -f "$GIT_DIR/REMOTE_HEAD"
}
+local_URL() {
+ # tranforms a "URL" on the remote to a URL that works on the local machine
+ # $1 - remote, $2 - URL on remote
+ case "$1" in
+ https://*|http://*|ftp://*)
+ case "$2" in
+ https://*|http://*|ftp://*)
+ echo $2
+ esac
+ ;;
+ ssh://*)
+ case "$2" in
+ https://*|http://*|ftp://*)
+ echo $2
+ ;;
+ /*)
+ echo $(echo $1 | sed -e 's/\(ssh:\/\/[^\/]*\)\/.*/\1/')$2
+ esac
+ ;;
+ /*)
+ echo $2
+ ;;
+ *)
+ case "$2" in
+ https://*|http://*|ftp://*)
+ echo $2
+ esac
+ esac
+}
+
+clone_submodules () {
+ # $1 - remote
+ previous=
+ git-config --remote=$1 --get-regexp 'submodule\..*\.url' | \
+ sed -e 's/^submodule\.//;s/\.url / /' |
+ while read submodule URL
+ do
+ echo "$submodule $URL"
+ if test "$submodule" = "$previous"
+ then
+ continue;
+ fi
+ URL=$(local_URL "$1" "$URL")
+ echo "$submodule $URL"
+ if test -z "$URL"
+ then
+ continue;
+ fi
+ git-clone -n "$URL" "$submodule"
+ git-config "submodule.$submodule.url" "$URL"
+ previous="$submodule"
+ done
+}
+
quiet=
local=no
use_local=no
@@ -81,6 +135,7 @@ origin_override=
use_separate_remote=t
depth=
no_progress=
+submodules=
test -t 1 || no_progress=--no-progress
while
case "$#,$1" in
@@ -131,6 +186,8 @@ while
*,--depth)
shift
depth="--depth=$1";;
+ *,--su|*,--sub|*,--subm|*,--submo|*,--submod|*,--submodu|*,--submodul|\
+ *,--submodule|*,--submodules) submodules=yes ;;
*,-*) usage ;;
*) break ;;
esac
@@ -149,6 +206,10 @@ then
then
die '--bare and --origin $origin options are incompatible.'
fi
+ if test yes = "$submodules"
+ then
+ die '--bare and --submodules origin options are incompatible.'
+ fi
no_checkout=yes
use_separate_remote=
fi
@@ -394,6 +455,11 @@ then
git-config branch."$head_points_at".merge "refs/heads/$head_points_at"
esac
+ if test yes = "$submodules"
+ then
+ clone_submodules "$repo"
+ fi
+
case "$no_checkout" in
'')
test "z$quiet" = z -a "z$no_progress" = z && v=-v || v=
--
1.5.2.rc1.25.g889f-dirty
^ permalink raw reply related
* [PATCH 1/5] Add dump-config
From: Sven Verdoolaege @ 2007-05-04 10:56 UTC (permalink / raw)
To: git; +Cc: Sven Verdoolaege
In-Reply-To: <11782762032207-git-send-email-skimo@liacs.nl>
From: Sven Verdoolaege <skimo@kotnet.org>
This command dumps the config of a repository and will be used
to read config options from a remote site.
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
---
.gitignore | 1 +
Documentation/cmd-list.perl | 1 +
Documentation/git-dump-config.txt | 37 +++++++++++++++++++++++++++++++++++++
Makefile | 1 +
daemon.c | 7 +++++++
dump-config.c | 29 +++++++++++++++++++++++++++++
6 files changed, 76 insertions(+), 0 deletions(-)
create mode 100644 Documentation/git-dump-config.txt
create mode 100644 dump-config.c
diff --git a/.gitignore b/.gitignore
index 4dc0c39..d4e5492 100644
--- a/.gitignore
+++ b/.gitignore
@@ -38,6 +38,7 @@ git-diff-files
git-diff-index
git-diff-tree
git-describe
+git-dump-config
git-fast-import
git-fetch
git-fetch--tool
diff --git a/Documentation/cmd-list.perl b/Documentation/cmd-list.perl
index 443802a..fa04615 100755
--- a/Documentation/cmd-list.perl
+++ b/Documentation/cmd-list.perl
@@ -103,6 +103,7 @@ git-diff-files plumbinginterrogators
git-diff-index plumbinginterrogators
git-diff mainporcelain
git-diff-tree plumbinginterrogators
+git-dump-config synchelpers
git-fast-import ancillarymanipulators
git-fetch mainporcelain
git-fetch-pack synchingrepositories
diff --git a/Documentation/git-dump-config.txt b/Documentation/git-dump-config.txt
new file mode 100644
index 0000000..370781c
--- /dev/null
+++ b/Documentation/git-dump-config.txt
@@ -0,0 +1,37 @@
+git-dump-config(1)
+====================
+
+NAME
+----
+git-dump-config - Dump config options
+
+
+SYNOPSIS
+--------
+'git-dump-config' <directory>
+
+DESCRIPTION
+-----------
+Invoked by 'git-config --remote' and dumps the config file to the
+other end over the git protocol.
+
+This command is usually not invoked directly by the end user. The UI
+for the protocol is on the 'git-config' side, where it is used to get
+options from a remote repository.
+
+OPTIONS
+-------
+<directory>::
+ The repository to get the config options from.
+
+Author
+------
+Written by Sven Verdoolaege.
+
+Documentation
+--------------
+Documentation by Sven Verdoolaege.
+
+GIT
+---
+Part of the gitlink:git[7] suite
diff --git a/Makefile b/Makefile
index e0a1308..0185386 100644
--- a/Makefile
+++ b/Makefile
@@ -232,6 +232,7 @@ PROGRAMS = \
git-fast-import$X \
git-merge-base$X \
git-daemon$X \
+ git-dump-config$X \
git-merge-index$X git-mktag$X git-mktree$X git-patch-id$X \
git-peek-remote$X git-receive-pack$X \
git-send-pack$X git-shell$X \
diff --git a/daemon.c b/daemon.c
index e74ecac..3e5ebf3 100644
--- a/daemon.c
+++ b/daemon.c
@@ -378,10 +378,17 @@ static int receive_pack(void)
return -1;
}
+static int dump_config(void)
+{
+ execl_git_cmd("dump-config", ".", NULL);
+ return -1;
+}
+
static struct daemon_service daemon_service[] = {
{ "upload-archive", "uploadarch", upload_archive, 0, 1 },
{ "upload-pack", "uploadpack", upload_pack, 1, 1 },
{ "receive-pack", "receivepack", receive_pack, 0, 1 },
+ { "dump-config", "dumpconfig", dump_config, 0, 1 },
};
static void enable_service(const char *name, int ena) {
diff --git a/dump-config.c b/dump-config.c
new file mode 100644
index 0000000..355920d
--- /dev/null
+++ b/dump-config.c
@@ -0,0 +1,29 @@
+#include "git-compat-util.h"
+#include "cache.h"
+#include "pkt-line.h"
+
+static const char dump_config_usage[] = "git-dump-config <dir>";
+
+static int dump_config(const char *var, const char *value)
+{
+ packet_write(1, "%s", var);
+ packet_write(1, "%s", value);
+ return 0;
+}
+
+int main(int argc, char **argv)
+{
+ char *dir;
+
+ if (argc != 2)
+ usage(dump_config_usage);
+
+ dir = argv[1];
+ if (!enter_repo(dir, 0))
+ die("'%s': unable to chdir or not a git archive", dir);
+
+ git_config(dump_config);
+ packet_flush(1);
+
+ return 0;
+}
--
1.5.2.rc1.25.g889f-dirty
^ permalink raw reply related
* Initial support for cloning submodules
From: Sven Verdoolaege @ 2007-05-04 10:56 UTC (permalink / raw)
To: git; +Cc: Sven Verdoolaege
From: Sven Verdoolaege <skimo@kotnet.org>
This patch series implements a mechanism for cloning submodules.
Each submodule is specified by a 'submodule.<submodule>.url'
configuration option, e.g.,
bash-3.00$ ./git-config --remote=http://www.liacs.nl/~sverdool/isa.git --get-regexp 'submodule\..*\.url'
submodule.cloog.url /home/sverdool/public_html/cloog.git
submodule.cloog.url http://www.liacs.nl/~sverdool/cloog.git
git-clone will use the first url that works.
E.g., a
git clone --submodules ssh://liacs/~/public_html/isa.git
(which only works for me), will use the first url, while a
git clone --submodules http://www.liacs.nl/~sverdool/isa.git
will use the second.
The submodules are currently not checked out.
skimo
^ permalink raw reply
* [PATCH 3/5] http.h: make fill_active_slots a function pointer
From: Sven Verdoolaege @ 2007-05-04 10:56 UTC (permalink / raw)
To: git; +Cc: Sven Verdoolaege
In-Reply-To: <11782762032207-git-send-email-skimo@liacs.nl>
From: Sven Verdoolaege <skimo@kotnet.org>
This allows us to use the methods provided by http.c
from within libgit, in particular config.c.
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
---
http-fetch.c | 5 ++++-
http-push.c | 5 ++++-
http.h | 2 +-
3 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/http-fetch.c b/http-fetch.c
index 09baedc..53fb2a9 100644
--- a/http-fetch.c
+++ b/http-fetch.c
@@ -317,7 +317,7 @@ static void release_object_request(struct object_request *obj_req)
}
#ifdef USE_CURL_MULTI
-void fill_active_slots(void)
+static void fetch_fill_active_slots(void)
{
struct object_request *obj_req = object_queue_head;
struct active_request_slot *slot = active_queue_head;
@@ -1031,6 +1031,9 @@ int main(int argc, const char **argv)
}
url = argv[arg];
+#ifdef USE_CURL_MULTI
+ fill_active_slots = fetch_fill_active_slots;
+#endif
http_init();
no_pragma_header = curl_slist_append(no_pragma_header, "Pragma:");
diff --git a/http-push.c b/http-push.c
index e3f7675..d4c850b 100644
--- a/http-push.c
+++ b/http-push.c
@@ -794,7 +794,7 @@ static void finish_request(struct transfer_request *request)
}
#ifdef USE_CURL_MULTI
-void fill_active_slots(void)
+static void push_fill_active_slots(void)
{
struct transfer_request *request = request_queue_head;
struct transfer_request *next;
@@ -2355,6 +2355,9 @@ int main(int argc, char **argv)
memset(remote_dir_exists, -1, 256);
+#ifdef USE_CURL_MULTI
+ fill_active_slots = push_fill_active_slots;
+#endif
http_init();
no_pragma_header = curl_slist_append(no_pragma_header, "Pragma:");
diff --git a/http.h b/http.h
index 69b6b66..7a41cde 100644
--- a/http.h
+++ b/http.h
@@ -69,7 +69,7 @@ extern void finish_all_active_slots(void);
extern void release_active_slot(struct active_request_slot *slot);
#ifdef USE_CURL_MULTI
-extern void fill_active_slots(void);
+extern void (*fill_active_slots)(void);
extern void step_active_slots(void);
#endif
--
1.5.2.rc1.25.g889f-dirty
^ permalink raw reply related
* Re: [git-svn PATCH] Add --no-rebase option to git-svn dcommit
From: David Kågedal @ 2007-05-04 9:08 UTC (permalink / raw)
To: git
In-Reply-To: <20070504075908.GB17526@muzzle>
Eric Wong <normalperson@yhbt.net> writes:
> Karl Hasselström <kha@treskal.com> wrote:
>> git-svn dcommit exports commits to Subversion, then imports them back
>> to git again, and last but not least rebases or resets HEAD to the
>> last of the new commits. I guess this rebasing is convenient when
>> using just git, but when the commits to be exported are managed by
>> StGIT, it's really annoying. So add an option to disable this
>> behavior. And document it, too!
>
> Cool, I've been planning to add this myself, too.
One thing I haven't figured out, although I haven't looked at the code
much, is this: When does git-svn do a merge rather than a rebase?
How can there ever be a diff? Is this perhaps something that can
happen if you use set-tree, because I don't see how it happens with
dcommit.
--
David Kågedal
^ permalink raw reply
* Re: [RFC?] Telling git about more complex relationships between commits (Was: Re: FFmpeg considering GIT)
From: Petr Baudis @ 2007-05-04 11:10 UTC (permalink / raw)
To: Johan Herland; +Cc: git
In-Reply-To: <200705040921.33443.johan@herland.net>
On Fri, May 04, 2007 at 09:21:29AM CEST, Johan Herland wrote:
> On Friday 04 May 2007, Jakub Narebski wrote:
> > Besides I think it would be better to teach blame to ignore reversion
> > commits (for example based on first line of commit message) than to
> > mess with the history.
>
> I'm starting to see a pattern where people would like to tell git about
> more complicated relationships between commits, so that git can make
> more intelligent decisions when doing merge, blame, pickaxe, etc.
>
> Adding these relationships as part of the commit message seems like a
> really stupid idea because git suddenly has to make sense of something
> it has never parsed before, thus making all future and former git
> commit messages a potential target for pattern (mis)matching by git.
> Also, we seem to forget that we already have the perfect place to put
> such information: The header fields preceding the commit message.
>
> I therefore propose adding header field names to commit objects that
> illustrate the relationships people want to tell git about.
So I've looked it up, and the Linus' writeup on this is at
http://news.gmane.org/find-root.php?message_id=<Pine.LNX.4.64.0604250758000.3701@g5.osdl.org>
> 1. "Reverts": Mark a commit as reverting another commit. This could be
> used by git-log to cancel out pairs of commits, resulting in a cleaner
> view of history. It can help blame/annotate. There are probably other
> tools that can benefit from this information also.
Actually I think git-log is the one tool which shouldn't cancel it
out. The number of reverts likely won't be overwhelming and reverting is
actually pretty important event - it says "this has been tried and we
decided it's not the way", also can have social meanings etc. It is an
important piece of history. And people still want to actually see the
change and possibly revive it. BTW, imagine their confusion if the
history looks like
1abcd5 Feature X
37efab Release 2.3.1
724b9c Revert feature X
and git log would cancel out 1abcd5 and 724b9c. Feature X is part of
2.3.1 but not in the log..?!
The point is that the reverting/reverted commit pairs don't affect
your current content (except maybe in an highly abstract way), and this
is why pickaxe and blame should skip it (by default).
The question wrt. Linus' criteria is if "it has enough of a meaning",
and I wonder about that too. I think it does, though.
For the other suggested headers, it should be already mostly obvious
from Linus' writeup why they shouldn't qualify, though.
--
Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
Ever try. Ever fail. No matter. // Try again. Fail again. Fail better.
-- Samuel Beckett
^ permalink raw reply
* Initial support for cloning submodules
From: Sven Verdoolaege @ 2007-05-04 10:49 UTC (permalink / raw)
To: git; +Cc: Sven Verdoolaege
From: Sven Verdoolaege <skimo@kotnet.org>
This patch series implements a mechanism for cloning submodules.
Each submodule is specified by a 'submodule.<submodule>.url'
configuration option, e.g.,
bash-3.00$ ./git-config --remote=http://www.liacs.nl/~sverdool/isa.git --get-regexp 'submodule\..*\.url'
submodule.cloog.url /home/sverdool/public_html/cloog.git
submodule.cloog.url http://www.liacs.nl/~sverdool/cloog.git
git-clone will use the first url that works.
E.g., a
git clone --submodules ssh://liacs/~/public_html/isa.git
(which only works for me), will use the first url, while a
git clone --submodules http://www.liacs.nl/~sverdool/isa.git
will use the second.
The submodules are currently not checked out.
skimo
^ permalink raw reply
* [PATCH] http.h: make fill_active_slots a function pointer
From: Sven Verdoolaege @ 2007-05-04 10:49 UTC (permalink / raw)
To: git; +Cc: Sven Verdoolaege
In-Reply-To: <11782757671754-git-send-email-skimo@liacs.nl>
From: Sven Verdoolaege <skimo@kotnet.org>
This allows us to use the methods provided by http.c
from within libgit, in particular config.c.
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
---
http-fetch.c | 5 ++++-
http-push.c | 5 ++++-
http.h | 2 +-
3 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/http-fetch.c b/http-fetch.c
index 09baedc..53fb2a9 100644
--- a/http-fetch.c
+++ b/http-fetch.c
@@ -317,7 +317,7 @@ static void release_object_request(struct object_request *obj_req)
}
#ifdef USE_CURL_MULTI
-void fill_active_slots(void)
+static void fetch_fill_active_slots(void)
{
struct object_request *obj_req = object_queue_head;
struct active_request_slot *slot = active_queue_head;
@@ -1031,6 +1031,9 @@ int main(int argc, const char **argv)
}
url = argv[arg];
+#ifdef USE_CURL_MULTI
+ fill_active_slots = fetch_fill_active_slots;
+#endif
http_init();
no_pragma_header = curl_slist_append(no_pragma_header, "Pragma:");
diff --git a/http-push.c b/http-push.c
index e3f7675..d4c850b 100644
--- a/http-push.c
+++ b/http-push.c
@@ -794,7 +794,7 @@ static void finish_request(struct transfer_request *request)
}
#ifdef USE_CURL_MULTI
-void fill_active_slots(void)
+static void push_fill_active_slots(void)
{
struct transfer_request *request = request_queue_head;
struct transfer_request *next;
@@ -2355,6 +2355,9 @@ int main(int argc, char **argv)
memset(remote_dir_exists, -1, 256);
+#ifdef USE_CURL_MULTI
+ fill_active_slots = push_fill_active_slots;
+#endif
http_init();
no_pragma_header = curl_slist_append(no_pragma_header, "Pragma:");
diff --git a/http.h b/http.h
index 69b6b66..7a41cde 100644
--- a/http.h
+++ b/http.h
@@ -69,7 +69,7 @@ extern void finish_all_active_slots(void);
extern void release_active_slot(struct active_request_slot *slot);
#ifdef USE_CURL_MULTI
-extern void fill_active_slots(void);
+extern void (*fill_active_slots)(void);
extern void step_active_slots(void);
#endif
--
1.5.2.rc1.25.g889f-dirty
^ permalink raw reply related
* [PATCH] Add dump-config
From: Sven Verdoolaege @ 2007-05-04 10:49 UTC (permalink / raw)
To: git; +Cc: Sven Verdoolaege
In-Reply-To: <11782757671754-git-send-email-skimo@liacs.nl>
From: Sven Verdoolaege <skimo@kotnet.org>
This command dumps the config of a repository and will be used
to read config options from a remote site.
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
---
.gitignore | 1 +
Documentation/cmd-list.perl | 1 +
Documentation/git-dump-config.txt | 37 +++++++++++++++++++++++++++++++++++++
Makefile | 1 +
daemon.c | 7 +++++++
dump-config.c | 29 +++++++++++++++++++++++++++++
6 files changed, 76 insertions(+), 0 deletions(-)
create mode 100644 Documentation/git-dump-config.txt
create mode 100644 dump-config.c
diff --git a/.gitignore b/.gitignore
index 4dc0c39..d4e5492 100644
--- a/.gitignore
+++ b/.gitignore
@@ -38,6 +38,7 @@ git-diff-files
git-diff-index
git-diff-tree
git-describe
+git-dump-config
git-fast-import
git-fetch
git-fetch--tool
diff --git a/Documentation/cmd-list.perl b/Documentation/cmd-list.perl
index 443802a..fa04615 100755
--- a/Documentation/cmd-list.perl
+++ b/Documentation/cmd-list.perl
@@ -103,6 +103,7 @@ git-diff-files plumbinginterrogators
git-diff-index plumbinginterrogators
git-diff mainporcelain
git-diff-tree plumbinginterrogators
+git-dump-config synchelpers
git-fast-import ancillarymanipulators
git-fetch mainporcelain
git-fetch-pack synchingrepositories
diff --git a/Documentation/git-dump-config.txt b/Documentation/git-dump-config.txt
new file mode 100644
index 0000000..370781c
--- /dev/null
+++ b/Documentation/git-dump-config.txt
@@ -0,0 +1,37 @@
+git-dump-config(1)
+====================
+
+NAME
+----
+git-dump-config - Dump config options
+
+
+SYNOPSIS
+--------
+'git-dump-config' <directory>
+
+DESCRIPTION
+-----------
+Invoked by 'git-config --remote' and dumps the config file to the
+other end over the git protocol.
+
+This command is usually not invoked directly by the end user. The UI
+for the protocol is on the 'git-config' side, where it is used to get
+options from a remote repository.
+
+OPTIONS
+-------
+<directory>::
+ The repository to get the config options from.
+
+Author
+------
+Written by Sven Verdoolaege.
+
+Documentation
+--------------
+Documentation by Sven Verdoolaege.
+
+GIT
+---
+Part of the gitlink:git[7] suite
diff --git a/Makefile b/Makefile
index e0a1308..0185386 100644
--- a/Makefile
+++ b/Makefile
@@ -232,6 +232,7 @@ PROGRAMS = \
git-fast-import$X \
git-merge-base$X \
git-daemon$X \
+ git-dump-config$X \
git-merge-index$X git-mktag$X git-mktree$X git-patch-id$X \
git-peek-remote$X git-receive-pack$X \
git-send-pack$X git-shell$X \
diff --git a/daemon.c b/daemon.c
index e74ecac..3e5ebf3 100644
--- a/daemon.c
+++ b/daemon.c
@@ -378,10 +378,17 @@ static int receive_pack(void)
return -1;
}
+static int dump_config(void)
+{
+ execl_git_cmd("dump-config", ".", NULL);
+ return -1;
+}
+
static struct daemon_service daemon_service[] = {
{ "upload-archive", "uploadarch", upload_archive, 0, 1 },
{ "upload-pack", "uploadpack", upload_pack, 1, 1 },
{ "receive-pack", "receivepack", receive_pack, 0, 1 },
+ { "dump-config", "dumpconfig", dump_config, 0, 1 },
};
static void enable_service(const char *name, int ena) {
diff --git a/dump-config.c b/dump-config.c
new file mode 100644
index 0000000..355920d
--- /dev/null
+++ b/dump-config.c
@@ -0,0 +1,29 @@
+#include "git-compat-util.h"
+#include "cache.h"
+#include "pkt-line.h"
+
+static const char dump_config_usage[] = "git-dump-config <dir>";
+
+static int dump_config(const char *var, const char *value)
+{
+ packet_write(1, "%s", var);
+ packet_write(1, "%s", value);
+ return 0;
+}
+
+int main(int argc, char **argv)
+{
+ char *dir;
+
+ if (argc != 2)
+ usage(dump_config_usage);
+
+ dir = argv[1];
+ if (!enter_repo(dir, 0))
+ die("'%s': unable to chdir or not a git archive", dir);
+
+ git_config(dump_config);
+ packet_flush(1);
+
+ return 0;
+}
--
1.5.2.rc1.25.g889f-dirty
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox