From: Junio C Hamano <junkio@cox.net>
To: Linus Torvalds <torvalds@osdl.org>
Cc: git@vger.kernel.org
Subject: [PATCH] Audit rev-parse users.
Date: Sun, 17 Jul 2005 01:45:15 -0700 [thread overview]
Message-ID: <7v8y053jok.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <7vmzol29zm.fsf@assigned-by-dhcp.cox.net> (Junio C. Hamano's message of "Sat, 16 Jul 2005 23:59:57 -0700")
This patch changes rev-parse users that pass a single argument
that is supposed to be a rev parameter to use "--verify".
Signed-off-by: Junio C Hamano <junkio@cox.net>
---
*** This does not have anything to do with the --sq flag.
git-checkout-script | 2 +-
git-cherry | 8 ++++----
git-commit-script | 2 +-
git-rebase-script | 8 ++++----
git-resolve-script | 4 ++--
5 files changed, 12 insertions(+), 12 deletions(-)
eee0f165b4762203c0d827bae7480daf41514f17
diff --git a/git-checkout-script b/git-checkout-script
--- a/git-checkout-script
+++ b/git-checkout-script
@@ -22,7 +22,7 @@ while [ "$#" != "0" ]; do
force=1
;;
*)
- rev=$(git-rev-parse --verify --revs-only "$arg^0") || exit
+ rev=$(git-rev-parse --verify "$arg^0") || exit
if [ -z "$rev" ]; then
echo "unknown flag $arg"
exit 1
diff --git a/git-cherry b/git-cherry
--- a/git-cherry
+++ b/git-cherry
@@ -28,11 +28,11 @@ The output is intended to be used as:
'
case "$#" in
-1) linus=`git-rev-parse "$1"` &&
- junio=`git-rev-parse HEAD` || exit
+1) linus=`git-rev-parse --verify "$1"` &&
+ junio=`git-rev-parse --verify HEAD` || exit
;;
-2) linus=`git-rev-parse "$1"` &&
- junio=`git-rev-parse "$2"` || exit
+2) linus=`git-rev-parse --verify "$1"` &&
+ junio=`git-rev-parse --verify "$2"` || exit
;;
*) echo >&2 "$usage"; exit 1 ;;
esac
diff --git a/git-commit-script b/git-commit-script
--- a/git-commit-script
+++ b/git-commit-script
@@ -15,7 +15,7 @@ do
-m) shift
case "$#" in
0) usage ;;
- *) use_commit=`git-rev-parse "$1"` ||
+ *) use_commit=`git-rev-parse --verify "$1"` ||
exit ;;
esac
;;
diff --git a/git-rebase-script b/git-rebase-script
--- a/git-rebase-script
+++ b/git-rebase-script
@@ -11,11 +11,11 @@ upstream tree.'
: ${GIT_DIR=.git}
case "$#" in
-1) linus=`git-rev-parse "$1"` &&
- junio=`git-rev-parse HEAD` || exit
+1) linus=`git-rev-parse --verify "$1"` &&
+ junio=`git-rev-parse --verify HEAD` || exit
;;
-2) linus=`git-rev-parse "$1"` &&
- junio=`git-rev-parse "$2"` || exit
+2) linus=`git-rev-parse --verify "$1"` &&
+ junio=`git-rev-parse --verify "$2"` || exit
;;
*) echo >&2 "$usage"; exit 1 ;;
esac
diff --git a/git-resolve-script b/git-resolve-script
--- a/git-resolve-script
+++ b/git-resolve-script
@@ -6,8 +6,8 @@
#
. git-sh-setup-script || die "Not a git archive"
-head=$(git-rev-parse --revs-only "$1")
-merge=$(git-rev-parse --revs-only "$2")
+head=$(git-rev-parse --verify "$1")
+merge=$(git-rev-parse --verify "$2")
merge_msg="$3"
dropheads() {
next prev parent reply other threads:[~2005-07-17 8:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-07-17 6:59 [RFC/PATCH] git-rev-parse vs IFS Junio C Hamano
2005-07-17 8:06 ` [PATCH] rev-parse --sq bugfixes Junio C Hamano
2005-07-18 17:27 ` [PATCH] Help scripts that use git-rev-parse to grok args with SP/TAB/LF Junio C Hamano
2005-07-17 8:45 ` 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-08-15 9:55 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=7v8y053jok.fsf@assigned-by-dhcp.cox.net \
--to=junkio@cox.net \
--cc=git@vger.kernel.org \
--cc=torvalds@osdl.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