Commit 661b671
sequencer: do not require
A consumer of the sequencer that wishes to take advantage of either the
`keep_redundant_commits` or `drop_redundant_commits` feature must also
specify `allow_empty`. However, these refer to two distinct types of
empty commits:
- `allow_empty` refers specifically to commits which start empty
- `keep_redundant_commits` refers specifically to commits that do not
start empty, but become empty due to the content already existing in
the target history
Conceptually, there is no reason that the behavior for handling one of
these should be entangled with the other. It is particularly unintuitive
to require `allow_empty` in order for `drop_redundant_commits` to have
an effect: in order to prevent redundant commits automatically,
initially-empty commits would need to be kept automatically as well.
Instead, rewrite the `allow_empty()` logic to remove the over-arching
requirement that `allow_empty` be specified in order to reach any of the
keep/drop behaviors. Only if the commit was originally empty will
`allow_empty` have an effect.
Note that no behavioral changes should result from this commit -- it
merely sets the stage for future commits. In one such future commit, an
`--empty` option will be added to git-cherry-pick(1), meaning that
`drop_redundant_commits` will be used by that command.
Signed-off-by: Brian Lyles <brianmlyles@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>allow_empty for redundant commit options1 parent 1b90588 commit 661b671
1 file changed
+7
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1734 | 1734 | | |
1735 | 1735 | | |
1736 | 1736 | | |
1737 | | - | |
| 1737 | + | |
| 1738 | + | |
1738 | 1739 | | |
1739 | | - | |
1740 | | - | |
1741 | | - | |
1742 | | - | |
1743 | | - | |
1744 | | - | |
1745 | | - | |
1746 | | - | |
1747 | | - | |
| 1740 | + | |
| 1741 | + | |
| 1742 | + | |
1748 | 1743 | | |
1749 | | - | |
1750 | | - | |
1751 | | - | |
1752 | 1744 | | |
1753 | 1745 | | |
1754 | 1746 | | |
1755 | 1747 | | |
1756 | 1748 | | |
1757 | 1749 | | |
1758 | | - | |
1759 | | - | |
1760 | | - | |
1761 | 1750 | | |
1762 | 1751 | | |
1763 | 1752 | | |
1764 | 1753 | | |
| 1754 | + | |
| 1755 | + | |
1765 | 1756 | | |
1766 | 1757 | | |
1767 | 1758 | | |
| |||
0 commit comments