Code

filter-branch: fix behaviour of '-k'
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>
Tue, 5 Jun 2007 15:58:13 +0000 (16:58 +0100)
committerJunio C Hamano <gitster@pobox.com>
Wed, 6 Jun 2007 19:49:16 +0000 (12:49 -0700)
commit9840906026be807d0882f96396de3a3cdb9fb43e
treee9660a07d70a1ccb7804e275f106d9e3525330f1
parentc12764b8b7e004f84b1e685b76f2d662bee8e196
filter-branch: fix behaviour of '-k'

The option '-k' says that the given commit and _all_ of its ancestors
are kept as-is.

However, if a to-be-rewritten commit branched from an ancestor of an
ancestor of a commit given with '-k', filter-branch would fail.

Example:

A - B
  \
    C

If filter-branch was called with '-k B -s C', it would actually keep
B (and A as its parent), but would rewrite C, and its parent.

Noticed by Johannes Sixt.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-filter-branch.sh
t/t7003-filter-branch.sh