Re: SP in committer line in fast-import stream

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



SASAKI Suguru <sss.sonik <at> gmail.com> writes:

> >
> > 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.
> 
> 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);


--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]