From ec79d763de617905bd9275de0b5941a160d6159b Mon Sep 17 00:00:00 2001 From: Brian Lyles Date: Mon, 25 Mar 2024 18:16:54 -0500 Subject: [PATCH] cherry-pick: add `--empty` for more robust redundant commit handling As with git-rebase(1) and git-am(1), git-cherry-pick(1) 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(1) does not have the same options available that git-rebase(1) and git-am(1) 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(1) 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(1) got its own `--empty` in 7c096b8d61 (am: support --empty=