[PATCH] 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 |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/git-filter-branch.sh b/git-filter-branch.sh
index 962a93b..0c03db0 100755
--- a/git-filter-branch.sh
+++ b/git-filter-branch.sh
@@ -274,8 +274,6 @@ else
 	remap_to_ancestor=t
 fi
 
-rev_args=$(git rev-parse --revs-only "$@")
-
 case "$filter_subdir" in
 "")
 	eval set -- "$(git rev-parse --sq --no-revs "$@")"
@@ -286,8 +284,8 @@ case "$filter_subdir" in
 	;;
 esac
 
-git rev-list --reverse --topo-order --default HEAD \
-	--parents --simplify-merges $rev_args "$@" > ../revs ||
+git rev-parse --revs-only "$@" | 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.135.g8cdba

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