Thread (12 messages) 12 messages, 2 authors, 2022-10-01
STALE1379d

[PATCH 0/6] revision: fix order of revs for ^!

From: René Scharfe <hidden>
Date: 2022-09-15 14:49:10

According to gitrevisions(7), "R^!" is the same as "R ^R^1 [^R^2...]",
but handle_revision_arg_1() instead resolves it to "^R^1 [^R^2...] R".
This ordering affects git diff, which expects the child to be given
before its parents when asked to produce a combined diff of a merge.

This series reverses that order and makes "git diff R^!" consistent
with "git show R^!".  First an unrelated cleanup in the vicinity:

  revision: use strtol_i() for exclude_parent

Then dissolve add_parents_only() to gain the necessary flexibility.  I
may have overdone it:

  revision: factor out get_commit()
  revision: factor out add_parent()
  revision: factor out add_parents()
  revision: rename add_parents_only() to add_nth_parent()

Finally the actual change of order:

  revision: add parents after child for ^!

 revision.c               | 87 ++++++++++++++++++++++++++--------------
 t/t4038-diff-combined.sh | 10 +++++
 2 files changed, 68 insertions(+), 29 deletions(-)

--
2.37.3
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help