Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: git@vger.kernel.org
Subject: [PATCH] Audit rev-parse users.
Date: Mon, 15 Aug 2005 02:55:23 -0700	[thread overview]
Message-ID: <7vacjj1q44.fsf@assigned-by-dhcp.cox.net> (raw)

Make sure that we say --verify when we want to get a single SHA1
name.  Also when we say --verify, --revs-only is redundant.

Signed-off-by: Junio C Hamano <junkio@cox.net>
---

 git-rebase-script |    2 +-
 git-reset-script  |    4 ++--
 git-tag-script    |    2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

fb1dea6f0298f4b47ae6a3dc08a1bc2398ef8053
diff --git a/git-rebase-script b/git-rebase-script
--- a/git-rebase-script
+++ b/git-rebase-script
@@ -28,7 +28,7 @@ case "$#" in
 esac
 
 git-read-tree -m -u $ours $upstream &&
-echo "$upstream" >"$GIT_DIR/HEAD" || exit
+git-rev-parse --verify "$upstream^0" >"$GIT_DIR/HEAD" || exit
 
 tmp=.rebase-tmp$$
 fail=$tmp-fail
diff --git a/git-reset-script b/git-reset-script
--- a/git-reset-script
+++ b/git-reset-script
@@ -1,7 +1,7 @@
 #!/bin/sh
 . git-sh-setup-script || die "Not a git archive"
-rev=$(git-rev-parse --revs-only --verify --default HEAD "$@") || exit
-rev=$(git-rev-parse --revs-only --verify $rev^0) || exit
+rev=$(git-rev-parse --verify --default HEAD "$@") || exit
+rev=$(git-rev-parse --verify $rev^0) || exit
 git-read-tree --reset "$rev" && {
 	if orig=$(git-rev-parse --verify HEAD 2>/dev/null)
 	then
diff --git a/git-tag-script b/git-tag-script
--- a/git-tag-script
+++ b/git-tag-script
@@ -47,7 +47,7 @@ if [ -e "$GIT_DIR/refs/tags/$name" -a -z
 fi
 shift
 
-object=$(git-rev-parse --verify --revs-only --default HEAD "$@") || exit 1
+object=$(git-rev-parse --verify --default HEAD "$@") || exit 1
 type=$(git-cat-file -t $object) || exit 1
 tagger=$(git-var GIT_COMMITTER_IDENT) || exit 1
 

             reply	other threads:[~2005-08-15  9:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-15  9:55 Junio C Hamano [this message]
  -- strict thread matches above, loose matches on Subject: below --
2005-07-23  2:09 [PATCH] Audit rev-parse users Junio C Hamano
2005-07-17  6:59 [RFC/PATCH] git-rev-parse vs IFS Junio C Hamano
2005-07-17  8:45 ` [PATCH] Audit rev-parse users 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=7vacjj1q44.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --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