git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Parkins <andyparkins@gmail.com>
To: git@vger.kernel.org
Subject: [PATCH 1/3] Fix potential command line overflow in hooks--update
Date: Tue, 13 Feb 2007 14:23:58 +0000	[thread overview]
Message-ID: <200702131423.58561.andyparkins@gmail.com> (raw)

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

             reply	other threads:[~2007-02-13 14:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-13 14:23 Andy Parkins [this message]
2007-02-13 18:03 ` [PATCH 1/3] Fix potential command line overflow in hooks--update Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200702131423.58561.andyparkins@gmail.com \
    --to=andyparkins@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).