threads / discuss / 4612

Tracking CVS

Subject: Tracking CVS

## tl;dr

11 messages between Jun 22, 2006 and Jul 19, 2006.

replies: 10people: 4as markdown or json

Jon Smirl· Jun 22, 2006, 12:41 UTC · lore
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· Jun 22, 2006, 13:58 UTC · re: Jon Smirl · lore

Re: Tracking CVS

Dear diary, on Thu, Jun 22, 2006 at 02:41:16PM CEST, I got a letter where Jon Smirl <jonsmirl@gmail.com> said that...

Show 10 quoted lines
> 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· Jun 22, 2006, 14:17 UTC · re: Petr Baudis · lore

Re: Tracking CVS

On 6/22/06, Petr Baudis <pasky@suse.cz> wrote:
Show 33 quoted lines
> 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
Petr Baudis· Jul 19, 2006, 12:38 UTC · re: Jon Smirl · lore

Re: Tracking CVS

Dear diary, on Thu, Jun 22, 2006 at 04:17:15PM CEST, I got a letter where Jon Smirl <jonsmirl@gmail.com> said that...

Show 18 quoted lines
> 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
Junio C Hamano· Jun 22, 2006, 17:05 UTC · re: Petr Baudis · lore

Re: Tracking CVS

Petr Baudis <pasky@suse.cz> writes:
Show 5 quoted lines
> 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· Jun 22, 2006, 17:14 UTC · re: Junio C Hamano · lore

Re: Tracking CVS

Junio C Hamano wrote:
> Petr Baudis <pasky@suse.cz> writes:
Show 5 quoted lines
>> 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· Jun 22, 2006, 17:43 UTC · re: Jakub Narebski · lore

Re: Tracking CVS

Jakub Narebski <jnareb@gmail.com> writes:
Show 11 quoted lines
> 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· Jun 23, 2006, 02:18 UTC · re: Petr Baudis · lore

Re: Tracking CVS

On 6/22/06, Petr Baudis <pasky@suse.cz> wrote:
Show 19 quoted lines
> 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.
Show 20 quoted lines
>
> 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· Jun 23, 2006, 02:24 UTC · re: Jon Smirl · lore

Re: Tracking CVS

On 6/22/06, Jon Smirl <jonsmirl@gmail.com> wrote:
Show 8 quoted lines
> > 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· Jun 23, 2006, 02:31 UTC · re: Jon Smirl · lore

Re: Tracking CVS

Dear diary, on Fri, Jun 23, 2006 at 04:18:32AM CEST, I got a letter where Jon Smirl <jonsmirl@gmail.com> said that...

Show 7 quoted lines
> 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· Jun 23, 2006, 18:14 UTC · re: Petr Baudis · lore

Re: Tracking CVS

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

← back to recent threads