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

Re: "commit"s without "from" in fast-import

From
Shawn O. Pearce <spearce@spearce.org>
Date
Mar 18, 2008, 03:43 UTC
Message-ID
<20080318034321.GK8410@spearce.org>
In-Reply-To
<F6F70627-FAE7-43F1-BECC-E70A4A561982@orakel.ntnu.no>
Eyvind Bernhardsen <eyvind-git@orakel.ntnu.no> wrote:
Show 8 quoted lines
> I have a question about fast-import, specifically a (possibly)  
> unorthodox usage of it by cvs2svn.  Cvs2svn generates "commit"s with  
> no "from" commands; instead, it emits a "merge" from the previous  
> commit on the branch, and then rebuilds the entire state of the tree.
> 
> I've verified that the generated repositories are correct, so I know  
> that it works, and I _think_ that it's equivalent to having "from  
> <mark>" followed by "filedeleteall".

Hehe. Cute trick. Never intended for it to be used like that. The git implementation of git-fast-import behaves as you describe, but I do not know how bzr-fast-import would handle such a stream.

> What I'm wondering is: is there any reason to modify cvs2svn's output  
> to comply more to the man page's way of doing things, or is this a  
> perfectly valid usage?

In my opinion its an interesting use of the language. The grammar does not say that no merge commands are permitted when creating a branch. It wasn't what I intended, and is really a gap in the grammar specification. I'd prefer well known frontends use a more conventional structure, just in case something were to ever change about the implementation details of a given importer and this command set break. But that's just me.

Maybe we should make this more formalized in the documentation as allowable, so if it does break for an importer the importer author has to fix git-fast-import, bzr-fast-import, *-fast-import instead.

-- 
Shawn.
Previous: Eyvind BernhardsenNext: Shawn O. Pearce
Message 2 of 9 in “"commit"s without "from" in fast-import”
  1. Eyvind BernhardsenMar 17, 2008
  2. Shawn O. PearceMar 18, 2008
  3. Shawn O. PearceMar 19, 2008
  4. James WestbyMar 19, 2008
  5. Shawn O. PearceMar 20, 2008
  6. Eyvind BernhardsenMar 21, 2008
  7. fast-import: Document the effect of "merge" with no "from" in a commitEyvind Bernhardsen, Mar 21, 2008
  8. Shawn O. PearceMar 23, 2008
  9. Junio C HamanoMar 23, 2008

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.