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
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
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...
> 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.
Re: Tracking CVS
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
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...
> 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
Re: Tracking CVS
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.
Re: Tracking CVS
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
Re: Tracking CVS
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.
Re: Tracking CVS
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
Re: Tracking CVS
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
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...
> 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.
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