filter-branch: nearest-ancestor rewriting outside subdir filter
authorThomas Rast <trast@student.ethz.ch>
Tue, 10 Nov 2009 21:04:51 +0000 (22:04 +0100)
committerJunio C Hamano <gitster@pobox.com>
Fri, 13 Nov 2009 19:26:43 +0000 (11:26 -0800)
commitf2f3a6b802e3dae09a1c414cd8516ff2a546a527
treeca23c536248b2861bca602b5b6d5c32863a8f7a2
parent2c1d2d818895d896f706835142a75978aabdbdc9
filter-branch: nearest-ancestor rewriting outside subdir filter

Since a0e4639 (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: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-filter-branch.txt
git-filter-branch.sh
t/t7003-filter-branch.sh