git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC/PATCH] cvsexportcommit: per branch cvsdir config option
@ 2010-04-21  0:42 Bert Wesarg
  2010-04-21  6:32 ` Robin Rosenberg
  0 siblings, 1 reply; 3+ messages in thread
From: Bert Wesarg @ 2010-04-21  0:42 UTC (permalink / raw)
  To: Trent Piepho, Trent Piepho; +Cc: Robin Rosenberg, git, Bert Wesarg

This lets the user of git cvsexportcommit specify a cvs working dir on a per
branch basis.

Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>

---

The config variable name is currently cvsexportcommit.<branch>.cvsdir, but
could also be branch.<branch>.cvsdir. Or whatever is prefereable.


 Documentation/git-cvsexportcommit.txt |    7 ++++++-
 git-cvsexportcommit.perl              |    5 +++++
 2 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/Documentation/git-cvsexportcommit.txt b/Documentation/git-cvsexportcommit.txt
index b2696ef..0bc71cf 100644
--- a/Documentation/git-cvsexportcommit.txt
+++ b/Documentation/git-cvsexportcommit.txt
@@ -71,7 +71,8 @@ OPTIONS
 	Specify the location of the CVS checkout to use for the export. This
 	option does not require GIT_DIR to be set before execution if the
 	current directory is within a git repository.  The default is the
-	value of 'cvsexportcommit.cvsdir'.
+	value of `cvsexportcommit.<branch>.cvsdir` or, if this is not set,
+	the value of `cvsexportcommit.cvsdir`.
 
 -W::
 	Tell cvsexportcommit that the current working directory is not only
@@ -83,6 +84,10 @@ OPTIONS
 
 CONFIGURATION
 -------------
+cvsexportcommit.<branch>.cvsdir::
+	The default location for branch `<name>` of the CVS checkout to use
+	for the export.
+
 cvsexportcommit.cvsdir::
 	The default location of the CVS checkout to use for the export.
 
diff --git a/git-cvsexportcommit.perl b/git-cvsexportcommit.perl
index 59b6722..3e0c284 100755
--- a/git-cvsexportcommit.perl
+++ b/git-cvsexportcommit.perl
@@ -18,6 +18,11 @@ die "Need at least one commit identifier!" unless @ARGV;
 
 # Get git-config settings
 my $repo = Git->repository();
+my $branch_name = $repo->command_oneline('rev-parse', '--abbrev-ref=loose', 'HEAD') unless defined $opt_w;
+if ($branch_name) {
+    my $per_branch_cvsdir = "cvsexportcommit.".$branch_name.".cvsdir";
+    $opt_w = $repo->config($per_branch_cvsdir);
+}
 $opt_w = $repo->config('cvsexportcommit.cvsdir') unless defined $opt_w;
 
 if ($opt_w || $opt_W) {
-- 
tg: (ddd02b7..) bw/per-branch-cvsdir (depends on: master)

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

* Re: [RFC/PATCH] cvsexportcommit: per branch cvsdir config option
  2010-04-21  0:42 [RFC/PATCH] cvsexportcommit: per branch cvsdir config option Bert Wesarg
@ 2010-04-21  6:32 ` Robin Rosenberg
  2010-04-22 19:49   ` Bert Wesarg
  0 siblings, 1 reply; 3+ messages in thread
From: Robin Rosenberg @ 2010-04-21  6:32 UTC (permalink / raw)
  To: Bert Wesarg; +Cc: Trent Piepho, git

onsdagen den 21 april 2010 02.42.41 skrev  Bert Wesarg:
> This lets the user of git cvsexportcommit specify a cvs working dir on a
>  per branch basis.
> 
> Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
> 
> ---
> 
> The config variable name is currently cvsexportcommit.<branch>.cvsdir, but
> could also be branch.<branch>.cvsdir. Or whatever is prefereable.

Your suggested names are fine and the idea is sound. 

-- robin

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

* Re: [RFC/PATCH] cvsexportcommit: per branch cvsdir config option
  2010-04-21  6:32 ` Robin Rosenberg
@ 2010-04-22 19:49   ` Bert Wesarg
  0 siblings, 0 replies; 3+ messages in thread
From: Bert Wesarg @ 2010-04-22 19:49 UTC (permalink / raw)
  To: Robin Rosenberg; +Cc: Trent Piepho, git

On Wed, Apr 21, 2010 at 08:32, Robin Rosenberg
<robin.rosenberg@dewire.com> wrote:
> onsdagen den 21 april 2010 02.42.41 skrev  Bert Wesarg:
>> This lets the user of git cvsexportcommit specify a cvs working dir on a
>>  per branch basis.
>>
>> Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
>>
>> ---
>>
>> The config variable name is currently cvsexportcommit.<branch>.cvsdir, but
>> could also be branch.<branch>.cvsdir. Or whatever is prefereable.
>
> Your suggested names are fine and the idea is sound.

Thanks. Can I take this as an Acked-by from you? Than I will send the
patch to Junio with an request for inclusion.

Bert

>
> -- robin
>

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

end of thread, other threads:[~2010-04-22 20:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-21  0:42 [RFC/PATCH] cvsexportcommit: per branch cvsdir config option Bert Wesarg
2010-04-21  6:32 ` Robin Rosenberg
2010-04-22 19:49   ` Bert Wesarg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).