* [PATCH] cvsexportcommit: Create config option for CVS dir
@ 2008-05-08 21:26 Trent Piepho
2008-05-21 19:51 ` Junio C Hamano
0 siblings, 1 reply; 3+ messages in thread
From: Trent Piepho @ 2008-05-08 21:26 UTC (permalink / raw)
To: git; +Cc: Trent Piepho, gitster
For a given project the directory used with the -w option is almost always
the same each time. Let it be specified with 'cvsexportcommit.cvsdir' so
it's not necessary to manually add it with -w each time.
Signed-off-by: Trent Piepho <tpiepho@freescale.com>
---
Documentation/git-cvsexportcommit.txt | 8 +++++++-
git-cvsexportcommit.perl | 5 +++++
2 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/Documentation/git-cvsexportcommit.txt b/Documentation/git-cvsexportcommit.txt
index 9a47b4c..363c36d 100644
--- a/Documentation/git-cvsexportcommit.txt
+++ b/Documentation/git-cvsexportcommit.txt
@@ -65,11 +65,17 @@ OPTIONS
-w::
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.
+ current directory is within a git repository. The default is the
+ value of 'cvsexportcommit.cvsdir'.
-v::
Verbose.
+CONFIGURATION
+-------------
+cvsexportcommit.cvsdir::
+ The default location of the CVS checkout to use for the export.
+
EXAMPLES
--------
diff --git a/git-cvsexportcommit.perl b/git-cvsexportcommit.perl
index b6036bd..c93bd9c 100755
--- a/git-cvsexportcommit.perl
+++ b/git-cvsexportcommit.perl
@@ -6,6 +6,7 @@ use File::Temp qw(tempdir);
use Data::Dumper;
use File::Basename qw(basename dirname);
use File::Spec;
+use Git;
our ($opt_h, $opt_P, $opt_p, $opt_v, $opt_c, $opt_f, $opt_a, $opt_m, $opt_d, $opt_u, $opt_w);
@@ -15,6 +16,10 @@ $opt_h && usage();
die "Need at least one commit identifier!" unless @ARGV;
+# Get git-config settings
+my $repo = Git->repository();
+$opt_w = $repo->config('cvsexportcommit.cvsdir') unless defined $opt_w;
+
if ($opt_w) {
# Remember where GIT_DIR is before changing to CVS checkout
unless ($ENV{GIT_DIR}) {
--
1.5.4.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] cvsexportcommit: Create config option for CVS dir
2008-05-08 21:26 [PATCH] cvsexportcommit: Create config option for CVS dir Trent Piepho
@ 2008-05-21 19:51 ` Junio C Hamano
2008-05-21 20:01 ` Robin Rosenberg
0 siblings, 1 reply; 3+ messages in thread
From: Junio C Hamano @ 2008-05-21 19:51 UTC (permalink / raw)
To: git; +Cc: Trent Piepho, Robin Rosenberg
Last night I was going through old mail-logs and found this, which I think
would be nice. Does anybody see anything wrong with the patch?
Trent Piepho <tpiepho@freescale.com> writes:
> For a given project the directory used with the -w option is almost always
> the same each time. Let it be specified with 'cvsexportcommit.cvsdir' so
> it's not necessary to manually add it with -w each time.
>
> Signed-off-by: Trent Piepho <tpiepho@freescale.com>
> ---
> Documentation/git-cvsexportcommit.txt | 8 +++++++-
> git-cvsexportcommit.perl | 5 +++++
> 2 files changed, 12 insertions(+), 1 deletions(-)
>
> diff --git a/Documentation/git-cvsexportcommit.txt b/Documentation/git-cvsexportcommit.txt
> index 9a47b4c..363c36d 100644
> --- a/Documentation/git-cvsexportcommit.txt
> +++ b/Documentation/git-cvsexportcommit.txt
> @@ -65,11 +65,17 @@ OPTIONS
> -w::
> 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.
> + current directory is within a git repository. The default is the
> + value of 'cvsexportcommit.cvsdir'.
>
> -v::
> Verbose.
>
> +CONFIGURATION
> +-------------
> +cvsexportcommit.cvsdir::
> + The default location of the CVS checkout to use for the export.
> +
> EXAMPLES
> --------
>
> diff --git a/git-cvsexportcommit.perl b/git-cvsexportcommit.perl
> index b6036bd..c93bd9c 100755
> --- a/git-cvsexportcommit.perl
> +++ b/git-cvsexportcommit.perl
> @@ -6,6 +6,7 @@ use File::Temp qw(tempdir);
> use Data::Dumper;
> use File::Basename qw(basename dirname);
> use File::Spec;
> +use Git;
>
> our ($opt_h, $opt_P, $opt_p, $opt_v, $opt_c, $opt_f, $opt_a, $opt_m, $opt_d, $opt_u, $opt_w);
>
> @@ -15,6 +16,10 @@ $opt_h && usage();
>
> die "Need at least one commit identifier!" unless @ARGV;
>
> +# Get git-config settings
> +my $repo = Git->repository();
> +$opt_w = $repo->config('cvsexportcommit.cvsdir') unless defined $opt_w;
> +
> if ($opt_w) {
> # Remember where GIT_DIR is before changing to CVS checkout
> unless ($ENV{GIT_DIR}) {
> --
> 1.5.4.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] cvsexportcommit: Create config option for CVS dir
2008-05-21 19:51 ` Junio C Hamano
@ 2008-05-21 20:01 ` Robin Rosenberg
0 siblings, 0 replies; 3+ messages in thread
From: Robin Rosenberg @ 2008-05-21 20:01 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, Trent Piepho
onsdagen den 21 maj 2008 21.51.38 skrev Junio C Hamano:
> Last night I was going through old mail-logs and found this, which I think
> would be nice. Does anybody see anything wrong with the patch?
No, this looks reallu useful. Ack.
-- robin
>
> Trent Piepho <tpiepho@freescale.com> writes:
>
> > For a given project the directory used with the -w option is almost always
> > the same each time. Let it be specified with 'cvsexportcommit.cvsdir' so
> > it's not necessary to manually add it with -w each time.
> >
> > Signed-off-by: Trent Piepho <tpiepho@freescale.com>
> > ---
> > Documentation/git-cvsexportcommit.txt | 8 +++++++-
> > git-cvsexportcommit.perl | 5 +++++
> > 2 files changed, 12 insertions(+), 1 deletions(-)
> >
> > diff --git a/Documentation/git-cvsexportcommit.txt b/Documentation/git-cvsexportcommit.txt
> > index 9a47b4c..363c36d 100644
> > --- a/Documentation/git-cvsexportcommit.txt
> > +++ b/Documentation/git-cvsexportcommit.txt
> > @@ -65,11 +65,17 @@ OPTIONS
> > -w::
> > 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.
> > + current directory is within a git repository. The default is the
> > + value of 'cvsexportcommit.cvsdir'.
> >
> > -v::
> > Verbose.
> >
> > +CONFIGURATION
> > +-------------
> > +cvsexportcommit.cvsdir::
> > + The default location of the CVS checkout to use for the export.
> > +
> > EXAMPLES
> > --------
> >
> > diff --git a/git-cvsexportcommit.perl b/git-cvsexportcommit.perl
> > index b6036bd..c93bd9c 100755
> > --- a/git-cvsexportcommit.perl
> > +++ b/git-cvsexportcommit.perl
> > @@ -6,6 +6,7 @@ use File::Temp qw(tempdir);
> > use Data::Dumper;
> > use File::Basename qw(basename dirname);
> > use File::Spec;
> > +use Git;
> >
> > our ($opt_h, $opt_P, $opt_p, $opt_v, $opt_c, $opt_f, $opt_a, $opt_m, $opt_d, $opt_u, $opt_w);
> >
> > @@ -15,6 +16,10 @@ $opt_h && usage();
> >
> > die "Need at least one commit identifier!" unless @ARGV;
> >
> > +# Get git-config settings
> > +my $repo = Git->repository();
> > +$opt_w = $repo->config('cvsexportcommit.cvsdir') unless defined $opt_w;
> > +
> > if ($opt_w) {
> > # Remember where GIT_DIR is before changing to CVS checkout
> > unless ($ENV{GIT_DIR}) {
> > --
> > 1.5.4.1
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-05-21 20:04 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-08 21:26 [PATCH] cvsexportcommit: Create config option for CVS dir Trent Piepho
2008-05-21 19:51 ` Junio C Hamano
2008-05-21 20:01 ` Robin Rosenberg
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).