git-filter-repo/t/t9390
Elijah Newren 5e04dff097 filter-repo: add new --no-ff option
Some projects have a strict --no-ff merging policy.  With the default
behavior of --prune-degenerate, we can prune merge commits in a way that
transforms the history into a fast-forward merge.  Consider this
example:
  * There are two independent commits or branches, named B & C, which
    are both built on top of A so that history look like this diagram:
        A
        \ \
         \ B
          \
           -C
  * Someone runs the following sequence of commands:
    * git checkout A
    * git merge --no-ff B
    * git merge --no-ff C
  * This will result in a history that looks like:
        A---AB---AC
        \ \ /   /
         \ B   /
          \   /
           -C-
  * Later, someone comes along and runs filter-repo, specifying to
    remove the only path(s) that were modified by B.  That would
    naturally remove commit B and the no-longer-necessary merge
    commit AB.  For someone using a strict no-ff policy, the desired
    history is
        A---AC
         \ /
          C
    However, the default handling for --prune-degenerate would
    notice that AC merely merges C into its own ancestor A, whereas
    the original AC merged C into something separate (namely, AB).
    So, it would say that AC has become degenerate and prune it,
    leaving the simple history of
        A
         \
          C
    For projects not using a strict no-ff policy, this simpler history
    is probably better, but for folks that want a strict no-ff policy,
    it is unfortunate.

Provide a --no-ff option to tweak the --prune-degenerate behavior so
that it ignores the first parent being an ancestor of another parent
(leaving the first parent unpruned even if it is or becomes degenerate
in this fashion).

Signed-off-by: Elijah Newren <newren@gmail.com>
2020-01-01 10:49:56 -08:00
..
basic filter-repo: add some basic tests, with git-style test-lib.sh 2019-03-12 14:19:38 -07:00
basic-filename filter-repo: add some basic tests, with git-style test-lib.sh 2019-03-12 14:19:38 -07:00
basic-mailmap filter-repo: add mailmap handling 2019-04-26 07:56:03 -07:00
basic-numbers filter-repo: add more path-related testcases 2019-04-29 09:56:37 -07:00
basic-replace filter-repo: add text removal (or replacement) via file of expressions 2019-04-26 07:56:03 -07:00
basic-ten filter-repo: add some basic tests, with git-style test-lib.sh 2019-03-12 14:19:38 -07:00
basic-twenty filter-repo: add some basic tests, with git-style test-lib.sh 2019-03-12 14:19:38 -07:00
degenerate filter-repo: add testcases dealing with topology changes 2019-04-29 09:56:38 -07:00
degenerate-globme filter-repo: add testcases dealing with topology changes 2019-04-29 09:56:38 -07:00
degenerate-keepme filter-repo: add testcases dealing with topology changes 2019-04-29 09:56:38 -07:00
degenerate-keepme-noff filter-repo: add new --no-ff option 2020-01-01 10:49:56 -08:00
degenerate-moduleA filter-repo: add testcases dealing with topology changes 2019-04-29 09:56:38 -07:00
empty filter-repo: handle implicit parents 2019-05-11 13:00:32 -07:00
empty-keepme filter-repo: add testcases dealing with commit pruning 2019-04-29 09:56:37 -07:00
less-empty-keepme filter-repo: allow users to adjust pruning of empty & degenerate commits 2019-05-11 13:01:19 -07:00
more-empty-keepme filter-repo: allow users to adjust pruning of empty & degenerate commits 2019-05-11 13:01:19 -07:00
sample-mailmap filter-repo: parse mailmap entries with no email address 2019-12-27 09:25:25 -05:00
sample-replace filter-repo: add text removal (or replacement) via file of expressions 2019-04-26 07:56:03 -07:00
unusual filter-repo: parse mailmap entries with no email address 2019-12-27 09:25:25 -05:00
unusual-filtered filter-repo: parse mailmap entries with no email address 2019-12-27 09:25:25 -05:00
unusual-mailmap filter-repo: parse mailmap entries with no email address 2019-12-27 09:25:25 -05:00