{"thread":{"id":"21567","subject":"Bug: \"git svn clone\" does not honor svn.authorsfile setting","startedAt":"2009-11-10T13:09:13Z","lastAt":"2009-11-14T22:50:40Z","messageCount":8,"participants":["Curt Sampson","Sverre Rabbelier","Junio C Hamano","Sam Vilain","Eric Wong"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"127240","messageId":"20091110130913.GR19475@poetic.cynic.net","threadId":"21567","inReplyTo":null,"subject":"Bug: \"git svn clone\" does not honor svn.authorsfile setting","fromName":"Curt Sampson","fromEmail":"cjs@cynic.net","sentAt":"2009-11-10T13:09:13Z","receivedAt":"2009-11-10T13:09:13Z","isPatch":false,"sender":{"key":"cjs@cynic.net","avatar":"https://gravatar.com/avatar/290ced25da34aea160f5e968ef0f0d01d0ba2db5d1daba8a53f2e4935eccb030?d=mp&s=160"},"body":"[Note that I've set Reply-to to both myself and this list, as I am not\nsubscribed to the list. Broken list software and MUAs sometimes don't\nhonor this. Check to whom you're replying!]\n\nWhen using \"git svn fetch\" or \"git svn clone\", the --authors-file\ncommand line parameter does what it claims in the docs. Additionally,\nfor \"git svn fetch\", an svn.authorsfile configuration parameter in\n~/.gitconfig is used, if no command line argument is specified. However,\nsvn.authorsfile is ignored by \"git svn clone\", though the documentation\nclaims that clone \"runs init and fetch.\"\n\nI have confirmed this bug is present in git versions 1.6.0.4 and 1.6.5.1.\n\ncjs\n-- \nCurt Sampson       <cjs@starling-software.com>        +81 90 7737 2974\n           Functional programming in all senses of the word:\n                   http://www.starling-software.com\n"},{"id":"127241","messageId":"fabb9a1e0911100524p2cf3f2ebp698ecb50fc53f8e9@mail.gmail.com","threadId":"21567","inReplyTo":"20091110130913.GR19475@poetic.cynic.net","subject":"Re: Bug: \"git svn clone\" does not honor svn.authorsfile setting","fromName":"Sverre Rabbelier","fromEmail":"srabbelier@gmail.com","sentAt":"2009-11-10T13:24:35Z","receivedAt":"2009-11-10T13:24:35Z","isPatch":false,"sender":{"key":"srabbelier@gmail.com","avatar":"https://avatars.githubusercontent.com/u/3098?v=4"},"body":"Heya,\n\nOn Tue, Nov 10, 2009 at 14:09, Curt Sampson <cjs@cynic.net> wrote:\n> [Note that I've set Reply-to to both myself and this list, as I am not\n> subscribed to the list. Broken list software and MUAs sometimes don't\n> honor this. Check to whom you're replying!]\n\nPlease don't. It is custom on the git list to always keep those who\nare involved in the conversation cc-ed, adding a Reply-to makes this\ndifficult.\n\n-- \nCheers,\n\nSverre Rabbelier\n"},{"id":"127271","messageId":"7vzl6u5e1w.fsf@alter.siamese.dyndns.org","threadId":"21567","inReplyTo":"fabb9a1e0911100524p2cf3f2ebp698ecb50fc53f8e9@mail.gmail.com","subject":"Re: Bug: \"git svn clone\" does not honor svn.authorsfile setting","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-11-10T20:18:35Z","receivedAt":"2009-11-10T20:18:35Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Sverre Rabbelier <srabbelier@gmail.com> writes:\n\n> On Tue, Nov 10, 2009 at 14:09, Curt Sampson <cjs@cynic.net> wrote:\n>> [Note that I've set Reply-to to both myself and this list, as I am not\n>> subscribed to the list. Broken list software and MUAs sometimes don't\n>> honor this. Check to whom you're replying!]\n>\n> Please don't. It is custom on the git list to always keep those who\n> are involved in the conversation cc-ed, adding a Reply-to makes this\n> difficult.\n\nI've seen people use Mail-Followup-To to cause grumbles, but Reply-To\nseems worse in a sense.  If I wanted to respond _privately_ to Curt, and\nsaid \"Reply\", the message would have been broadcast to the public, and I\nam using a MUA that is *not* broken and honors this setting.\n\nNot good.\n"},{"id":"127292","messageId":"4AFA3D04.3050109@vilain.net","threadId":"21567","inReplyTo":"20091110130913.GR19475@poetic.cynic.net","subject":"Re: Bug: \"git svn clone\" does not honor svn.authorsfile setting","fromName":"Sam Vilain","fromEmail":"sam@vilain.net","sentAt":"2009-11-11T04:26:44Z","receivedAt":"2009-11-11T04:26:44Z","isPatch":false,"sender":{"key":"sam@vilain.net","avatar":"https://gravatar.com/avatar/8fc840ca854dbf6f7065b4335e3b934951c1dca3b11db688e95e471901f8f4a8?d=mp&s=160"},"body":"Curt Sampson wrote:\n> When using \"git svn fetch\" or \"git svn clone\", the --authors-file\n> command line parameter does what it claims in the docs. Additionally,\n> for \"git svn fetch\", an svn.authorsfile configuration parameter in\n> ~/.gitconfig is used, if no command line argument is specified. However,\n> svn.authorsfile is ignored by \"git svn clone\", though the documentation\n> claims that clone \"runs init and fetch.\"\n>\n> I have confirmed this bug is present in git versions 1.6.0.4 and 1.6.5.1.\n>   \n\nDoes moving the line:\n\ncommand_oneline('config', 'svn.authorsfile', $_authors) if $_authors;\n\nImmediately prior to the \"fetch_all\" line before it fix the problem? It\nlooks strange for it to set it afterwards...\n\nSam\n"},{"id":"127508","messageId":"20091113140217.GY19475@poetic.cynic.net","threadId":"21567","inReplyTo":"fabb9a1e0911100524p2cf3f2ebp698ecb50fc53f8e9@mail.gmail.com","subject":"Re: Bug: \"git svn clone\" does not honor svn.authorsfile setting","fromName":"Curt Sampson","fromEmail":"cjs@cynic.net","sentAt":"2009-11-13T14:02:17Z","receivedAt":"2009-11-13T14:02:17Z","isPatch":false,"sender":{"key":"cjs@cynic.net","avatar":"https://gravatar.com/avatar/290ced25da34aea160f5e968ef0f0d01d0ba2db5d1daba8a53f2e4935eccb030?d=mp&s=160"},"body":"On 2009-11-10 14:24 +0100 (Tue), Sverre Rabbelier wrote:\n\n> Please don't. It is custom on the git list to always keep those who\n> are involved in the conversation cc-ed, adding a Reply-to makes this\n> difficult.\n\nIf you're running your list without munging Reply-to, congratulations\nto you. I'll avoid it from now on on this list. However, it's the case\nthat for many, many lists out there, if I did not include myself in a\nReply-to, the list would set the Reply-to to the list, and most MUAs\nwould automatically exclude me from the reply.\n\ncjs\n-- \nCurt Sampson       <cjs@starling-software.com>        +81 90 7737 2974\n           Functional programming in all senses of the word:\n                   http://www.starling-software.com\n"},{"id":"127509","messageId":"20091113140631.GZ19475@poetic.cynic.net","threadId":"21567","inReplyTo":"4AFA3D04.3050109@vilain.net","subject":"Re: Bug: \"git svn clone\" does not honor svn.authorsfile setting","fromName":"Curt Sampson","fromEmail":"cjs@cynic.net","sentAt":"2009-11-13T14:06:31Z","receivedAt":"2009-11-13T14:06:31Z","isPatch":false,"sender":{"key":"cjs@cynic.net","avatar":"https://gravatar.com/avatar/290ced25da34aea160f5e968ef0f0d01d0ba2db5d1daba8a53f2e4935eccb030?d=mp&s=160"},"body":"On 2009-11-11 17:26 +1300 (Wed), Sam Vilain wrote:\n\n> Does moving the line:\n> \n> command_oneline('config', 'svn.authorsfile', $_authors) if $_authors;\n> \n> Immediately prior to the \"fetch_all\" line before it fix the problem? It\n> looks strange for it to set it afterwards...\n\nThat looks plausible to me, having had a quick look at the source, but\nkeep in mind I've already spent about 45 minutes debugging this problem\nand figuring out how to file a bug report. I don't really have the time\nat the moment to learn how to build and test new versions of git, unless\nsomeone wants to walk me through it. I expect it would take rather less\ntime for someone in the know just to do the test.\n\ncjs\n-- \nCurt Sampson       <cjs@starling-software.com>        +81 90 7737 2974\n           Functional programming in all senses of the word:\n                   http://www.starling-software.com\n"},{"id":"127565","messageId":"20091114223930.GA10176@dcvr.yhbt.net","threadId":"21567","inReplyTo":"20091110130913.GR19475@poetic.cynic.net","subject":"[PATCH] git svn: read global+system config for clone+init","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2009-11-14T22:39:30Z","receivedAt":"2009-11-14T22:39:30Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Curt Sampson <cjs@cynic.net> wrote:\n> When using \"git svn fetch\" or \"git svn clone\", the --authors-file\n> command line parameter does what it claims in the docs. Additionally,\n> for \"git svn fetch\", an svn.authorsfile configuration parameter in\n> ~/.gitconfig is used, if no command line argument is specified. However,\n> svn.authorsfile is ignored by \"git svn clone\", though the documentation\n> claims that clone \"runs init and fetch.\"\n> \n> I have confirmed this bug is present in git versions 1.6.0.4 and 1.6.5.1.\n\nHi Curt,\n\nThanks for the bug report, the following patch should fix\nthe bug.  Also pullable from git://git.bogomips.org/git-svn\n\n>From 1a30582b43e137e16b3486d83bb86b0eb090e13d Mon Sep 17 00:00:00 2001\nFrom: Eric Wong <normalperson@yhbt.net>\nDate: Sat, 14 Nov 2009 14:25:11 -0800\nSubject: [PATCH] git svn: read global+system config for clone+init\n\nSince $GIT_DIR does not exist when initializing new repositories,\nwe can follow back to the global and system config files for\ngit.\n\nThe logic for this was originally introduced when\n$GIT_DIR/config was the only config file git could read (back\nwhen \"git config\" was \"git repo-config\"), so the function is\nrenamed to \"read_git_config\" instead of \"read_repo_config\".\n\nSigned-off-by: Eric Wong <normalperson@yhbt.net>\n---\n git-svn.perl |    5 ++---\n 1 files changed, 2 insertions(+), 3 deletions(-)\n\ndiff --git a/git-svn.perl b/git-svn.perl\nindex 27fbe30..ea922ac 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -274,7 +274,7 @@ unless ($cmd && $cmd =~ /(?:clone|init|multi-init)$/) {\n \n my %opts = %{$cmd{$cmd}->[2]} if (defined $cmd);\n \n-read_repo_config(\\%opts);\n+read_git_config(\\%opts);\n if ($cmd && ($cmd eq 'log' || $cmd eq 'blame')) {\n \tGetopt::Long::Configure('pass_through');\n }\n@@ -1390,8 +1390,7 @@ sub load_authors {\n }\n \n # convert GetOpt::Long specs for use by git-config\n-sub read_repo_config {\n-\treturn unless -d $ENV{GIT_DIR};\n+sub read_git_config {\n \tmy $opts = shift;\n \tmy @config_only;\n \tforeach my $o (keys %$opts) {\n-- \nEric Wong\n"},{"id":"127566","messageId":"20091114225040.GA5165@dcvr.yhbt.net","threadId":"21567","inReplyTo":"20091114223930.GA10176@dcvr.yhbt.net","subject":"Re: [PATCH] git svn: read global+system config for clone+init","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2009-11-14T22:50:40Z","receivedAt":"2009-11-14T22:50:40Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Eric Wong <normalperson@yhbt.net> wrote:\n> Hi Curt,\n> \n> Thanks for the bug report, the following patch should fix\n> the bug.  Also pullable from git://git.bogomips.org/git-svn\n\nIt took me a while (possibly due to low caffeine levels) to make a\nfailing (automated) test case, but I've also pushed this out as\nwell.\n\n>From e2f8617b266e320fd58ab584cae2ebe9906daaac Mon Sep 17 00:00:00 2001\nFrom: Eric Wong <normalperson@yhbt.net>\nDate: Sat, 14 Nov 2009 14:43:20 -0800\nSubject: [PATCH] git svn: add authorsfile test case for ~/.gitconfig\n\nThe commit for:\n    git svn: read global+system config for clone+init\n\nInitially lacked a test case because the author was unable to\nreproduce it under his test environment, this adds it.\n\nSigned-off-by: Eric Wong <normalperson@yhbt.net>\n---\n t/t9130-git-svn-authors-file.sh |   23 +++++++++++++++++++++++\n 1 files changed, 23 insertions(+), 0 deletions(-)\n\ndiff --git a/t/t9130-git-svn-authors-file.sh b/t/t9130-git-svn-authors-file.sh\nindex f5abdb3..134411e 100755\n--- a/t/t9130-git-svn-authors-file.sh\n+++ b/t/t9130-git-svn-authors-file.sh\n@@ -91,4 +91,27 @@ test_expect_success 'fetch continues after authors-file is fixed' '\n \t)\n \t'\n \n+test_expect_success 'fresh clone with svn.authors-file in config' '\n+\t(\n+\t\trm -r \"$GIT_DIR\" &&\n+\t\ttest x = x\"$(git config svn.authorsfile)\" &&\n+\t\tHOME=\"`pwd`\" &&\n+\t\texport HOME &&\n+\t\ttest_config=\"$HOME\"/.gitconfig &&\n+\t\tunset GIT_CONFIG_NOGLOBAL &&\n+\t\tunset GIT_DIR &&\n+\t\tunset GIT_CONFIG &&\n+\t\tgit config --global \\\n+\t\t  svn.authorsfile \"$HOME\"/svn-authors &&\n+\t\ttest x\"$HOME\"/svn-authors = x\"$(git config svn.authorsfile)\" &&\n+\t\tgit svn clone \"$svnrepo\" gitconfig.clone &&\n+\t\tcd gitconfig.clone &&\n+\t\tnr_ex=$(git log | grep \"^Author:.*example.com\" | wc -l) &&\n+\t\tnr_rev=$(git rev-list HEAD | wc -l) &&\n+\t\ttest $nr_rev -eq $nr_ex\n+\t)\n+'\n+\n+test_debug 'GIT_DIR=gitconfig.clone/.git git log'\n+\n test_done\n-- \nEric Wong\n"}]}