{"thread":{"id":"11003","subject":"[PATCH] git-svn now reads settings even if called in subdirectory","startedAt":"2007-11-24T13:47:56Z","lastAt":"2007-11-29T07:41:32Z","messageCount":2,"participants":["Gustaf Hendeby","Eric Wong"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"60815","messageId":"1195912076-3903-1-git-send-email-hendeby@isy.liu.se","threadId":"11003","inReplyTo":null,"subject":"[PATCH] git-svn now reads settings even if called in subdirectory","fromName":"Gustaf Hendeby","fromEmail":"hendeby@isy.liu.se","sentAt":"2007-11-24T13:47:56Z","receivedAt":"2007-11-24T13:47:56Z","isPatch":true,"sender":{"key":"hendeby@isy.liu.se","avatar":"https://avatars.githubusercontent.com/u/730316?v=4"},"body":"Previously, git-svn first read the .git/config file for settings as if\ncurrent working directory was the repository top-directory, and after\nthat made sure to cd into top-directory.  The result was a silent\nfailur to read configuration settings.  This patch changes the order\nthese two things are done.\n\nSigned-off-by: Gustaf Hendeby <hendeby@isy.liu.se>\n\n---\n\nThis fix seems a bit too obvious, which makes me think I missed\nsomething conceptual here.  However, the patch passes \"make test\" and\n\"make full-svn-test\", and the problems I had with the svn.authorsfile\nsetting not being honored while fetching from a subdirectory are gone.\n\n git-svn.perl |   35 ++++++++++++++++++-----------------\n 1 files changed, 18 insertions(+), 17 deletions(-)\n\ndiff --git a/git-svn.perl b/git-svn.perl\nindex 43e1591..640a45a 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -193,23 +193,6 @@ for (my $i = 0; $i < @ARGV; $i++) {\n \t}\n };\n \n-my %opts = %{$cmd{$cmd}->[2]} if (defined $cmd);\n-\n-read_repo_config(\\%opts);\n-Getopt::Long::Configure('pass_through') if ($cmd && $cmd eq 'log');\n-my $rv = GetOptions(%opts, 'help|H|h' => \\$_help, 'version|V' => \\$_version,\n-                    'minimize-connections' => \\$Git::SVN::Migration::_minimize,\n-                    'id|i=s' => \\$Git::SVN::default_ref_id,\n-                    'svn-remote|remote|R=s' => sub {\n-                       $Git::SVN::no_reuse_existing = 1;\n-                       $Git::SVN::default_repo_id = $_[1] });\n-exit 1 if (!$rv && $cmd && $cmd ne 'log');\n-\n-usage(0) if $_help;\n-version() if $_version;\n-usage(1) unless defined $cmd;\n-load_authors() if $_authors;\n-\n # make sure we're always running\n unless ($cmd =~ /(?:clone|init|multi-init)$/) {\n \tunless (-d $ENV{GIT_DIR}) {\n@@ -231,6 +214,24 @@ unless ($cmd =~ /(?:clone|init|multi-init)$/) {\n \t\t$ENV{GIT_DIR} = $git_dir;\n \t}\n }\n+\n+my %opts = %{$cmd{$cmd}->[2]} if (defined $cmd);\n+\n+read_repo_config(\\%opts);\n+Getopt::Long::Configure('pass_through') if ($cmd && $cmd eq 'log');\n+my $rv = GetOptions(%opts, 'help|H|h' => \\$_help, 'version|V' => \\$_version,\n+                    'minimize-connections' => \\$Git::SVN::Migration::_minimize,\n+                    'id|i=s' => \\$Git::SVN::default_ref_id,\n+                    'svn-remote|remote|R=s' => sub {\n+                       $Git::SVN::no_reuse_existing = 1;\n+                       $Git::SVN::default_repo_id = $_[1] });\n+exit 1 if (!$rv && $cmd && $cmd ne 'log');\n+\n+usage(0) if $_help;\n+version() if $_version;\n+usage(1) unless defined $cmd;\n+load_authors() if $_authors;\n+\n unless ($cmd =~ /^(?:clone|init|multi-init|commit-diff)$/) {\n \tGit::SVN::Migration::migration_check();\n }\n-- \n1.5.3.6.1992.g3d0f\n"},{"id":"61373","messageId":"20071129074132.GA32277@soma","threadId":"11003","inReplyTo":"1195912076-3903-1-git-send-email-hendeby@isy.liu.se","subject":"Re: [PATCH] git-svn now reads settings even if called in subdirectory","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2007-11-29T07:41:32Z","receivedAt":"2007-11-29T07:41:32Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Gustaf Hendeby <hendeby@isy.liu.se> wrote:\n> Previously, git-svn first read the .git/config file for settings as if\n> current working directory was the repository top-directory, and after\n> that made sure to cd into top-directory.  The result was a silent\n> failur to read configuration settings.  This patch changes the order\n> these two things are done.\n> \n> Signed-off-by: Gustaf Hendeby <hendeby@isy.liu.se>\n> \n> ---\n> \n> This fix seems a bit too obvious, which makes me think I missed\n> something conceptual here.  However, the patch passes \"make test\" and\n> \"make full-svn-test\", and the problems I had with the svn.authorsfile\n> setting not being honored while fetching from a subdirectory are gone.\n\nThanks Gustaf,\n\nSeems right to me (note: I never use the authors file feature myself).\n\nAcked-by: Eric Wong <normalperson@yhbt.net>\n\n-- \nEric Wong\n"}]}