Allow git-filter-branch to process large repositories with lots of branches.

A recommended way to move trees between repositories is to use git-filter-branch to revise the history for a single tree: However, this can lead to "argument list too long" errors when the original repository has many retained branches (>6k) /usr/local/git/libexec/git-core/git-filter-branch: line 270: /usr/local/git/libexec/git-core/git: Argument list too long Could not get the commits Saving the output from rev-parse and feeding it into rev-list from its standard input avoids this problem, since the rev-parse output is not processed as a command line argument. Signed-off-by: Lee Carver <Lee.Carver@servicenow.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Lee Carver committed Sep 10, 2013 at 22:55 UTC 3361a548dbedde96d75bd4134e9ab9e6d82774dd
1 file changed +2 -2
git-filter-branch.sh
+2 -2
@@ -255,7 +255,7 @@ else
255 remap_to_ancestor=t
256 fi
257
258 -rev_args=$(git rev-parse --revs-only "$@")
258 +git rev-parse --revs-only "$@" >../parse
259
260 case "$filter_subdir" in
261 "")
@@ -268,7 +268,7 @@ case "$filter_subdir" in
268 esac
269
270 git rev-list --reverse --topo-order --default HEAD \
271 - --parents --simplify-merges $rev_args "$@" > ../revs ||
271 + --parents --simplify-merges --stdin "$@" <../parse >../revs ||
272 die "Could not get the commits"
273 commits=$(wc -l <../revs | tr -d " ")
274