• Thomas Rast's avatar
    filter-branch: nearest-ancestor rewriting outside subdir filter · f2f3a6b8
    Thomas Rast authored
    Since a0e46390 (filter-branch: fix ref rewriting with
    --subdirectory-filter, 2008-08-12) git-filter-branch has done
    nearest-ancestor rewriting when using a --subdirectory-filter.
    However, that rewriting strategy is also a useful building block in
    other tasks.  For example, if you want to split out a subset of files
    from your history, you would typically call
      git filter-branch -- <refs> -- <files>
    But this fails for all refs that do not point directly to a commit
    that affects <files>, because their referenced commit will not be
    rewritten and the ref remains untouched.
    The code was already there for the --subdirectory-filter case, so just
    introduce an option that enables it independently.
    Signed-off-by: default avatarThomas Rast <trast@student.ethz.ch>
    Signed-off-by: default avatarJohannes Sixt <j6t@kdbg.org>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
git-filter-branch.txt 16.3 KB