# Re: git-cvsimport feature request

3 messages from 2006-12-12 to 2006-12-15. Participants: Johannes Schindelin, Nguyen Thai Ngoc Duy.
Thread: https://gitlist.dev/t/43252

## Nguyen Thai Ngoc Duy, 2006-12-12 12:42

Subject: git-cvsimport feature request
Message-ID: <fcaeb9bf0612120442v4cd03a5fq44625fafed4217b7@mail.gmail.com>
URL: https://gitlist.dev/e/fcaeb9bf0612120442v4cd03a5fq44625fafed4217b7%40mail.gmail.com

```
Well it's not really a feature but just for convenience. I suggest
after git-cvsimport successfully imports from CVS, it creates cvsup
alias with given arguments. Later if I want to update from CVS, I only
need to "git cvsup" instead of typing the the same command with full
of arguments again.
-- 

```

## Johannes Schindelin, 2006-12-12 22:05

Subject: Re: git-cvsimport feature request
Message-ID: <Pine.LNX.4.63.0612122305060.2807@wbgn013.biozentrum.uni-wuerzburg.de>
URL: https://gitlist.dev/e/Pine.LNX.4.63.0612122305060.2807%40wbgn013.biozentrum.uni-wuerzburg.de
In-Reply-To: <fcaeb9bf0612121334t454ec67av2c319382d1f61cce@mail.gmail.com>

```
Hi,

[readding list...]

On Wed, 13 Dec 2006, Nguyen Thai Ngoc Duy wrote:

> Hi,
> 
> On 12/12/06, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> > It could be done easily, but it is almost as easy to edit the command line
> > to substitute "git " with "git repo-config alias.cvsup '" (note the
> > single apostrophe at the end) and append and apostrophe at the end of the
> > line.
> 
> Thanks. I know that (and am doing that). Just think that it may be
> more convenient typing the command once.

Something like this?

-- snip --
[PATCH] cvsimport: save the last successful command line as alias "cvsup"

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>

---

 git-cvsimport.perl |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/git-cvsimport.perl b/git-cvsimport.perl
index c5bf2d1..48fd55b 100755
--- a/git-cvsimport.perl
+++ b/git-cvsimport.perl
@@ -85,6 +85,12 @@ sub write_author_info($) {
 	close ($f);
 }
 
+my $alias = "cvsimport";
+foreach my $arg (@ARGV) {
+	$arg =~ s/[ \"]/\\&/g;
+	$alias .= ' ' . $arg;
+}
+
 getopts("hivmkuo:d:p:C:z:s:M:P:A:S:L:") or usage();
 usage if $opt_h;
 
@@ -946,6 +952,9 @@ if (defined $orig_git_index) {
 if ($orig_branch) {
 	print "DONE.\n" if $opt_v;
 	if ($opt_i) {
+		# uncomment this line, if the alias "cvsup" should be
+		# created/updated even with -i
+		#system("git-repo-config", "alias.cvsup", $alias);
 		exit 0;
 	}
 	my $tip_at_end = `git-rev-parse --verify HEAD`;
@@ -971,3 +980,7 @@ if ($orig_branch) {
 		die "checkout failed: $?\n" if $?;
 	}
 }
+
+# so far, so good. store it as alias cvsup
+system("git-repo-config", "alias.cvsup", $alias);

```

## Nguyen Thai Ngoc Duy, 2006-12-15 15:06

Subject: Re: git-cvsimport feature request
Message-ID: <fcaeb9bf0612150706g41a07a9fg3c268ef1893ccd27@mail.gmail.com>
URL: https://gitlist.dev/e/fcaeb9bf0612150706g41a07a9fg3c268ef1893ccd27%40mail.gmail.com
In-Reply-To: <Pine.LNX.4.63.0612122305060.2807@wbgn013.biozentrum.uni-wuerzburg.de>

```
Hi,

On 12/13/06, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> > On 12/12/06, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> > > It could be done easily, but it is almost as easy to edit the command line
> > > to substitute "git " with "git repo-config alias.cvsup '" (note the
> > > single apostrophe at the end) and append and apostrophe at the end of the
> > > line.
> >
> > Thanks. I know that (and am doing that). Just think that it may be
> > more convenient typing the command once.
>
> Something like this?

It works great. Thanks.
-- 

```
