revert: clarify label on conflict hunks
commitd68565402a69fac3fe0e0653718feca7c80c178b
authorJonathan Nieder <jrnieder@gmail.com>
Sun, 21 Mar 2010 00:45:21 +0000 (20 19:45 -0500)
committerJunio C Hamano <gitster@pobox.com>
Sun, 21 Mar 2010 03:36:11 +0000 (20 20:36 -0700)
tree9a7d6ac8232e57693d63e17ad5c9e61fcbcc8023
parent137c6eaa885a421346f0a5abbc3cc4903671fbeb
revert: clarify label on conflict hunks

When reverting a commit, the commit being merged is not the commit
to revert itself but its parent.  Add “parent of” to the conflict
hunk label to make this more clear.

The conflict hunk labels are all pieces of a single string written in
the new get_message() function.  Avoid some complication by using
mempcpy to advance a pointer as the result is written.

Also free the corresponding temporary buffer (it was leaked before).
This is not important because it is a small one-time allocation.  It
would become a memory leak if unnoticed when libifying revert.

This patch uses calls to strlen() instead of integer constants in some
places.  GCC will compute the length at compile time; I am not sure
about other compilers, but this is not performance-critical anyway.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/revert.c
t/t3507-cherry-pick-conflict.sh