# Tracking CVS

11 messages from 2006-06-22 to 2006-07-19. Participants: Jon Smirl, Petr Baudis, Junio C Hamano, Jakub Narebski.
Thread: https://gitlist.dev/t/4612

## Jon Smirl, 2006-06-22 12:41

Subject: Tracking CVS
Message-ID: <9e4733910606220541y15d66fa6t33ab0c80ae05f764@mail.gmail.com>
URL: https://gitlist.dev/e/9e4733910606220541y15d66fa6t33ab0c80ae05f764%40mail.gmail.com

```
I'm tracking cvs using this sequence.

cvs update
cg rm -a
cg commit
cg add -r .
cg commit

Is there a way to avoid the two commits? If you do the add with out
the intervening commit it just adds the files back.

-- 
Jon Smirl
jonsmirl@gmail.com

```

## Petr Baudis, 2006-06-22 13:58

Subject: Re: Tracking CVS
Message-ID: <20060622135831.GB21864@pasky.or.cz>
URL: https://gitlist.dev/e/20060622135831.GB21864%40pasky.or.cz
In-Reply-To: <9e4733910606220541y15d66fa6t33ab0c80ae05f764@mail.gmail.com>

```
Dear diary, on Thu, Jun 22, 2006 at 02:41:16PM CEST, I got a letter
where Jon Smirl <jonsmirl@gmail.com> said that...
> I'm tracking cvs using this sequence.
> 
> cvs update
> cg rm -a
> cg commit
> cg add -r .
> cg commit
> 
> Is there a way to avoid the two commits? If you do the add with out
> the intervening commit it just adds the files back.

I think the most straightforward way is:

	cvs update
	cg-rm -a
	cg-status -wns \? | xargs cg-add
	cg-commit

If you want to be careful about filenames polluted by non-newline
whitespaces,

	cg-status -wns \? | tr '\n' '\0' | xargs -0 cg-add

If you want to be safe even with filenames containing newlines, you need
to go at the Git level:

	git-ls-files -z --others | \
		xargs -0 git-update-index --add --

Perhaps we might make a special command which would sync the index set
with the working copy set...

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
A person is just about as big as the things that make them angry.

```

## Jon Smirl, 2006-06-22 14:17

Subject: Re: Tracking CVS
Message-ID: <9e4733910606220717of2ba299ta8a38c7d63fd5635@mail.gmail.com>
URL: https://gitlist.dev/e/9e4733910606220717of2ba299ta8a38c7d63fd5635%40mail.gmail.com
In-Reply-To: <20060622135831.GB21864@pasky.or.cz>

```
On 6/22/06, Petr Baudis <pasky@suse.cz> wrote:
> Dear diary, on Thu, Jun 22, 2006 at 02:41:16PM CEST, I got a letter
> where Jon Smirl <jonsmirl@gmail.com> said that...
> > I'm tracking cvs using this sequence.
> >
> > cvs update
> > cg rm -a
> > cg commit
> > cg add -r .
> > cg commit
> >
> > Is there a way to avoid the two commits? If you do the add with out
> > the intervening commit it just adds the files back.
>
> I think the most straightforward way is:
>
>         cvs update
>         cg-rm -a
>         cg-status -wns \? | xargs cg-add
>         cg-commit
>
> If you want to be careful about filenames polluted by non-newline
> whitespaces,
>
>         cg-status -wns \? | tr '\n' '\0' | xargs -0 cg-add
>
> If you want to be safe even with filenames containing newlines, you need
> to go at the Git level:
>
>         git-ls-files -z --others | \
>                 xargs -0 git-update-index --add --
>
> Perhaps we might make a special command which would sync the index set
> with the working copy set...

How about a cg-sync? Tracking cvs (or other SCM) with git is probably
a common activitiy while you try to convince the other CVS users to
switch. It is probably worth a little write up in the readme on the
best way to do it.

cg-sync should probably default to having a prompt before actually
adding/removing the files. Add a -f or something to get rid of the
prompt.

-- 
Jon Smirl
jonsmirl@gmail.com

```

## Junio C Hamano, 2006-06-22 17:05

Subject: Re: Tracking CVS
Message-ID: <7vveqtp1dl.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vveqtp1dl.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <20060622135831.GB21864@pasky.or.cz>

```
Petr Baudis <pasky@suse.cz> writes:

> If you want to be safe even with filenames containing newlines, you need
> to go at the Git level:
>
> 	git-ls-files -z --others | \
> 		xargs -0 git-update-index --add --

If you want to avoid "xargs -0", you can replace it with
"git-update-index -z --stdin" I think.

> Perhaps we might make a special command which would sync the index set
> with the working copy set...

I think that makes sense.  Something like what "git-commit -a"
does before making a commit.

```

## Jakub Narebski, 2006-06-22 17:14

Subject: Re: Tracking CVS
Message-ID: <e7ej5o$1p6$1@sea.gmane.org>
URL: https://gitlist.dev/e/e7ej5o%241p6%241%40sea.gmane.org
In-Reply-To: <7vveqtp1dl.fsf@assigned-by-dhcp.cox.net>

```
Junio C Hamano wrote:

> Petr Baudis <pasky@suse.cz> writes:
 
>> Perhaps we might make a special command which would sync the index set
>> with the working copy set...
> 
> I think that makes sense.  Something like what "git-commit -a"
> does before making a commit.

Isn't that what "git update-index --again" does? 

-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git

```

## Junio C Hamano, 2006-06-22 17:43

Subject: Re: Tracking CVS
Message-ID: <7virmtozld.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7virmtozld.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <e7ej5o$1p6$1@sea.gmane.org>

```
Jakub Narebski <jnareb@gmail.com> writes:

> Junio C Hamano wrote:
>
>> Petr Baudis <pasky@suse.cz> writes:
>  
>>> Perhaps we might make a special command which would sync the index set
>>> with the working copy set...
>> 
>> I think that makes sense.  Something like what "git-commit -a"
>> does before making a commit.
>
> Isn't that what "git update-index --again" does? 

No.

```

## Jon Smirl, 2006-06-23 02:18

Subject: Re: Tracking CVS
Message-ID: <9e4733910606221918r775f49f0l4929f4703281115f@mail.gmail.com>
URL: https://gitlist.dev/e/9e4733910606221918r775f49f0l4929f4703281115f%40mail.gmail.com
In-Reply-To: <20060622135831.GB21864@pasky.or.cz>

```
On 6/22/06, Petr Baudis <pasky@suse.cz> wrote:
> Dear diary, on Thu, Jun 22, 2006 at 02:41:16PM CEST, I got a letter
> where Jon Smirl <jonsmirl@gmail.com> said that...
> > I'm tracking cvs using this sequence.
> >
> > cvs update
> > cg rm -a
> > cg commit
> > cg add -r .
> > cg commit
> >
> > Is there a way to avoid the two commits? If you do the add with out
> > the intervening commit it just adds the files back.
>
> I think the most straightforward way is:
>
>         cvs update
>         cg-rm -a
>         cg-status -wns \? | xargs cg-add
>         cg-commit

This doesn't pick up new directories with recursion.

>
> If you want to be careful about filenames polluted by non-newline
> whitespaces,
>
>         cg-status -wns \? | tr '\n' '\0' | xargs -0 cg-add
>
> If you want to be safe even with filenames containing newlines, you need
> to go at the Git level:
>
>         git-ls-files -z --others | \
>                 xargs -0 git-update-index --add --
>
> Perhaps we might make a special command which would sync the index set
> with the working copy set...
>
> --
>                                 Petr "Pasky" Baudis
> Stuff: http://pasky.or.cz/
> A person is just about as big as the things that make them angry.
>


-- 
Jon Smirl
jonsmirl@gmail.com

```

## Jon Smirl, 2006-06-23 02:24

Subject: Re: Tracking CVS
Message-ID: <9e4733910606221924v69d71e59y8246925ad92aeba3@mail.gmail.com>
URL: https://gitlist.dev/e/9e4733910606221924v69d71e59y8246925ad92aeba3%40mail.gmail.com
In-Reply-To: <9e4733910606221918r775f49f0l4929f4703281115f@mail.gmail.com>

```
On 6/22/06, Jon Smirl <jonsmirl@gmail.com> wrote:
> > I think the most straightforward way is:
> >
> >         cvs update
> >         cg-rm -a
> >         cg-status -wns \? | xargs cg-add
> >         cg-commit
>
> This doesn't pick up new directories with recursion.

The new directories that came down were empty.

-- 
Jon Smirl
jonsmirl@gmail.com

```

## Petr Baudis, 2006-06-23 02:31

Subject: Re: Tracking CVS
Message-ID: <20060623023131.GK21864@pasky.or.cz>
URL: https://gitlist.dev/e/20060623023131.GK21864%40pasky.or.cz
In-Reply-To: <9e4733910606221918r775f49f0l4929f4703281115f@mail.gmail.com>

```
Dear diary, on Fri, Jun 23, 2006 at 04:18:32AM CEST, I got a letter
where Jon Smirl <jonsmirl@gmail.com> said that...
> On 6/22/06, Petr Baudis <pasky@suse.cz> wrote:
> >        cvs update
> >        cg-rm -a
> >        cg-status -wns \? | xargs cg-add
> >        cg-commit
> 
> This doesn't pick up new directories with recursion.

Ah. Either pass -S to cg-status or -r to cg-add.

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
A person is just about as big as the things that make them angry.

```

## Jon Smirl, 2006-06-23 18:14

Subject: Re: Tracking CVS
Message-ID: <9e4733910606231114g5d16b05k21069c628f9ea9ca@mail.gmail.com>
URL: https://gitlist.dev/e/9e4733910606231114g5d16b05k21069c628f9ea9ca%40mail.gmail.com
In-Reply-To: <20060623023131.GK21864@pasky.or.cz>

```
My cg-sync script looks like this now:

#!/usr/bin/env bash
cg-rm -a
cg-status -wnSs \? | xargs cg-add

But when are no files to add or remove I get this:

[jonsmirl@jonsmirl mozilla]$ cg sync
cg-rm: no files to remove
cg-add: usage: cg-add [-N] [-r] FILE...

This is definitely a useful script for tracking CVS. I'd like to see
it added to cogito once it is fully debugged.

-- 
Jon Smirl
jonsmirl@gmail.com

```

## Petr Baudis, 2006-07-19 12:38

Subject: Re: Tracking CVS
Message-ID: <20060719123808.GH13776@pasky.or.cz>
URL: https://gitlist.dev/e/20060719123808.GH13776%40pasky.or.cz
In-Reply-To: <9e4733910606220717of2ba299ta8a38c7d63fd5635@mail.gmail.com>

```
Dear diary, on Thu, Jun 22, 2006 at 04:17:15PM CEST, I got a letter
where Jon Smirl <jonsmirl@gmail.com> said that...
> On 6/22/06, Petr Baudis <pasky@suse.cz> wrote:
> >Dear diary, on Thu, Jun 22, 2006 at 02:41:16PM CEST, I got a letter
> >where Jon Smirl <jonsmirl@gmail.com> said that...
> >> I'm tracking cvs using this sequence.
> >>
> >> cvs update
> >> cg rm -a
> >> cg commit
> >> cg add -r .
> >> cg commit
> >>
> >> Is there a way to avoid the two commits? If you do the add with out
> >> the intervening commit it just adds the files back.
> 
> How about a cg-sync? Tracking cvs (or other SCM) with git is probably
> a common activitiy while you try to convince the other CVS users to
> switch. It is probably worth a little write up in the readme on the
> best way to do it.

I have added and pushed out support for cg-add -a, now it should be
merely a matter of

	cg-rm -a && cg-add -a

and I have documented that.

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
Snow falling on Perl. White noise covering line noise.
Hides all the bugs too. -- J. Putnam

```
