[PATCHv2] Make filter-branch work with many branches

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

 



When there are many branches, we can overflow the maximum number of
arguments to exec*().

Signed-off-by: Dave Zarzycki <zarzycki@xxxxxxxxx>
---
 git-filter-branch.sh |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/git-filter-branch.sh b/git-filter-branch.sh
index 962a93b..a93e582 100755
--- a/git-filter-branch.sh
+++ b/git-filter-branch.sh
@@ -274,7 +274,7 @@ else
 	remap_to_ancestor=t
 fi
 
-rev_args=$(git rev-parse --revs-only "$@")
+rev_parse_args="$@"
 
 case "$filter_subdir" in
 "")
@@ -286,8 +286,9 @@ case "$filter_subdir" in
 	;;
 esac
 
-git rev-list --reverse --topo-order --default HEAD \
-	--parents --simplify-merges $rev_args "$@" > ../revs ||
+git rev-parse --revs-only "$rev_parse_args" | git rev-list --stdin \
+	--reverse --topo-order --default HEAD	\
+	--parents --simplify-merges "$@" > ../revs ||
 	die "Could not get the commits"
 commits=$(wc -l <../revs | tr -d " ")
 
-- 
1.7.6.235.gfdb98

--
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]