git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Switching heads and head vs branch after CVS import

From
Linus Torvalds <torvalds@osdl.org>
Date
Aug 15, 2005, 16:42 UTC
Message-ID
<Pine.LNX.4.58.0508150930020.3553@g5.osdl.org>
In-Reply-To
<20050815080931.64F0D352633@atlas.denx.de>
On Mon, 15 Aug 2005, Wolfgang Denk wrote:
Show 6 quoted lines
> 
> I asked this question before without receiving any reply:
> 
> Assume I know exactly where the merge back happenend - is  there  any
> way to tell git about it, so I don't see all these dangling heads any
> more?
You'd have to teach cvsimport about it. Basically, in cvsimport, you have
		...
                my @par = ();
                @par = ("-p",$parent) if $parent;

which sets the parent. Right now the parent is _always_ just the previous head of the branch we're committing to (I'm no good with perl, but I think Martin was wrong - there's no code to handle the case of a merge: once we branch off, "git cvsimport" will not currently ever create a merge-commit).

But if you have some heuristic for figuring out that it's a merge, and know the other branch is, you could add more parents by just adding another ("-p", $merge_parent) to the parameters to git-commit-tree.

The problem is literally how to figure out that it's a merge. You can probably make a guess from the commit message together with possibly looking at the diff.

The good news is that if you guess wrong, and you claim a merge where none exists, it doesn't really do any real damage. It might make th history look strange, and it might make subsequent git merges harder if the branch is actually still live and you want to continue development within git. But even that is debatable (if the eventual git merge isn't trivial, you're likely to have to merge by hand anyway - and it's going to be as hard as a CVS merge would have been, because quite frankly, you've got the same information CVS had..).

		Linus
Previous: Sven VerdoolaegeNext: Martin Langhoff
Message 12 of 16 in “Switching heads and head vs branch after CVS import”
  1. Martin LanghoffAug 15, 2005
  2. Junio C HamanoAug 15, 2005
  3. Linus TorvaldsAug 15, 2005
  4. Martin LanghoffAug 15, 2005
  5. Linus TorvaldsAug 15, 2005
  6. Sven VerdoolaegeAug 15, 2005
  7. Matthias UrlichsAug 15, 2005
  8. Martin LanghoffAug 15, 2005
  9. Wolfgang DenkAug 15, 2005
  10. Matthias UrlichsAug 15, 2005
  11. Sven VerdoolaegeAug 15, 2005
  12. Linus TorvaldsAug 15, 2005
  13. Martin LanghoffAug 15, 2005
  14. Wolfgang DenkAug 15, 2005
  15. Linus TorvaldsAug 15, 2005
  16. Johannes SchindelinAug 15, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.