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

Re: [PATCH 1/2] glossary-content.txt: remove an obsolete paragrah

From
Duy Nguyen <pclouds@gmail.com>
Date
Nov 22, 2013, 01:36 UTC
Message-ID
<CACsJy8C38PUCYMSdEJ1-S5HSNdJO7S24mhkEryFrSGfwKuaU0A@mail.gmail.com>
In-Reply-To
<xmqqy54h1f9q.fsf@gitster.dls.corp.google.com>
On Fri, Nov 22, 2013 at 6:55 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 39 quoted lines
> Junio C Hamano <gitster@pobox.com> writes:
>
> An addendum.
>
>> As we can see in a later paragaph:
>>
>>     The "magic signature" consists of an ASCII symbol that is not
>>     alphanumeric. Currently only the slash `/` is recognized as a
>>     "magic signature"...
>>
>> the correct way to read that "a character that cannot be a magic
>> signature" is "a character that is not 'an ASCII symbol that is not
>> alphanumeric'", which means you can do:
>>
>>       :!/foo  - with magic signatures ! and /, pattern begins at 'f'
>>
>>       :/#abc  - with magic signatures # and /, pattern begins at 'a',
>>                 even if in a particular version of Git, '#' magic
>>                 signature may be invalid and produce an error
>>
>>       :/:#abc - with magic signature /, pattern is "#abc".
>>
>> but because the definition of "magic signature" syntax comes later
>> than "cannot be", it is prone to be misinterpreted as "anything that
>> is not currently defined as a magic signature (namely, '/')".
>
> ... and that misinterpretation may give a false impression that
>
>         ":/#abc"
>
> is with the magic signature '/' (i.e. match from top) for a pattern
> "#abc".
>
> Doing so would mean that a version of Git that does not support a
> magic signature '#' will allow people and scripts to use ":/#abc"
> with such a meaning, and will prevent us from using '#' as a new
> magic signature with some useful meaning in the future.  Rather, we
> need to force them to always spell it as ":/:#abc" even in the
> version of Git before the magic signature '#'.
Current version does force that.

$ git log -- ':/#aa' fatal: Unimplemented pathspec magic '#' in ':/#aa'

Not sure if there are tests for it though. I'll add an advice to do ":/:#aa".
> And the phrasing 'if the pattern begins with a character that cannot
> be a "magic signature" and is not a colon' needs to be clarified to
> avoid that misinterpretation for that reason.
-- 
Duy
Previous: Junio C HamanoNext: Junio C Hamano
Message 7 of 8 in “diff: restrict pathspec limitations to diff b/f case only”
  1. diff: restrict pathspec limitations to diff b/f case onlyNguyễn Thái Ngọc Duy, Nov 20, 2013
  2. Junio C HamanoNov 20, 2013
  3. 1/2 glossary-content.txt: remove an obsolete paragrahNguyễn Thái Ngọc Duy, Nov 21, 2013
  4. 2/2 glossary-content.txt: fix documentation of "**" patternsNguyễn Thái Ngọc Duy, Nov 21, 2013
  5. Junio C HamanoNov 21, 2013
  6. Junio C HamanoNov 21, 2013
  7. Duy NguyenNov 22, 2013
  8. Junio C HamanoNov 22, 2013

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.