{"thread":{"id":"27854","subject":"[PATCH] Make filter-branch work with many branches","startedAt":"2011-07-19T16:29:44Z","lastAt":"2011-07-20T13:34:33Z","messageCount":3,"participants":["Dave Zarzycki","Johannes Sixt"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"171659","messageId":"E186982C-71AE-4C08-B857-A67BDCD21E3D@apple.com","threadId":"27854","inReplyTo":null,"subject":"[PATCH] Make filter-branch work with many branches","fromName":"Dave Zarzycki","fromEmail":"zarzycki@apple.com","sentAt":"2011-07-19T16:29:44Z","receivedAt":"2011-07-19T16:29:44Z","isPatch":true,"sender":{"key":"zarzycki@apple.com","avatar":"https://avatars.githubusercontent.com/u/1071982?v=4"},"body":"When there are many branches, we can overflow the maximum number of\narguments to exec*().\n\nSigned-off-by: Dave Zarzycki <zarzycki@apple.com>\n---\n git-filter-branch.sh |    6 ++----\n 1 files changed, 2 insertions(+), 4 deletions(-)\n\ndiff --git a/git-filter-branch.sh b/git-filter-branch.sh\nindex 962a93b..0c03db0 100755\n--- a/git-filter-branch.sh\n+++ b/git-filter-branch.sh\n@@ -274,8 +274,6 @@ else\n \tremap_to_ancestor=t\n fi\n \n-rev_args=$(git rev-parse --revs-only \"$@\")\n-\n case \"$filter_subdir\" in\n \"\")\n \teval set -- \"$(git rev-parse --sq --no-revs \"$@\")\"\n@@ -286,8 +284,8 @@ case \"$filter_subdir\" in\n \t;;\n esac\n \n-git rev-list --reverse --topo-order --default HEAD \\\n-\t--parents --simplify-merges $rev_args \"$@\" > ../revs ||\n+git rev-parse --revs-only \"$@\" | git rev-list --stdin --reverse --topo-order \\\n+\t--default HEAD --parents --simplify-merges \"$@\" > ../revs ||\n \tdie \"Could not get the commits\"\n commits=$(wc -l <../revs | tr -d \" \")\n \n-- \n1.7.6.135.g8cdba\n"},{"id":"171687","messageId":"4E25C78A.1090600@kdbg.org","threadId":"27854","inReplyTo":"E186982C-71AE-4C08-B857-A67BDCD21E3D@apple.com","subject":"Re: [PATCH] Make filter-branch work with many branches","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2011-07-19T18:06:02Z","receivedAt":"2011-07-19T18:06:02Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 19.07.2011 18:29, schrieb Dave Zarzycki:\n> -rev_args=$(git rev-parse --revs-only \"$@\")\n> -\n>  case \"$filter_subdir\" in\n>  \"\")\n>  \teval set -- \"$(git rev-parse --sq --no-revs \"$@\")\"\n\nThis line in the hunk context changes what \"$@\" will produce. Therefore,\nthe \"$@\" that you removed above will not produce the same thing...\n\n> @@ -286,8 +284,8 @@ case \"$filter_subdir\" in\n>  \t;;\n>  esac\n>  \n> -git rev-list --reverse --topo-order --default HEAD \\\n> -\t--parents --simplify-merges $rev_args \"$@\" > ../revs ||\n> +git rev-parse --revs-only \"$@\" | git rev-list --stdin --reverse --topo-order \\\n> +\t--default HEAD --parents --simplify-merges \"$@\" > ../revs ||\n\n... that you insert here. How can the result ever have worked for you?\n\nPerhaps store the list of revs in a temporary file?\n\n-- Hannes\n"},{"id":"171737","messageId":"E7EC8C9A-DB1C-4C75-A860-7132E36C9369@apple.com","threadId":"27854","inReplyTo":"4E25C78A.1090600@kdbg.org","subject":"Re: [PATCH] Make filter-branch work with many branches","fromName":"Dave Zarzycki","fromEmail":"zarzycki@apple.com","sentAt":"2011-07-20T13:34:33Z","receivedAt":"2011-07-20T13:34:33Z","isPatch":true,"sender":{"key":"zarzycki@apple.com","avatar":"https://avatars.githubusercontent.com/u/1071982?v=4"},"body":"\nOn Jul 19, 2011, at 11:06 AM, Johannes Sixt wrote:\n\n> Am 19.07.2011 18:29, schrieb Dave Zarzycki:\n>> -rev_args=$(git rev-parse --revs-only \"$@\")\n>> -\n>> case \"$filter_subdir\" in\n>> \"\")\n>> \teval set -- \"$(git rev-parse --sq --no-revs \"$@\")\"\n> \n> This line in the hunk context changes what \"$@\" will produce. Therefore,\n> the \"$@\" that you removed above will not produce the same thing...\n\nThanks. My shell scripting is rather rusty these days. I'll send a new patch.\n\ndavez\n"}]}