summaryrefslogtreecommitdiff
path: root/git-filter-branch.sh
diff options
context:
space:
mode:
authorLee Carver <Lee.Carver@servicenow.com>2013-09-10 22:55:35 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-09-12 18:00:51 (GMT)
commit3361a548dbedde96d75bd4134e9ab9e6d82774dd (patch)
tree2e16f3eb90775f980e1e34bc53df0ecb38d12e45 /git-filter-branch.sh
parent2ea3df68e881405940596b8c299921f681f8c22c (diff)
downloadgit-3361a548dbedde96d75bd4134e9ab9e6d82774dd.zip
git-3361a548dbedde96d75bd4134e9ab9e6d82774dd.tar.gz
git-3361a548dbedde96d75bd4134e9ab9e6d82774dd.tar.bz2
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>
Diffstat (limited to 'git-filter-branch.sh')
-rwxr-xr-xgit-filter-branch.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/git-filter-branch.sh b/git-filter-branch.sh
index ac2a005..ca3d539 100755
--- a/git-filter-branch.sh
+++ b/git-filter-branch.sh
@@ -255,7 +255,7 @@ else
remap_to_ancestor=t
fi
-rev_args=$(git rev-parse --revs-only "$@")
+git rev-parse --revs-only "$@" >../parse
case "$filter_subdir" in
"")
@@ -268,7 +268,7 @@ case "$filter_subdir" in
esac
git rev-list --reverse --topo-order --default HEAD \
- --parents --simplify-merges $rev_args "$@" > ../revs ||
+ --parents --simplify-merges --stdin "$@" <../parse >../revs ||
die "Could not get the commits"
commits=$(wc -l <../revs | tr -d " ")