From: Jeff King <peff@peff.net>
To: Kristoffer Haugsbakk <kristofferhaugsbakk@fastmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 2/2] revision: handle argv movement in parse_revision_opt()
Date: Sun, 27 Sep 2026 23:25:53 -0400 [thread overview]
Message-ID: <20260928032553.GA493672@coredump.intra.peff.net> (raw)
In-Reply-To: <add1abaa-5d51-43dc-9907-d6d3851004f5@app.fastmail.com>
On Sat, Sep 26, 2026 at 11:00:05AM +0200, Kristoffer Haugsbakk wrote:
> > Reported-by: Kristoffer Haugsbakk <kristofferhaugsbakk@fastmail.com>
>
> I personally prefer the email that I use for commits:
>
> <code@khaugsbakk.name>
>
> (Which has always been the case. But I didn’t want to disrupt the
> process previously.)
OK. I pulled it from your From header, of course. :)
> I ought to send in a `.mailmap` change with my canonical email address.
We don't mailmap trailers, though. I have a patch to let you do so with
%(trailers:mailmap), but you'd still see the original most of the time
(since git-log, etc, just dump the raw contents and expect the trailers
to be readable).
> > +test_expect_success 'unknown revision options are reported correctly' '
> > + test_must_fail git shortlog -n --no-such-option 2>err &&
> > + test_grep "unknown option .*--no-such-option" err
> > +'
>
> Just thinking this through. This is a regression test indirectly related
> to git-shortlog(1). So the test does not name `shortlog`, so that’s good.
> The subtlety of the previously discussed:
>
> Making things even more confusing, it only happens if there's
> another option before the unknown one!
>
> is not obvious from the test description, but one can surmise that it is
> needed since it’s there in the first place.
Yeah. I sort of assume that anybody wondering about the details of a
line of code in this project will be able to dig around with blame or
pickaxe. Perhaps a comment could help, but I think anything beyond "it
is important that there are two options here" would end up re-hashing
the whole explanation in the commit message.
> For the next readers of this test suite that come along, it might seem
> strange that this specific sequence is tested for, and on a shortlog
> test suite. But it seems normal in this project to add tests that, in
> the context of the file alone, might not be obvious why they are there
> (because they are regression tests for very specific bugs). I could
> imagine some system where regression tests are marked with some
> identifier that however indirectly links back to whatever triggered the
> fix. But for one, this would be a new system/convention and wouldn’t
> make sense to use on just one test. And second, this would just make it
> more directly accessible; it is still directly accessible for people who
> know how to query git(1). Well, maybe more indirectly as time goes on if
> the test is changed and you use the “pickaxe” technique.
Yeah, exactly. Both patches are really bugs in the revision /
parse-options integration function that just happens to be triggerable
by shortlog. Possibly something like t0040 would make sense, but it
feels weird to be sticking a shortlog invocation there. I dunno. Again,
I sort of rely on people to find the relevant commits.
> This is all to say that this test makes sense as it is written now.
Thanks!
-Peff
next prev parent reply other threads:[~2026-09-28 3:26 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-25 0:28 [BUG] revision: premature free-and-null causes “unknown option `(null)`” Kristoffer Haugsbakk
2026-09-25 8:26 ` Jeff King
2026-09-25 20:33 ` [PATCH 0/2] some parse_revision_opt() bugfixes Jeff King
2026-09-25 20:35 ` [PATCH 1/2] revision: avoid reporting known options as unknown on error Jeff King
2026-09-25 20:39 ` [PATCH 2/2] revision: handle argv movement in parse_revision_opt() Jeff King
2026-09-26 9:00 ` Kristoffer Haugsbakk
2026-09-28 3:25 ` Jeff King [this message]
2026-09-29 7:43 ` Kristoffer Haugsbakk
2026-09-25 22:23 ` [PATCH 0/2] some parse_revision_opt() bugfixes 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=20260928032553.GA493672@coredump.intra.peff.net \
--to=peff@peff.net \
--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