All of lore.kernel.org
 help / color / mirror / Atom feed
* Bug: "git svn clone" does not honor svn.authorsfile setting
@ 2009-11-10 13:09 Curt Sampson
  2009-11-10 13:24 ` Sverre Rabbelier
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Curt Sampson @ 2009-11-10 13:09 UTC (permalink / raw)
  To: git

[Note that I've set Reply-to to both myself and this list, as I am not
subscribed to the list. Broken list software and MUAs sometimes don't
honor this. Check to whom you're replying!]

When using "git svn fetch" or "git svn clone", the --authors-file
command line parameter does what it claims in the docs. Additionally,
for "git svn fetch", an svn.authorsfile configuration parameter in
~/.gitconfig is used, if no command line argument is specified. However,
svn.authorsfile is ignored by "git svn clone", though the documentation
claims that clone "runs init and fetch."

I have confirmed this bug is present in git versions 1.6.0.4 and 1.6.5.1.

cjs
-- 
Curt Sampson       <cjs@starling-software.com>        +81 90 7737 2974
           Functional programming in all senses of the word:
                   http://www.starling-software.com

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Bug: "git svn clone" does not honor svn.authorsfile setting
  2009-11-10 13:09 Bug: "git svn clone" does not honor svn.authorsfile setting Curt Sampson
@ 2009-11-10 13:24 ` Sverre Rabbelier
  2009-11-10 20:18   ` Junio C Hamano
  2009-11-13 14:02   ` Curt Sampson
  2009-11-11  4:26 ` Sam Vilain
  2009-11-14 22:39 ` [PATCH] git svn: read global+system config for clone+init Eric Wong
  2 siblings, 2 replies; 8+ messages in thread
From: Sverre Rabbelier @ 2009-11-10 13:24 UTC (permalink / raw)
  To: Curt Sampson, git

Heya,

On Tue, Nov 10, 2009 at 14:09, Curt Sampson <cjs@cynic.net> wrote:
> [Note that I've set Reply-to to both myself and this list, as I am not
> subscribed to the list. Broken list software and MUAs sometimes don't
> honor this. Check to whom you're replying!]

Please don't. It is custom on the git list to always keep those who
are involved in the conversation cc-ed, adding a Reply-to makes this
difficult.

-- 
Cheers,

Sverre Rabbelier

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Bug: "git svn clone" does not honor svn.authorsfile setting
  2009-11-10 13:24 ` Sverre Rabbelier
@ 2009-11-10 20:18   ` Junio C Hamano
  2009-11-13 14:02   ` Curt Sampson
  1 sibling, 0 replies; 8+ messages in thread
From: Junio C Hamano @ 2009-11-10 20:18 UTC (permalink / raw)
  To: Sverre Rabbelier; +Cc: Curt Sampson, git

Sverre Rabbelier <srabbelier@gmail.com> writes:

> On Tue, Nov 10, 2009 at 14:09, Curt Sampson <cjs@cynic.net> wrote:
>> [Note that I've set Reply-to to both myself and this list, as I am not
>> subscribed to the list. Broken list software and MUAs sometimes don't
>> honor this. Check to whom you're replying!]
>
> Please don't. It is custom on the git list to always keep those who
> are involved in the conversation cc-ed, adding a Reply-to makes this
> difficult.

I've seen people use Mail-Followup-To to cause grumbles, but Reply-To
seems worse in a sense.  If I wanted to respond _privately_ to Curt, and
said "Reply", the message would have been broadcast to the public, and I
am using a MUA that is *not* broken and honors this setting.

Not good.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Bug: "git svn clone" does not honor svn.authorsfile setting
  2009-11-10 13:09 Bug: "git svn clone" does not honor svn.authorsfile setting Curt Sampson
  2009-11-10 13:24 ` Sverre Rabbelier
@ 2009-11-11  4:26 ` Sam Vilain
  2009-11-13 14:06   ` Curt Sampson
  2009-11-14 22:39 ` [PATCH] git svn: read global+system config for clone+init Eric Wong
  2 siblings, 1 reply; 8+ messages in thread
From: Sam Vilain @ 2009-11-11  4:26 UTC (permalink / raw)
  To: Curt Sampson, git

Curt Sampson wrote:
> When using "git svn fetch" or "git svn clone", the --authors-file
> command line parameter does what it claims in the docs. Additionally,
> for "git svn fetch", an svn.authorsfile configuration parameter in
> ~/.gitconfig is used, if no command line argument is specified. However,
> svn.authorsfile is ignored by "git svn clone", though the documentation
> claims that clone "runs init and fetch."
>
> I have confirmed this bug is present in git versions 1.6.0.4 and 1.6.5.1.
>   

Does moving the line:

command_oneline('config', 'svn.authorsfile', $_authors) if $_authors;

Immediately prior to the "fetch_all" line before it fix the problem? It
looks strange for it to set it afterwards...

Sam

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Bug: "git svn clone" does not honor svn.authorsfile setting
  2009-11-10 13:24 ` Sverre Rabbelier
  2009-11-10 20:18   ` Junio C Hamano
@ 2009-11-13 14:02   ` Curt Sampson
  1 sibling, 0 replies; 8+ messages in thread
From: Curt Sampson @ 2009-11-13 14:02 UTC (permalink / raw)
  To: Sverre Rabbelier; +Cc: git

On 2009-11-10 14:24 +0100 (Tue), Sverre Rabbelier wrote:

> Please don't. It is custom on the git list to always keep those who
> are involved in the conversation cc-ed, adding a Reply-to makes this
> difficult.

If you're running your list without munging Reply-to, congratulations
to you. I'll avoid it from now on on this list. However, it's the case
that for many, many lists out there, if I did not include myself in a
Reply-to, the list would set the Reply-to to the list, and most MUAs
would automatically exclude me from the reply.

cjs
-- 
Curt Sampson       <cjs@starling-software.com>        +81 90 7737 2974
           Functional programming in all senses of the word:
                   http://www.starling-software.com

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Bug: "git svn clone" does not honor svn.authorsfile setting
  2009-11-11  4:26 ` Sam Vilain
@ 2009-11-13 14:06   ` Curt Sampson
  0 siblings, 0 replies; 8+ messages in thread
From: Curt Sampson @ 2009-11-13 14:06 UTC (permalink / raw)
  To: Sam Vilain; +Cc: git

On 2009-11-11 17:26 +1300 (Wed), Sam Vilain wrote:

> Does moving the line:
> 
> command_oneline('config', 'svn.authorsfile', $_authors) if $_authors;
> 
> Immediately prior to the "fetch_all" line before it fix the problem? It
> looks strange for it to set it afterwards...

That looks plausible to me, having had a quick look at the source, but
keep in mind I've already spent about 45 minutes debugging this problem
and figuring out how to file a bug report. I don't really have the time
at the moment to learn how to build and test new versions of git, unless
someone wants to walk me through it. I expect it would take rather less
time for someone in the know just to do the test.

cjs
-- 
Curt Sampson       <cjs@starling-software.com>        +81 90 7737 2974
           Functional programming in all senses of the word:
                   http://www.starling-software.com

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH] git svn: read global+system config for clone+init
  2009-11-10 13:09 Bug: "git svn clone" does not honor svn.authorsfile setting Curt Sampson
  2009-11-10 13:24 ` Sverre Rabbelier
  2009-11-11  4:26 ` Sam Vilain
@ 2009-11-14 22:39 ` Eric Wong
  2009-11-14 22:50   ` Eric Wong
  2 siblings, 1 reply; 8+ messages in thread
From: Eric Wong @ 2009-11-14 22:39 UTC (permalink / raw)
  To: Curt Sampson, Junio C Hamano; +Cc: git

Curt Sampson <cjs@cynic.net> wrote:
> When using "git svn fetch" or "git svn clone", the --authors-file
> command line parameter does what it claims in the docs. Additionally,
> for "git svn fetch", an svn.authorsfile configuration parameter in
> ~/.gitconfig is used, if no command line argument is specified. However,
> svn.authorsfile is ignored by "git svn clone", though the documentation
> claims that clone "runs init and fetch."
> 
> I have confirmed this bug is present in git versions 1.6.0.4 and 1.6.5.1.

Hi Curt,

Thanks for the bug report, the following patch should fix
the bug.  Also pullable from git://git.bogomips.org/git-svn

>From 1a30582b43e137e16b3486d83bb86b0eb090e13d Mon Sep 17 00:00:00 2001
From: Eric Wong <normalperson@yhbt.net>
Date: Sat, 14 Nov 2009 14:25:11 -0800
Subject: [PATCH] git svn: read global+system config for clone+init

Since $GIT_DIR does not exist when initializing new repositories,
we can follow back to the global and system config files for
git.

The logic for this was originally introduced when
$GIT_DIR/config was the only config file git could read (back
when "git config" was "git repo-config"), so the function is
renamed to "read_git_config" instead of "read_repo_config".

Signed-off-by: Eric Wong <normalperson@yhbt.net>
---
 git-svn.perl |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/git-svn.perl b/git-svn.perl
index 27fbe30..ea922ac 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -274,7 +274,7 @@ unless ($cmd && $cmd =~ /(?:clone|init|multi-init)$/) {
 
 my %opts = %{$cmd{$cmd}->[2]} if (defined $cmd);
 
-read_repo_config(\%opts);
+read_git_config(\%opts);
 if ($cmd && ($cmd eq 'log' || $cmd eq 'blame')) {
 	Getopt::Long::Configure('pass_through');
 }
@@ -1390,8 +1390,7 @@ sub load_authors {
 }
 
 # convert GetOpt::Long specs for use by git-config
-sub read_repo_config {
-	return unless -d $ENV{GIT_DIR};
+sub read_git_config {
 	my $opts = shift;
 	my @config_only;
 	foreach my $o (keys %$opts) {
-- 
Eric Wong

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] git svn: read global+system config for clone+init
  2009-11-14 22:39 ` [PATCH] git svn: read global+system config for clone+init Eric Wong
@ 2009-11-14 22:50   ` Eric Wong
  0 siblings, 0 replies; 8+ messages in thread
From: Eric Wong @ 2009-11-14 22:50 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Curt Sampson

Eric Wong <normalperson@yhbt.net> wrote:
> Hi Curt,
> 
> Thanks for the bug report, the following patch should fix
> the bug.  Also pullable from git://git.bogomips.org/git-svn

It took me a while (possibly due to low caffeine levels) to make a
failing (automated) test case, but I've also pushed this out as
well.

>From e2f8617b266e320fd58ab584cae2ebe9906daaac Mon Sep 17 00:00:00 2001
From: Eric Wong <normalperson@yhbt.net>
Date: Sat, 14 Nov 2009 14:43:20 -0800
Subject: [PATCH] git svn: add authorsfile test case for ~/.gitconfig

The commit for:
    git svn: read global+system config for clone+init

Initially lacked a test case because the author was unable to
reproduce it under his test environment, this adds it.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
---
 t/t9130-git-svn-authors-file.sh |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/t/t9130-git-svn-authors-file.sh b/t/t9130-git-svn-authors-file.sh
index f5abdb3..134411e 100755
--- a/t/t9130-git-svn-authors-file.sh
+++ b/t/t9130-git-svn-authors-file.sh
@@ -91,4 +91,27 @@ test_expect_success 'fetch continues after authors-file is fixed' '
 	)
 	'
 
+test_expect_success 'fresh clone with svn.authors-file in config' '
+	(
+		rm -r "$GIT_DIR" &&
+		test x = x"$(git config svn.authorsfile)" &&
+		HOME="`pwd`" &&
+		export HOME &&
+		test_config="$HOME"/.gitconfig &&
+		unset GIT_CONFIG_NOGLOBAL &&
+		unset GIT_DIR &&
+		unset GIT_CONFIG &&
+		git config --global \
+		  svn.authorsfile "$HOME"/svn-authors &&
+		test x"$HOME"/svn-authors = x"$(git config svn.authorsfile)" &&
+		git svn clone "$svnrepo" gitconfig.clone &&
+		cd gitconfig.clone &&
+		nr_ex=$(git log | grep "^Author:.*example.com" | wc -l) &&
+		nr_rev=$(git rev-list HEAD | wc -l) &&
+		test $nr_rev -eq $nr_ex
+	)
+'
+
+test_debug 'GIT_DIR=gitconfig.clone/.git git log'
+
 test_done
-- 
Eric Wong

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-11-14 22:50 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-10 13:09 Bug: "git svn clone" does not honor svn.authorsfile setting Curt Sampson
2009-11-10 13:24 ` Sverre Rabbelier
2009-11-10 20:18   ` Junio C Hamano
2009-11-13 14:02   ` Curt Sampson
2009-11-11  4:26 ` Sam Vilain
2009-11-13 14:06   ` Curt Sampson
2009-11-14 22:39 ` [PATCH] git svn: read global+system config for clone+init Eric Wong
2009-11-14 22:50   ` Eric Wong

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.