[RFH] filter-branch: ancestor detection weirdness

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



THIS WILL VERY LIKELY NOT WORK IN ALL CASES.

Use git rev-list -1 -- <subdir> to discover a random ancestor, instead
of more correct boundary detection.  Oddly enough, this _increases_
success rate with Jan's repository and --all.  May break randomly with
more complicated args.
---

Maybe someone understands what's going on and can fix the underlying
bug...

 git-filter-branch.sh |   12 +++---------
 1 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/git-filter-branch.sh b/git-filter-branch.sh
index 182822a..52b2bdf 100755
--- a/git-filter-branch.sh
+++ b/git-filter-branch.sh
@@ -325,15 +325,9 @@ while read ref
 do
 	sha1=$(git rev-parse "$ref"^0)
 	test -f "$workdir"/../map/$sha1 && continue
-	# Assign the boundarie(s) in the set of rewritten commits
-	# as the replacement commit(s).
-	# (This would look a bit nicer if --not --stdin worked.)
-	for p in $( (cd "$workdir"/../map; ls | sed "s/^/^/") |
-		git rev-list $ref --boundary --stdin |
-		sed -n "s/^-//p")
-	do
-		map $p >> "$workdir"/../map/$sha1
-	done
+	# Assign the first commit not pruned as the replacement.
+	candidate=$(git rev-list $ref -1 -- "$filter_subdir")
+	test "$candidate" && map "$candidate" > "$workdir"/../map/$sha1
 done < "$tempdir"/heads
 
 # Finally update the refs
-- 
1.6.0.rc2.19.g3c9ba

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux