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

Re: git-fast-export issue?

From
Shawn Pearce <spearce@spearce.org>
Date
Nov 11, 2010, 18:55 UTC
Message-ID
<AANLkTinpLGsRXdPwO4E7AB4yyt-G5eWBtCcWKrJy2A6n@mail.gmail.com>
In-Reply-To
<20101111080930.66e2fb21@atmarama.noip.me>
+git mailing list
On Wed, Nov 10, 2010 at 11:09 PM, Gour <gour@atmarama.net> wrote:
Show 7 quoted lines
> On Wed, 10 Nov 2010 20:53:31 -0500
>>>>>>> "Richard" == Richard Hipp wrote:
>
> Richard> Gour:  The git fast-export manpage says that Shawn O. Pearce,
> Richard> CCed on this email, is the author and maintainer of
> Richard> git-fast-export.  I'm including him in the conversation in the
> Richard> hopes that he can shed some light on this issue.

I'm not actually the maintainer of git fast-export. I don't know where that came from. Maybe its because I wrote and maintained git fast-import for a few years?

> Richard> M 100644 :938 emacs/emacs-custom.el
...
> Richard> M 100644 :1075 emacs/emacs.rc
> Richard> D emacs

This looks like a mistake by `git fast-export --all`. The D emacs needed to come *before* the M commands that put files into the directory. But it was emit afterwards. I'm not sure why.

Show 24 quoted lines
> Richard> According to my reading of the manpage at
> Richard> http://www.kernel.org/pub/software/scm/git/docs/git-fast-export.html
> Richard> the "D emacs" line above should delete the "emacs" folder and
> Richard> all of its contents. Clearly my understanding is wrong,
> Richard> though, since Git doesn't actually do that, and why would it
> Richard> change files in that directory prior to deleting them?  But
> Richard> the "fossil import" command is currently coded to do what I
> Richard> understand the documentation says it should do - which is to
> Richard> delete the content of the "emacs" folder.  A subsequent commit
> Richard> adds the file emacs/emacs.rc which is why the folder still
> Richard> exists in the tip.
> Richard>
> Richard> I'm really perplexed about that D line.
>
> The above D line says, according to my understanding based on the
> actions I did on the repo, to remove emacs *file*.
>
> it was caused by one of the darcs features called 'rename' which darcs
> does quite good.
>
> Here is what I did.
>
> I've created emacs *folder* and put emacs-* files into it, renamed
> emacs into emacs.rc and moved into into emacs/emacs.rc.

OK. In this case "D emacs, M emacs/emacs.rc" makes sense if you renamed "emacs" to "emacs/emacs.rc". Unfortunately git fast-export wrote the commands in the wrong order. The fast-import stream language executes the file commands in the order they appear on the stream, as though it was updating a real filesystem. This can be awkward to use sometimes when changing a file to become a directory.

Based on what you said above, the stream is broken, and you can't fix it in the importer that is trying to read it. git fast-export should have put "D emacs" first in the stream, not last.

-- 
Shawn.
Message 1 of 1 in “Re: git-fast-export issue?”
  1. Shawn PearceNov 11, 2010

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.