Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Rast <trast@student.ethz.ch>2008-08-12 12:45:59 +0400
committerJunio C Hamano <gitster@pobox.com>2008-08-13 04:27:46 +0400
commitf34a9416ab9efa13a53a31cabd9061d583aaba7e (patch)
tree99faf959a211bdce3cd9a021ef50e56e3f0a190b /git-filter-branch.sh
parent5b2eeed1ba36caf71341c1557f2054681c353a14 (diff)
filter-branch: use --simplify-merges
Use rev-list --simplify-merges everywhere. This changes the behaviour of --subdirectory-filter in cases such as O -- A -\ \ \ \- B -- M where A and B bring the same changes to the subdirectory: It now keeps both sides of the merge. Previously, the history would have been simplified to 'O -- A'. Merges of unrelated side histories that never touch the subdirectory are still removed. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-filter-branch.sh')
-rwxr-xr-xgit-filter-branch.sh7
1 files changed, 4 insertions, 3 deletions
diff --git a/git-filter-branch.sh b/git-filter-branch.sh
index a140337e35..2688254af3 100755
--- a/git-filter-branch.sh
+++ b/git-filter-branch.sh
@@ -232,11 +232,11 @@ mkdir ../map || die "Could not create map/ directory"
case "$filter_subdir" in
"")
git rev-list --reverse --topo-order --default HEAD \
- --parents "$@"
+ --parents --simplify-merges "$@"
;;
*)
git rev-list --reverse --topo-order --default HEAD \
- --parents "$@" -- "$filter_subdir"
+ --parents --simplify-merges "$@" -- "$filter_subdir"
esac > ../revs || die "Could not get the commits"
commits=$(wc -l <../revs | tr -d " ")
@@ -326,7 +326,8 @@ then
do
sha1=$(git rev-parse "$ref"^0)
test -f "$workdir"/../map/$sha1 && continue
- ancestor=$(git rev-list -1 $ref -- "$filter_subdir")
+ ancestor=$(git rev-list --simplify-merges -1 \
+ $ref -- "$filter_subdir")
test "$ancestor" && echo $(map $ancestor) >> "$workdir"/../map/$sha1
done < "$tempdir"/heads
fi