[PATCH 0/2] commit --amend and missing space in ident line

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

 



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.
--
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]