From: Dmitry Ivankov Date: Mon, 18 Jul 2011 16:57:52 GMT Subject: Re: SP in committer line in fast-import stream Message-ID: In-Reply-To: SASAKI Suguru gmail.com> writes: > > > > The shortest fix is to read documentation as > > 'committer' SP SP LT GT SP LF > > Thanks. I understand what happens. > For now, I'll write some wrapper around git-fast-import as a workaound for this. > > 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 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);