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

Re: SP in committer line in fast-import stream

From
Dmitry Ivankov <divanorama@gmail.com>
Date
Jul 18, 2011, 16:57 UTC
Message-ID
<loom.20110718T184404-335@post.gmane.org>
In-Reply-To
<CAE3X6mxbMBwd5O+md0J3M6DUu38Q1uzDHNhAU7iGbqYVm2TyRw@mail.gmail.com>
SASAKI Suguru <sss.sonik <at> gmail.com> writes:
Show 6 quoted lines
> >
> > The shortest fix is to read documentation as
> > 'committer' SP <name> SP LT <email> GT SP <when> LF
> 
> Thanks.  I understand what happens.
> For now, I'll write some wrapper around git-fast-import as a workaound for 
this.
Show 7 quoted lines
> 
> But, if git-fast-import successfully import and git-fsck will confuse,
> aren't some fixes necessary?
> It might be too done if git-fast-import will check as if git-fsck does,
> but I think some simple checks will help us.
> 
> Any comments?

One patch is at the bottom, it makes fast-import behave well on proper input streams like yours. Making fast-import stricter is worthy but will be a larger patch and effort. I'll try not to forget about and at least to write some failing tests.

> 
> Regards,
> 

Name cannot contain LT or GT and ident comes after SP in fast-import. So pretend there was a <empty name> SP if there is no name at all.

Parsing isn't strict still.
diff --git a/fast-import.c b/fast-import.c
index 78d9786..91a90e2 100644
--- a/fast-import.c
+++ b/fast-import.c
@@ -1971,6 +1971,9 @@ static char *parse_ident(const char *buf)
        size_t name_len;
        char *ident;
 
+       /* ensure there is a space delimiter even if there is no name */
+       if (*buf == '<')
+               --buf;
        gt = strrchr(buf, '>');
        if (!gt)
                die("Missing > in ident string: %s", buf);
Previous: SASAKI SuguruNext: SASAKI Suguru
Message 4 of 5 in “SP in committer line in fast-import stream”
  1. SASAKI SuguruJul 18, 2011
  2. Dmitry IvankovJul 18, 2011
  3. SASAKI SuguruJul 18, 2011
  4. Dmitry IvankovJul 18, 2011
  5. SASAKI SuguruJul 18, 2011

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.