[PATCH 0/4] builtin/diff: learn --merge-base

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

 



The range-notation in `git diff` has been cited as a mistake since diff
compares two endpoints, not whole ranges.[0]  In fact, the ranges seem
to take on the opposite meanings when compared to range notation in
`git log`.

In an effort to reduce the use of range notation as much as possible,
introduce the `--merge-base` flag, slightly modified from a suggestion
by Jonathan Nieder.[1] This flag allows us to replace the first commit
given on the command-line with its merge base between the first and
second commits. This allows us to gently deprecate the `...` form
entirely, although that is left as an exercise to the reader ;)

One additional bonus is that this flag allows the "after" side to be not
just constrained to a commit (like with `...` notation). It can now be
the working tree or the index as well.

[0]: https://lore.kernel.org/git/xmqqy2v26hu0.fsf@xxxxxxxxxxxxxxxxxxxxxxxxx/
[1]: https://lore.kernel.org/git/20191223215928.GB38316@xxxxxxxxxx/

Denton Liu (4):
  t4068: remove unnecessary >tmp
  git-diff.txt: backtick quote command text
  builtin/diff: parse --no-index using parse_options()
  builtin/diff: learn --merge-base

 Documentation/git-diff.txt | 40 ++++++++++++-----
 builtin/diff.c             | 92 +++++++++++++++++++++++++++++++++-----
 diff-no-index.c            | 15 ++-----
 t/t4068-diff-symmetric.sh  | 89 +++++++++++++++++++++++++++++++++---
 4 files changed, 197 insertions(+), 39 deletions(-)

-- 
2.28.0.rc0.135.gc7877b767d




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

  Powered by Linux