From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: Bryan Turner <bturner@atlassian.com>, Git Users <git@vger.kernel.org>
Subject: Re: [PATCH] revision: set rev_input_given in handle_revision_arg()
Date: Wed, 26 Aug 2020 13:20:09 -0700 [thread overview]
Message-ID: <xmqqa6yhupl2.fsf@gitster.c.googlers.com> (raw)
In-Reply-To: <20200826201305.GA1595824@coredump.intra.peff.net> (Jeff King's message of "Wed, 26 Aug 2020 16:13:05 -0400")
Jeff King <peff@peff.net> writes:
> Subject: [PATCH] revision: set rev_input_given in handle_revision_arg()
>
> Commit 7ba826290a (revision: add rev_input_given flag, 2017-08-02) added
> a flag to rev_info to tell whether we got any revision arguments. As
> explained there, this is necessary because some revision arguments may
> not produce any pending traversal objects, but should still inhibit
> default behaviors (e.g., a glob that matches nothing).
Ah, that explains the symptom under discussion quite well; the topic
that introduced the commit was to fix "git log --tag=no-such-tag"
that used to default to HEAD. We should be able to reuse the same
mechanism to prevent --stdin codepath from falling back to HEAD, of
course.
> However, it only set the flag in the globbing code, but not for
> revisions we get on the command-line or via stdin. This leads to two
> problems:
>
> - the command-line code keeps its own separate got_rev_arg flag; this
> isn't wrong, but it's confusing and an extra maintenance burden
>
> - even specifically-named rev arguments might end up not adding any
> pending objects: if --ignore-missing is set, then specifying a
> missing object is a noop rather than an error.
Yup, nicely described.
> diff --git a/revision.c b/revision.c
> index 96630e3186..08c2ad23af 100644
> --- a/revision.c
> +++ b/revision.c
The patch of course looks straightforward and good. Thanks.
prev parent reply other threads:[~2020-08-26 20:20 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-25 19:16 Mismatched HEAD default behavior from git log Bryan Turner
2020-08-25 19:40 ` Junio C Hamano
2020-08-25 19:46 ` Jeff King
2020-08-25 19:51 ` Junio C Hamano
2020-08-25 19:55 ` Jeff King
2020-08-26 20:13 ` [PATCH] revision: set rev_input_given in handle_revision_arg() Jeff King
2020-08-26 20:20 ` 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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqa6yhupl2.fsf@gitster.c.googlers.com \
--to=gitster@pobox.com \
--cc=bturner@atlassian.com \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
/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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).