Git development
 help / color / mirror / Atom feed
From: Dmitry Ivankov <divanorama@gmail.com>
To: git@vger.kernel.org
Subject: Re: SP in committer line in fast-import stream
Date: Mon, 18 Jul 2011 16:57:52 +0000 (UTC)	[thread overview]
Message-ID: <loom.20110718T184404-335@post.gmane.org> (raw)
In-Reply-To: CAE3X6mxbMBwd5O+md0J3M6DUu38Q1uzDHNhAU7iGbqYVm2TyRw@mail.gmail.com

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

  reply	other threads:[~2011-07-18 16:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-18 14:26 SP in committer line in fast-import stream SASAKI Suguru
2011-07-18 15:38 ` Dmitry Ivankov
2011-07-18 16:18   ` SASAKI Suguru
2011-07-18 16:57     ` Dmitry Ivankov [this message]
2011-07-18 19:10       ` SASAKI Suguru

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=loom.20110718T184404-335@post.gmane.org \
    --to=divanorama@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox