From: Jonathan Nieder <jrnieder@gmail.com>
To: git@vger.kernel.org
Cc: "Shawn O. Pearce" <spearce@spearce.org>,
"Santi Béjar" <santi@agolina.net>,
"Junio C Hamano" <gitster@pobox.com>
Subject: [PATCH 0/2] commit --amend and missing space in ident line
Date: Sun, 2 May 2010 03:49:45 -0500 [thread overview]
Message-ID: <20100502084827.GA1690@progeny.tock> (raw)
The problem: since fast-import is advertised to expect the format
"author" SP LT email GT SP date
when there is no display name associated to the author of a commit, it
seems likely that some importers use that format[1]. Current
fast-import passes that input through into the generated commit
objects. Which would mean there are commit objects like this in
existing repositories generated by such importers.
Since commit --amend looks for the string " <" _after_ the "author "
string, it does not cope well with this sort of ident line. In fact,
the first " <" is found on the following "committer" line, while "> "
is found on the author line; the distance between them, because
negative, becomes a large unsigned integer; and the display name and
email are considered to be very long but acceptable and happily
used[2].
After this series, commit --amend will instead see an empty display
name and the email from between the angle brackets and accordingly die
after complaining about the empty ident. It might make sense to
tolerate an empty ident during --amend (silently fixing it up to add
the extra space character when missing), but such a change to the
traditional "GIT_AUTHOR_NAME=" behavior would go beyond the scope of
this series.
Thoughts?
Jonathan Nieder (2):
test-lib: Let tests specify commands to be run at end of test
commit --amend: cope better with invalid ident line
builtin/commit.c | 20 +++++++++++++-------
t/t7509-commit.sh | 46 ++++++++++++++++++++++++++++++++++++++++++++++
t/test-lib.sh | 28 +++++++++++++++++++++++++++-
3 files changed, 86 insertions(+), 8 deletions(-)
[1] http://thread.gmane.org/gmane.comp.version-control.git/145651/focus=145825
[2] Earlier I suspected it would die().
http://thread.gmane.org/gmane.comp.version-control.git/145651/focus=145826
Sorry for the nonsense.
next reply other threads:[~2010-05-02 8:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-02 8:49 Jonathan Nieder [this message]
2010-05-02 8:53 ` [PATCH 1/2] test-lib: Let tests specify commands to be run at end of test Jonathan Nieder
2010-05-02 8:57 ` [PATCH 2/2] commit --amend: cope with missing display name Jonathan Nieder
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=20100502084827.GA1690@progeny.tock \
--to=jrnieder@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=santi@agolina.net \
--cc=spearce@spearce.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;
as well as URLs for NNTP newsgroup(s).