git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Kristoffer Haugsbakk" <kristofferhaugsbakk@fastmail.com>
Cc: squeaky <334eevw4vj@liamekaens.com>,  git@vger.kernel.org
Subject: Re: git rev-list --no-walk RANGE not working as documented
Date: Wed, 02 Oct 2024 12:18:19 -0700	[thread overview]
Message-ID: <xmqqzfnml3es.fsf@gitster.g> (raw)
In-Reply-To: <7fddacf9-55f6-4520-a288-279d3784badb@app.fastmail.com> (Kristoffer Haugsbakk's message of "Tue, 01 Oct 2024 17:04:15 +0200")

"Kristoffer Haugsbakk" <kristofferhaugsbakk@fastmail.com> writes:

> Hi, I get different results based on the order:
>
>     git rev-list HERE..THERE --no-walk
>
> This (like you say) only outputs “there”.
>
> But this one outputs several:
>
>     git rev-list --no-walk HERE..THERE

Thanks, Kristoffer, for looking at the report.

The subject line says "rev-list --no-walk RANGE", but that command
line works as documented.  The real complaint in the report is about
"rev-list RANGE --no-walk".  This thread is titled incorrectly.

In this particular case, because HERE..THERE implies "--walk" (and
that is how "git show A" and "git show A..B" behave the way users
are used to.  "git show" itself behaves as if it has an implicit
"--no-walk" at the beginning, and later "--walk" overrides it), it
is understandable that

    rev-list --no-walk HERE..THERE

walks (following the usual "last one wins" rule, allowing the later
implicit "--walk" to override "--no-walk"), while

    rev-list HERE..THERE --no-walk

does not walk (again, following the usual "last one wins" rule,
the implicit "--walk" given by HERE..THERE gets overriden by an
explicit "--no-walk" that comes later).

But in general, the documentation assumes that the user follows the
usual command-line convention used throughout Git (see git help
cli---dashed options come before revs and paths).  The command line
parser still accepts command line arguments in non-canonical order
(i.e. revs are given and then an option, in the problematic example
in this thread) without complaining, but this is done primarily to
cater to old timers, those who expect the commands to keep behaving
the way they happened to behave, which may or may not appear "sane"
to untrained eyes ;-).

Thanks.

      reply	other threads:[~2024-10-02 19:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-20 23:54 git rev-list --no-walk RANGE not working as documented squeaky
2024-10-01 15:04 ` Kristoffer Haugsbakk
2024-10-02 19:18   ` Junio C Hamano [this message]

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=xmqqzfnml3es.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=334eevw4vj@liamekaens.com \
    --cc=git@vger.kernel.org \
    --cc=kristofferhaugsbakk@fastmail.com \
    /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).