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

[PATCH 1/3] Fix potential command line overflow in hooks--update

From
APAndy Parkins <andyparkins@gmail.com>
Date
Feb 13, 2007, 14:23 UTC
Message-ID
<200702131423.58561.andyparkins@gmail.com>

In a repository with a large number of refs, the following command line could easily overflow the command line size limitations

 git-rev-list $newref $(git-rev-parse --not --all)

Fortunately, git-rev-list already has the means to cope with this situation with the --stdin switch

 git-rev-parse --not --all | git-rev-list --stdin $newref
Which is exactly what this patch does.
Signed-off-by: Andy Parkins <andyparkins@gmail.com>
---
 templates/hooks--update |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/templates/hooks--update b/templates/hooks--update
index d4253cb..e8c536f 100644
--- a/templates/hooks--update
+++ b/templates/hooks--update
@@ -148,7 +148,7 @@ case "$refname_type" in
 			# This shows all log entries that are not already covered by
 			# another ref - i.e. commits that are now accessible from this
 			# ref that were previously not accessible
-			git-rev-list --pretty $newref $(git-rev-parse --not --all)
+			git-rev-parse --not --all | git-rev-list --stdin --pretty $newref
 			echo $LOGEND
 		else
 			# oldrev is valid
-- 
1.5.0.rc4.364.g85b1
Next: Junio C Hamano
Message 1 of 2 in “Fix potential command line overflow in hooks--update”
  1. 1/3 Fix potential command line overflow in hooks--updateAndy Parkins, Feb 13, 2007
  2. Junio C HamanoFeb 13, 2007

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.