git-filter-repo/t
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
..
t9390 filter-repo: add new --no-ff option 2020-01-01 10:49:56 -08:00
t9391 filter-repo: consistently use bytestrings for directory names 2019-10-21 09:09:23 -07:00
run_coverage run_coverage: prefer coverage3 to python3-coverage 2019-11-21 16:19:26 -08:00
t9390-filter-repo.sh filter-repo: add new --no-ff option 2020-01-01 10:49:56 -08:00
t9391-filter-repo-lib-usage.sh filter-repo: consistently use bytestrings for directory names 2019-10-21 09:09:23 -07:00
t9392-python-callback.sh filter-repo (python3): replace strings with bytestrings 2019-05-08 08:57:51 -07:00
test-lib-functions.sh filter-repo: add some basic tests, with git-style test-lib.sh 2019-03-12 14:19:38 -07:00
test-lib.sh filter-repo: add some basic tests, with git-style test-lib.sh 2019-03-12 14:19:38 -07:00