Any plans/needs to extend the fast-import format?
Shawn O. Pearce
spearce at spearce.org
Tue Aug 25 15:40:40 BST 2009
Miklos Vajna <vmiklos at frugalware.org> wrote:
> On Tue, Aug 25, 2009 at 04:17:21PM +1000, Ian Clatworthy <ian.clatworthy at canonical.com> wrote:
> > BTW, most Bazaar users would grumble loudly if most commit messages had
> > that additional cross-tool metadata tacked on the end. That sort of
> > thing may not matter to the git user base but I can promise you it does
> > for ours. Different tools appeal to different groups of users - no
> > surprises there.
> Let's say you renamed foo to bar in bzr, then totally rewrote bar, then
> committed. So if you export this to git and import it back, you will
> loose the rename info (which is in fact a good thing as in case you
> totally rewrote the file, it's not a rename, but let's not talk about it
> for now).
> and now if you import it back, you can just seek for git-bzr lines at
> the end of the commit message and parse them, sou you can rebuild the
> original commit object without any problem.
That is ugly.
I'm much more in favor of Ian's point, that the stream format should
be able to describe this additional data.
If git handles it by storing it on the footer of the commit message,
it should do so in a way that allows it to split that off during
git-fast-export, and format it back into the stream in a meaningful
way. If git doesn't know how to handle that data, then the importer
can either permit the user to do a lossy import by skipping it,
or fails fast and tells the user it doesn't understand this dump.
Ian was talking about additional authors earlier. In bzr perhaps
they have a way to store multiple authors per commit. In git we
don't, we have a single author, but by convention we put a bunch of
footer lines for the additional authors. E.g. the jh/notes topic
currently in git.git pu has a commit like this:
Author: Johannes Schindelin <Johannes.Schindelin at gmx.de>
Date: Wed Jul 29 04:25:20 2009 +0200
Add a script to edit/inspect notes
Signed-off-by: Johannes Schindelin <johannes.schindelin at gmx.de>
Signed-off-by: Tor Arne VestbÃ¸ <tavestbo at trolltech.com>
Signed-off-by: Michael J Gruber <git at drmicha.warpmail.net>
Signed-off-by: Thomas Rast <trast at student.ethz.ch>
Signed-off-by: Christian Couder <chriscool at tuxfamily.org>
Signed-off-by: Johan Herland <johan at herland.net>
Signed-off-by: Junio C Hamano <gitster at pobox.com>
"Git style" would say that we add extra authors seen in the import
stream as new footers, like "Authored-by: ...". Likewise, bug
data in bzr (which apparently has a bug property or something)
would go in the footer as "Bug: ...".
The only real problem is, git-fast-export would need to have two
different export modes: pure git, which leaves this stuff in the
commit footer, and standard fast-import, which tries to extract
the footer extended data into fast-import stream information where
there is a corresponding relationship. Just like it already has
to deal with producing renames, or not to produce renames.
More information about the bazaar