From ed0b9d43097349f4d730472673c07f427480e14a Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 14 Mar 2008 11:01:23 -0700 Subject: git-svn: don't blindly append '*' to branch/tags config Previously, git-svn would blindly append '*' even if it was specified by the user during initialization (for certain SVN setups, it is necessary). Now, the following command will work correctly: git svn init -T trunk/docutils \ -t 'tags/*/docutils' \ -b 'branches/*/docutils' \ svn://svn.berlios.de/docutils Thanks to martin f krafft for the bug report: > My git-svn target configuration is > > [svn-remote "svn"] > url = svn://svn.berlios.de/docutils > fetch = trunk/docutils:refs/remotes/trunk > branches = branches/*/docutils:refs/remotes/* > tags = tags/*/docutils:refs/remotes/tags/* > > Unfortunately, when I run > > git-svn init -T trunk/docutils -t 'tags/*/docutils' > -b 'branches/*/docutils' > > then I get (note the two asterisks on the left hand side): > > branches = branches/*/docutils/*:refs/remotes/* > tags = tags/*/docutils/*:refs/remotes/tags/* > > I took a brief stab at the code but I can't even figure out where > the /* is appended, so I defer to you. > > It should be trivial to keep git-svn from appending /* if the left > side already contains an asterisk. Signed-off-by: Eric Wong Tested-by: martin f krafft Signed-off-by: Junio C Hamano --- git-svn.perl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/git-svn.perl b/git-svn.perl index 38e1d5944d..e0434099ce 100755 --- a/git-svn.perl +++ b/git-svn.perl @@ -955,9 +955,10 @@ sub complete_url_ls_init { "wanted to set to: $gs->{url}\n"; } command_oneline('config', $k, $gs->{url}) unless $orig_url; - my $remote_path = "$ra->{svn_path}/$repo_path/*"; + my $remote_path = "$ra->{svn_path}/$repo_path"; $remote_path =~ s#/+#/#g; $remote_path =~ s#^/##g; + $remote_path .= "/*" if $remote_path !~ /\*/; my ($n) = ($switch =~ /^--(\w+)/); if (length $pfx && $pfx !~ m#/$#) { die "--prefix='$pfx' must have a trailing slash '/'\n"; -- cgit v1.2.3 From 621ff6759414e2a723f61b6d8fc04b9805eb0c20 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Fri, 14 Mar 2008 11:49:40 -0700 Subject: rev-parse: fix meaning of rev~ vs rev~0. I think it would make more sense for rev~ to have the same guarantees that rev^ has, namely to always return a commit. I would also suggest that not giving a number would have the same effect of defaulting to 1, not 0. Right now it's a bit illogical, but at least it's an _undocumented_ illogical behaviour. This patch makes '^' and '~' act the same for the default count (i.e. both default to 1), and also have the same behaviour for a count of zero. Before (no discernible pattern): [torvalds@woody git]$ git rev-parse v1.5.1 v1.5.1^0 v1.5.1~0 v1.5.1^ v1.5.1~ 45354a57ee7e3e42c7137db6c94fa968c6babe8d 89815cab95268e8f0f58142b848ac4cd5e9cbdcb 45354a57ee7e3e42c7137db6c94fa968c6babe8d 045f5759c97746589a067461e50fad16f60711ac 45354a57ee7e3e42c7137db6c94fa968c6babe8d After (fairly logical): [torvalds@woody git]$ git rev-parse v1.5.1 v1.5.1^0 v1.5.1~0 v1.5.1^ v1.5.1~ 45354a57ee7e3e42c7137db6c94fa968c6babe8d 89815cab95268e8f0f58142b848ac4cd5e9cbdcb 89815cab95268e8f0f58142b848ac4cd5e9cbdcb 045f5759c97746589a067461e50fad16f60711ac 045f5759c97746589a067461e50fad16f60711ac Signed-off-by: Linus Torvalds Signed-off-by: Junio C Hamano --- sha1_name.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/sha1_name.c b/sha1_name.c index 13e11645e1..6c9c1c75ad 100644 --- a/sha1_name.c +++ b/sha1_name.c @@ -408,18 +408,22 @@ static int get_nth_ancestor(const char *name, int len, unsigned char *result, int generation) { unsigned char sha1[20]; - int ret = get_sha1_1(name, len, sha1); + struct commit *commit; + int ret; + + ret = get_sha1_1(name, len, sha1); if (ret) return ret; + commit = lookup_commit_reference(sha1); + if (!commit) + return -1; while (generation--) { - struct commit *commit = lookup_commit_reference(sha1); - - if (!commit || parse_commit(commit) || !commit->parents) + if (parse_commit(commit) || !commit->parents) return -1; - hashcpy(sha1, commit->parents->item->object.sha1); + commit = commit->parents->item; } - hashcpy(result, sha1); + hashcpy(result, commit->object.sha1); return 0; } @@ -526,9 +530,8 @@ static int get_sha1_1(const char *name, int len, unsigned char *sha1) int ret, has_suffix; const char *cp; - /* "name~3" is "name^^^", - * "name~" and "name~0" are name -- not "name^0"! - * "name^" is not "name^0"; it is "name^1". + /* + * "name~3" is "name^^^", "name~" is "name~1", and "name^" is "name^1". */ has_suffix = 0; for (cp = name + len - 1; name <= cp; cp--) { @@ -546,11 +549,10 @@ static int get_sha1_1(const char *name, int len, unsigned char *sha1) cp++; while (cp < name + len) num = num * 10 + *cp++ - '0'; - if (has_suffix == '^') { - if (!num && len1 == len - 1) - num = 1; + if (!num && len1 == len - 1) + num = 1; + if (has_suffix == '^') return get_parent(name, len1, sha1, num); - } /* else if (has_suffix == '~') -- goes without saying */ return get_nth_ancestor(name, len1, sha1, num); } -- cgit v1.2.3 From ac378633f3cae46d2c88255e53ee38a6206d3777 Mon Sep 17 00:00:00 2001 From: Bernt Hansen Date: Fri, 14 Mar 2008 22:44:13 -0400 Subject: git-new-workdir: Share SVN meta data between work dirs and the repository Multiple work dirs with git svn caused each work dir to have its own stale copy of the SVN meta data in .git/svn git svn rebase updates commits with git-svn-id: in the repository and stores the SVN meta data information only in that work dir. Attempting to git svn rebase in other work dirs for the same branch would fail because the last revision fetched according to the git-svn-id is greater than the revision in the SVN meta data for that work directory. Signed-off-by: Bernt Hansen Acked-by: Eric Wong Signed-off-by: Junio C Hamano --- contrib/workdir/git-new-workdir | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/workdir/git-new-workdir b/contrib/workdir/git-new-workdir index 2838546d16..7959eab902 100755 --- a/contrib/workdir/git-new-workdir +++ b/contrib/workdir/git-new-workdir @@ -63,7 +63,7 @@ mkdir -p "$new_workdir/.git" || die "unable to create \"$new_workdir\"!" # create the links to the original repo. explictly exclude index, HEAD and # logs/HEAD from the list since they are purely related to the current working # directory, and should not be shared. -for x in config refs logs/refs objects info hooks packed-refs remotes rr-cache +for x in config refs logs/refs objects info hooks packed-refs remotes rr-cache svn do case $x in */*) -- cgit v1.2.3 From a0b54e7b73415f92225ddf29fe655399bafd4938 Mon Sep 17 00:00:00 2001 From: Jonas Fonseca Date: Fri, 14 Mar 2008 22:38:18 +0100 Subject: Make man page building quiet when DOCBOOK_XSL_172 is defined Tell xmlto to repress printing of the lines: Note: meta date : No date. Using generated date git-xyx Note: Writing git-xyz.1 Signed-off-by: Jonas Fonseca Signed-off-by: Junio C Hamano --- Documentation/manpage-1.72.xsl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Documentation/manpage-1.72.xsl b/Documentation/manpage-1.72.xsl index fe3cd72d6f..4065a3a27a 100644 --- a/Documentation/manpage-1.72.xsl +++ b/Documentation/manpage-1.72.xsl @@ -1,5 +1,9 @@ - + + + + + -- cgit v1.2.3