From: Junio C Hamano <gitster@pobox•com>
To: Nguyen Thai Ngoc Duy <pclouds@gmail•com>
Cc: Ryan McCue <lists@rotorised•com>, git@vger•kernel.org
Subject: Re: ls-tree and wildcards
Date: Tue, 15 May 2012 08:35:23 -0700 [thread overview]
Message-ID: <7vd365foec.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <CACsJy8AdoOcUxq+pmhAPxiPAiQc60aCLf7Jt31YFW4+6OHZEEg@mail.gmail.com> (Nguyen Thai Ngoc Duy's message of "Tue, 15 May 2012 18:29:53 +0700")
Nguyen Thai Ngoc Duy <pclouds@gmail•com> writes:
> On Mon, May 14, 2012 at 11:43 PM, Junio C Hamano <gitster@pobox•com> wrote:
>> Later Nguyen and others started working on unifying the two separate
>> "pathspec" semantics and we are probably halfway there. Many of the
>> commands from "diff/log" family now can take wildcard (there may be new
>> bugs in the codepaths, though), but "ls-tree" has not been converted.
>
> Do we break backward compatibility by teaching ls-tree new pathspec
> semantics? I guess directories with wildcards in the name are rare,
> the chance of someone doing "ls-tree a*" is low. But I may miss
> something.
If you change ls-tree to use its paths arguments as pathspec, you will
break backward compatibility.
But nobody stops us from _adding_ an option to ls-tree to tell it to
switch between the two, i.e.
git ls-tree HEAD -- '*.c'
git ls-tree --pathspec HEAD -- '*.c'
The former will use the traditional "leading path match only" while the
latter uses the (to-be) unified "pathspec" semantics.
Internally, the implementation could very well do something like this
after parsing the options:
if (!opt_pathspec)
prefix ":(noglob)" to all paths args
and use the updated code with magic pathspec support to handle both cases.
prev parent reply other threads:[~2012-05-15 15:35 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-12 15:07 ls-tree and wildcards Ryan McCue
2012-05-12 15:40 ` Nguyen Thai Ngoc Duy
2012-05-12 15:46 ` Ryan McCue
2012-05-14 16:43 ` Junio C Hamano
2012-05-15 11:29 ` Nguyen Thai Ngoc Duy
2012-05-15 15:35 ` 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=7vd365foec.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox$(echo .)com \
--cc=git@vger$(echo .)kernel.org \
--cc=lists@rotorised$(echo .)com \
--cc=pclouds@gmail$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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