Subject: [PATCH v2 0/8] cherry-pick: add `--empty`

From: Brian Lyles <[email-masked]>
Date: Sat, 10 Feb 2024 01:43:48 -0600

The ultimate goal of this series is to allow git-cherry-pick(1) to
automatically drop redundant commits. The mechanism chosen is an
`--empty` option that provides the same flexibility as the `--empty`
options for git-rebase(1) and git-am(1).

Some secondary goals are to improve the consistency in the values and
documentation for this option across the three commands.

See "Does extending `--empty` to git-cherry-pick make sense?" [1] for
some context for why this option is desired in git-cherry-pick(1).

[1]: https://lore.kernel.org/git/CAHPHrSevBdQF0BisR8VK=jM=wj1dTUYEVrv31gLerAzL9=[email-masked]

Along the way, I (with some help from Elijah and Phillip) found a few
other things in the docs and related sequencer code to clean up.

Brian Lyles (8):
  docs: address inaccurate `--empty` default with `--exec`
  docs: clean up `--empty` formatting in git-rebase(1) and git-am(1)
  rebase: update `--empty=ask` to `--empty=drop`
  sequencer: treat error reading HEAD as unborn branch
  sequencer: do not require `allow_empty` for redundant commit options
  cherry-pick: decouple `--allow-empty` and `--keep-redundant-commits`
  cherry-pick: enforce `--keep-redundant-commits` incompatibility
  cherry-pick: add `--empty` for more robust redundant commit handling

 Documentation/git-am.txt                    | 20 ++++---
 Documentation/git-cherry-pick.txt           | 30 +++++++---
 Documentation/git-rebase.txt                | 26 ++++++---
 builtin/rebase.c                            | 16 +++--
 builtin/revert.c                            | 40 +++++++++++--
 sequencer.c                                 | 65 +++++++++++----------
 t/t3424-rebase-empty.sh                     | 55 ++++++++++++++++-
 t/t3501-revert-cherry-pick.sh               | 11 ++++
 t/t3505-cherry-pick-empty.sh                | 29 ++++++++-
 t/t3510-cherry-pick-sequence.sh             | 40 +++++++++++++
 t/t3515-cherry-pick-incompatible-options.sh | 48 +++++++++++++++
 11 files changed, 312 insertions(+), 68 deletions(-)
 create mode 100755 t/t3515-cherry-pick-incompatible-options.sh

-- 
2.43.0