From f8c6dea791e173e3bfd5d8c25b50a5310ac3acd0 Mon Sep 17 00:00:00 2001 From: Brian Lyles Date: Mon, 8 Jan 2024 00:04:06 -0600 Subject: [PATCH] cherry-pick: Add `--empty` for more robust redundant commit handling As with `git-rebase` and `git-am`, `git-cherry-pick` can result in a commit being made redundant if the content from the picked commit is already present in the target history. However, `git-cherry-pick` does not have the same options available that `git-rebase` and `git-am` have. There are three things that can be done with these redundant commits: drop them, keep them, or have the cherry-pick stop and wait for the user to take an action. `git-rebase` has the `--empty` option added in commit e98c4269c8 (rebase (interactive-backend): fix handling of commits that become empty, 2020-02-15), which handles all three of these scenarios. Similarly, `git-am` got its own `--empty` in 7c096b8d61 (am: support --empty=