git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: Linus Torvalds <torvalds@osdl.org>
Cc: git@vger.kernel.org
Subject: Re: Fix git-rev-parse breakage
Date: Wed, 24 Aug 2005 11:52:43 -0700	[thread overview]
Message-ID: <7v4q9fdv5w.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <Pine.LNX.4.58.0508231908170.3317@g5.osdl.org> (Linus Torvalds's message of "Tue, 23 Aug 2005 19:17:37 -0700 (PDT)")

Linus Torvalds <torvalds@osdl.org> writes:

> The --flags cleanup caused problems: we used to depend on the fact that 
> "revs_only" magically suppressed flags, adn that assumption was broken by 
> the recent fixes.
>
> It wasn't a good assumption in the first place, so instead of 
> re-introducing it, let's just get rid of it.
>
> This makes "--revs-only" imply "--no-flags".

I was taking a look at this once again after noticing that I
haven't taking any action on it.  But now I am a bit confused
reading the above.  The first two paragraphs tells me
"--revs-only implied --no-flags and we used to depend on it, but
that is not a right thing so get rid of that assumption" (which
I agree is a good change", and the last sentense says
opposite...

And the code makes --revs-only imply --no-flags.

Here is my thinking, requesting for a sanity check.

* git-whatchanged wants to use it to tell rev-list arguments
  from rev-tree arguments.  You _do_ want to pick --max-count=10
  or --merge-order in this case, and --revs-only implying
  --no-flags would make this impossible.

* git-log-script uses it once to make sure it has one commit to
  start at, and lacks --no-flags by mistake.

* git-bisect uses it to validate the parameter is a valid ref,
  but does not use --verify.

This trivial patch fixes the latter two.

---
diff --git a/git-log-script b/git-log-script
--- a/git-log-script
+++ b/git-log-script
@@ -1,4 +1,4 @@
 #!/bin/sh
-revs=$(git-rev-parse --revs-only --default HEAD "$@") || exit
+revs=$(git-rev-parse --revs-only --no-flags --default HEAD "$@") || exit
 [ "$revs" ] || die "No HEAD ref"
 git-rev-list --pretty $(git-rev-parse --default HEAD "$@") | LESS=-S ${PAGER:-less}

diff --git a/git-bisect-script b/git-bisect-script
--- a/git-bisect-script
+++ b/git-bisect-script
@@ -67,7 +67,7 @@ bisect_good() {
 	bisect_autostart
         case "$#" in
 	0)    revs=$(git-rev-parse --verify HEAD) || exit ;;
-	*)    revs=$(git-rev-parse --revs-only "$@") || exit ;;
+	*)    revs=$(git-rev-parse --revs-only --verify "$@") || exit ;;
 	esac
 	for rev in $revs
 	do

  parent reply	other threads:[~2005-08-24 18:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-24  2:17 Fix git-rev-parse breakage Linus Torvalds
2005-08-24  3:22 ` Junio C Hamano
2005-08-24 18:52 ` Junio C Hamano [this message]
2005-08-24 19:03   ` Linus Torvalds
2005-08-24 21:34     ` [PATCH] Audit rev-parse users again Junio C Hamano
2005-08-24 21:40     ` [PATCH] Rationalize output selection in rev-parse 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=7v4q9fdv5w.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;
as well as URLs for NNTP newsgroup(s).