{"thread":{"id":"23544","subject":"Re: [RFC/PATCH] cvsexportcommit: per branch cvsdir config option","startedAt":"2010-04-21T00:42:41Z","lastAt":"2010-04-22T19:49:37Z","messageCount":3,"participants":["Robin Rosenberg","Bert Wesarg"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"299177","messageId":"1271810562-4196-1-git-send-email-bert.wesarg@googlemail.com","threadId":"23544","inReplyTo":null,"subject":"[RFC/PATCH] cvsexportcommit: per branch cvsdir config option","fromName":"Bert Wesarg","fromEmail":"bert.wesarg@googlemail.com","sentAt":"2010-04-21T00:42:41Z","receivedAt":"2010-04-21T00:42:41Z","isPatch":true,"sender":{"key":"bert.wesarg@googlemail.com","avatar":"https://avatars.githubusercontent.com/u/111934?v=4"},"body":"This lets the user of git cvsexportcommit specify a cvs working dir on a per\nbranch basis.\n\nSigned-off-by: Bert Wesarg <bert.wesarg@googlemail.com>\n\n---\n\nThe config variable name is currently cvsexportcommit.<branch>.cvsdir, but\ncould also be branch.<branch>.cvsdir. Or whatever is prefereable.\n\n\n Documentation/git-cvsexportcommit.txt |    7 ++++++-\n git-cvsexportcommit.perl              |    5 +++++\n 2 files changed, 11 insertions(+), 1 deletions(-)\n\ndiff --git a/Documentation/git-cvsexportcommit.txt b/Documentation/git-cvsexportcommit.txt\nindex b2696ef..0bc71cf 100644\n--- a/Documentation/git-cvsexportcommit.txt\n+++ b/Documentation/git-cvsexportcommit.txt\n@@ -71,7 +71,8 @@ OPTIONS\n \tSpecify the location of the CVS checkout to use for the export. This\n \toption does not require GIT_DIR to be set before execution if the\n \tcurrent directory is within a git repository.  The default is the\n-\tvalue of 'cvsexportcommit.cvsdir'.\n+\tvalue of `cvsexportcommit.<branch>.cvsdir` or, if this is not set,\n+\tthe value of `cvsexportcommit.cvsdir`.\n \n -W::\n \tTell cvsexportcommit that the current working directory is not only\n@@ -83,6 +84,10 @@ OPTIONS\n \n CONFIGURATION\n -------------\n+cvsexportcommit.<branch>.cvsdir::\n+\tThe default location for branch `<name>` of the CVS checkout to use\n+\tfor the export.\n+\n cvsexportcommit.cvsdir::\n \tThe default location of the CVS checkout to use for the export.\n \ndiff --git a/git-cvsexportcommit.perl b/git-cvsexportcommit.perl\nindex 59b6722..3e0c284 100755\n--- a/git-cvsexportcommit.perl\n+++ b/git-cvsexportcommit.perl\n@@ -18,6 +18,11 @@ die \"Need at least one commit identifier!\" unless @ARGV;\n \n # Get git-config settings\n my $repo = Git->repository();\n+my $branch_name = $repo->command_oneline('rev-parse', '--abbrev-ref=loose', 'HEAD') unless defined $opt_w;\n+if ($branch_name) {\n+    my $per_branch_cvsdir = \"cvsexportcommit.\".$branch_name.\".cvsdir\";\n+    $opt_w = $repo->config($per_branch_cvsdir);\n+}\n $opt_w = $repo->config('cvsexportcommit.cvsdir') unless defined $opt_w;\n \n if ($opt_w || $opt_W) {\n-- \ntg: (ddd02b7..) bw/per-branch-cvsdir (depends on: master)\n"},{"id":"140008","messageId":"201004210832.25810.robin.rosenberg@dewire.com","threadId":"23544","inReplyTo":"1271810562-4196-1-git-send-email-bert.wesarg@googlemail.com","subject":"Re: [RFC/PATCH] cvsexportcommit: per branch cvsdir config option","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg@dewire.com","sentAt":"2010-04-21T06:32:25Z","receivedAt":"2010-04-21T06:32:25Z","isPatch":true,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"onsdagen den 21 april 2010 02.42.41 skrev  Bert Wesarg:\n> This lets the user of git cvsexportcommit specify a cvs working dir on a\n>  per branch basis.\n> \n> Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>\n> \n> ---\n> \n> The config variable name is currently cvsexportcommit.<branch>.cvsdir, but\n> could also be branch.<branch>.cvsdir. Or whatever is prefereable.\n\nYour suggested names are fine and the idea is sound. \n\n-- robin\n"},{"id":"140151","messageId":"m2k36ca99e91004221249l3cfd5772wc1d381ca984b4179@mail.gmail.com","threadId":"23544","inReplyTo":"201004210832.25810.robin.rosenberg@dewire.com","subject":"Re: [RFC/PATCH] cvsexportcommit: per branch cvsdir config option","fromName":"Bert Wesarg","fromEmail":"bert.wesarg@googlemail.com","sentAt":"2010-04-22T19:49:37Z","receivedAt":"2010-04-22T19:49:37Z","isPatch":true,"sender":{"key":"bert.wesarg@googlemail.com","avatar":"https://avatars.githubusercontent.com/u/111934?v=4"},"body":"On Wed, Apr 21, 2010 at 08:32, Robin Rosenberg\n<robin.rosenberg@dewire.com> wrote:\n> onsdagen den 21 april 2010 02.42.41 skrev  Bert Wesarg:\n>> This lets the user of git cvsexportcommit specify a cvs working dir on a\n>>  per branch basis.\n>>\n>> Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>\n>>\n>> ---\n>>\n>> The config variable name is currently cvsexportcommit.<branch>.cvsdir, but\n>> could also be branch.<branch>.cvsdir. Or whatever is prefereable.\n>\n> Your suggested names are fine and the idea is sound.\n\nThanks. Can I take this as an Acked-by from you? Than I will send the\npatch to Junio with an request for inclusion.\n\nBert\n\n>\n> -- robin\n>\n"}]}