You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
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>
5 years ago
..
basic filter-repo: add some basic tests, with git-style test-lib.sh 6 years ago
basic-filename filter-repo: add some basic tests, with git-style test-lib.sh 6 years ago
basic-mailmap filter-repo: add mailmap handling 5 years ago
basic-numbers filter-repo: add more path-related testcases 5 years ago
basic-replace filter-repo: add text removal (or replacement) via file of expressions 5 years ago
basic-ten filter-repo: add some basic tests, with git-style test-lib.sh 6 years ago
basic-twenty filter-repo: add some basic tests, with git-style test-lib.sh 6 years ago
degenerate filter-repo: add testcases dealing with topology changes 5 years ago
degenerate-globme filter-repo: add testcases dealing with topology changes 5 years ago
degenerate-keepme filter-repo: add testcases dealing with topology changes 5 years ago
degenerate-keepme-noff filter-repo: add new --no-ff option 5 years ago
degenerate-moduleA filter-repo: add testcases dealing with topology changes 5 years ago
empty filter-repo: handle implicit parents 5 years ago
empty-keepme filter-repo: add testcases dealing with commit pruning 5 years ago
less-empty-keepme filter-repo: allow users to adjust pruning of empty & degenerate commits 5 years ago
more-empty-keepme filter-repo: allow users to adjust pruning of empty & degenerate commits 5 years ago
sample-mailmap filter-repo: parse mailmap entries with no email address 5 years ago
sample-replace filter-repo: add text removal (or replacement) via file of expressions 5 years ago
unusual filter-repo: parse mailmap entries with no email address 5 years ago
unusual-filtered filter-repo: parse mailmap entries with no email address 5 years ago
unusual-mailmap filter-repo: parse mailmap entries with no email address 5 years ago