git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Avoid the need of "--" when wildcard pathspec is used

From
Duy Nguyen <pclouds@gmail.com>
Date
Jun 30, 2015, 23:07 UTC
Message-ID
<CACsJy8C0Pz8ZjzW+n=3kT3c+x+CBONUuk27SNMiMsYwCapnVjA@mail.gmail.com>
In-Reply-To
<xmqqk2ulcbj3.fsf@gitster.dls.corp.google.com>
On Wed, Jul 1, 2015 at 1:10 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 11 quoted lines
> Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:
>
>> When "--" is lacking from the command line and a command can take both
>> revs and paths, the idea is if an argument can be seen as both an
>> extended SHA-1 and a path, then "--" is required or git refuses to
>> continue. It's currently implemented as:
>> ...
>
> Hmph, how does this relate to 28fcc0b7 (pathspec: avoid the need of
> "--" when wildcard is used, 2015-05-02)?  A follow-up?  "Oops, I did
> it wrong"?  something else?
Arghhh! I vaguely recalled I sent something but I couldn't find it and..
Show 9 quoted lines
>
>> diff --git a/setup.c b/setup.c
>> index 82c0cc2..f7cb93b 100644
>> --- a/setup.c
>> +++ b/setup.c
>> @@ -143,6 +143,8 @@ int check_filename(const char *prefix, const char *arg)
>>               name = arg + 2;
>>       } else if (!no_wildcard(arg))
>>               return 1;

.. if I looked at the context lines, I should have noticed the change was already here!

>> +     else if (!no_wildcard(arg))
>> +             return 1;
 Seems strange (or expected?) that git cherry-pick just adds this
chunk on top anyway..
> Puzzling.  You already checked if arg has an wildcard and returned
> with 1 if there is none.  The added check looks like a no-op to me.

Yeah sorry for the noise. The only value this patch adds is tests (and maybe better commit message, the last one still mentions magic pathspec even though it's not about it). I think we can just drop this.

-- 
Duy
Previous: Junio C HamanoNext: Nguyễn Thái Ngọc Duy
Message 3 of 5 in “Avoid the need of "--" when wildcard pathspec is used”
  1. Avoid the need of "--" when wildcard pathspec is usedNguyễn Thái Ngọc Duy, Jun 30, 2015
  2. Junio C HamanoJun 30, 2015
  3. Duy NguyenJun 30, 2015
  4. Add tests for wildcard "path vs ref" disambiguationNguyễn Thái Ngọc Duy, Jul 1, 2015
  5. Junio C HamanoJul 1, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.