Re: [PATCH 11/16] revert_or_cherry_pick(): get oneline_body from get_oneline()

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

 



Stephen Boyd wrote:

> Could all this code just use the custom format printing routines in
> pretty.c? It might not be super efficient but at least it wouldn't
> duplicate a bunch of code.

I like this idea, but I wasn’t able to pull it off.  You see,
cmd_revert() uses a few substrings from a single string it generates:

 parent of ca87ef9... Do something very imporant
 ^         ^          ^
 1         2          3

These are put together like so:

For the commit message:

 Subject: Revert "[3]Do something very important"

 This reverts commit ca87ef90000000000000000000000000000000000.

For the conflict markers:

 <<<<<<< HEAD
 Version from the tip of the current branch.
 ||||||| [2]ca87ef9... Do something very important
 Version from the commit to be reverted.
 =======
 Version from the parent of the commit to be reverted.
 >>>>>>> [1]parent of ca87ef9... Do something very important

Nevertheless, investigating it did spur me to simplify this part of the
series a little.  I think the following two patches could replace
patches 11, 13, 14, and 15 from this thread.  I do not want to do any
drastic refactoring without libifying this code, though, and that should
wait for another series, I think.

Thanks for the feedback.

Jonathan Nieder (2):
  revert: clarify label on conflict hunks
  cherry-pick, revert: add a label for ancestor

 builtin/revert.c                |  129 +++++++++++++++++++++++----------------
 t/t3507-cherry-pick-conflict.sh |    8 +-
 2 files changed, 80 insertions(+), 57 deletions(-)

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