threads / discuss / 23176

Help with rebase after cvsimport

Subject: Help with rebase after cvsimport

## tl;dr

3 messages between Mar 25, 2010 and Mar 27, 2010.

replies: 2people: 2as markdown or json

Brice Ruth· Mar 25, 2010, 17:37 UTC · lore
Posted this to #git but it seemed like everyone was asleep (or clueless)

[11:22] <Brice> Good morning - I have a quick question on using git rebase with git cvsimport - I'm trying to eliminate the duplicate 'cvs import' commit created when the cvs import is merged in - I'm just not sure what 'rebase' I need to do after a git cvsimport. Help? [11:22] <Brice> I'm on master when I do cvsimport [11:23] <Brice> cvsimport is run with -r cvs [11:23] <Brice> so, am I in the right ballpark thinking I need to git rebase cvs?

Any help would be appreciated!
Thanks,

Brice Ruth, FCD Software Engineer, Madison WI

Michael J Gruber· Mar 26, 2010, 09:17 UTC · re: Brice Ruth · lore

Re: Help with rebase after cvsimport

Brice Ruth venit, vidit, dixit 25.03.2010 18:37:
Show 10 quoted lines
> Posted this to #git but it seemed like everyone was asleep (or clueless)
> 
> [11:22] <Brice> Good morning - I have a quick question on using git
> rebase with git cvsimport - I'm trying to eliminate the duplicate 'cvs
> import' commit created when the cvs import is merged in - I'm just not
> sure what 'rebase' I need to do after a git cvsimport. Help?
> [11:22] <Brice> I'm on master when I do cvsimport
> [11:23] <Brice> cvsimport is run with -r cvs
> [11:23] <Brice> so, am I in the right ballpark thinking I need to git
> rebase cvs?
You have basically 2 options, see, e.g., the last paragraphs of
http://grubix.blogspot.com/2009/11/git-over-cvs.html
It seems you want to go with 1. In that case you need to
git rebase cvs/master master

(you can leave out the second argument if you are on master). Note that by doing that you basically discard your version of commits which made the git-cvs-git roundtrip (committed in git, cvsexported to cvs, cvsimported to git). That's why I use approach 2 mentioned there, but it depends certainly on your usage scenario, whether cvs is the central/authoritative repo on which you work with git, or the other way round.

Cheers, Michael

Michael J Gruber· Mar 27, 2010, 17:22 UTC · lore

Re: Help with rebase after cvsimport

Brice Ruth venit, vidit, dixit 26.03.2010 17:10:
> So, when you write "Note that by doing that you basically discard your
> version of commits which made the git-cvs-git roundtrip" - I will lose
> the individual commits I made locally and I'll just see the *one*
> exportcommit that I made for my local changes, is that right?

The way I use git-cvs, I have one cvs commit per git commit. Are you using it differently?

The rebase will discard those commits whose patch text is already "present" on the branch. I assume that for a cumulative patch this means it's not ignored - in that case the rebase won't buy you anything.

Michael

← back to recent threads