git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH 0/6] revision: fix order of revs for ^!
@ 2022-09-15 14:48 René Scharfe
  2022-09-15 14:51 ` [PATCH 1/6] revision: use strtol_i() for exclude_parent René Scharfe
                   ` (6 more replies)
  0 siblings, 7 replies; 16+ messages in thread
From: René Scharfe @ 2022-09-15 14:48 UTC (permalink / raw)
  To: Git List; +Cc: Junio C Hamano, Tim Jaacks, Chris Torek

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

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2022-10-01 10:28 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-15 14:48 [PATCH 0/6] revision: fix order of revs for ^! René Scharfe
2022-09-15 14:51 ` [PATCH 1/6] revision: use strtol_i() for exclude_parent René Scharfe
2022-09-17  0:59   ` Chris Torek
2022-09-15 14:52 ` [PATCH 2/6] revision: factor out get_commit() René Scharfe
2022-09-15 14:52 ` [PATCH 3/6] revision: factor out add_parent() René Scharfe
2022-09-15 14:53 ` [PATCH 4/6] revision: factor out add_parents() René Scharfe
2022-09-15 14:54 ` [PATCH 5/6] revision: rename add_parents_only() to add_nth_parent() René Scharfe
2022-09-15 14:55 ` [PATCH 6/6] revision: add parents after child for ^! René Scharfe
2022-09-15 17:53   ` Junio C Hamano
2022-09-16  9:02     ` René Scharfe
2022-09-16 15:55       ` Junio C Hamano
2022-09-18  5:36         ` René Scharfe
2022-10-01 10:23 ` [PATCH v3 0/3] diff: support ^! for merges René Scharfe
2022-10-01 10:25   ` [PATCH v3 1/3] revision: use strtol_i() for exclude_parent René Scharfe
2022-10-01 10:26   ` [PATCH v3 2/3] revisions.txt: unspecify order of resolved parts of ^! René Scharfe
2022-10-01 10:28   ` [PATCH v3 3/3] diff: support ^! for merges René Scharfe

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).