git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] Make filter-branch work with many branches

From
Dave Zarzycki <zarzycki@apple.com>
Date
Jul 19, 2011, 16:29 UTC
Message-ID
<E186982C-71AE-4C08-B857-A67BDCD21E3D@apple.com>

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

Signed-off-by: Dave Zarzycki <zarzycki@apple.com>
---
 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
Next: Johannes Sixt
Message 1 of 3 in “Make filter-branch work with many branches”
  1. Make filter-branch work with many branchesDave Zarzycki, Jul 19, 2011
  2. Johannes SixtJul 19, 2011
  3. Dave ZarzyckiJul 20, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.