Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: Steven Willis via GitGitGadget <gitgitgadget@gmail.com>,
	git@vger.kernel.org, Steven Willis <onlynone@gmail.com>
Subject: Re: [PATCH] doc: ls-tree paths do not support wildcards
Date: Thu, 28 May 2020 16:17:27 -0700	[thread overview]
Message-ID: <xmqqk10v1wfs.fsf@gitster.c.googlers.com> (raw)
In-Reply-To: <20200528230454.GA1267915@coredump.intra.peff.net> (Jeff King's message of "Thu, 28 May 2020 19:04:54 -0400")

Jeff King <peff@peff.net> writes:

> On Thu, May 28, 2020 at 03:21:34PM -0700, Junio C Hamano wrote:
>
>> >   1. Deprecate the current behavior in the documentation and release
>> >      notes, encouraging people who want literal matching to use
>> >      --literal-pathspecs or the ":(literal)" magic. AFAICT we've
>> >      supported these since at least 2013 for this command, so it should
>> >      be safe to use unconditionally.
>> >
>> >   2. Add a new option, "--use-pathspecs" or similar, that switches the
>> >      matching code to use match_pathspec(). That lets people use the new
>> >      feature immediately if they want to.
>> >
>> >   3. When --use-pathspecs is not in use, warn to stderr about any
>> >      wildcard characters in the input. That reinforces the deprecation
>> >      notice in (1) and is likely to get more people's attention.
>> 
>> Hmph, if we are serious about deprecation and migration, I would
>> image that in stage #1, we should do this check already.  When
>> "--literal-pathspecs" is NOT in use, if a pathspec would change its
>> meaning if not taken literally (e.g. has glob letters, begins with
>> :-magic introducer, etc.), we warn and do so from the very beginning
>> of the migration process.
>
> Yeah, sorry, I meant these three steps to all happen at once.
>
> Technically we don't need step (2) in there for the deprecation, but I
> think it lets people adjust to the new world order as their solution to
> avoid the warning (though I guess literal-pathspecs would also prevent
> the warning; we wouldn't be looking for "*" in the input so much as
> checking whether the parsed pathspec contains a wildcard).

I do agree that letting early adopters experiemtn is a great and
necessary step.  And I think I misread the condition you wrote in
your 3.; I do agree that we should warn when --use-pathspecs is not
in use, but if --literal-pathspecs is in use, then the user wants
to match literally even when the pattern has globs and :-magic
introducer sequence, so we shouldn't warn.

Thanks.

  reply	other threads:[~2020-05-28 23:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-28 21:23 [PATCH] doc: ls-tree paths do not support wildcards Steven Willis via GitGitGadget
2020-05-28 21:51 ` Jeff King
2020-05-28 22:21   ` Junio C Hamano
2020-05-28 23:04     ` Jeff King
2020-05-28 23:17       ` Junio C Hamano [this message]
2020-05-28 22:04 ` Junio C Hamano
2020-05-28 23:16   ` Jeff King

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=xmqqk10v1wfs.fsf@gitster.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=onlynone@gmail.com \
    --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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox