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

Re: [PATCH 1/2] test for '!' handling in rev-parse's named commits

From
Will Palmer <wmpalmer@gmail.com>
Date
Jun 3, 2015, 22:44 UTC
Message-ID
<CAAKF_uYrjBsVY8YOmRtMU8jB5rA57r+-N_KboqwWL3YRRqeKAg@mail.gmail.com>
In-Reply-To
<xmqqbngwwjbd.fsf@gitster.dls.corp.google.com>
On Wed, Jun 3, 2015 at 10:52 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 7 quoted lines
> The /! sequence being reserved does not mean it was planned to be
> used only for a single thing in the future, though.
>
> (snip)
>
> cf. http://thread.gmane.org/gmane.comp.version-control.git/40460/focus=40477
>
Thank you for that additional context, which I didn't see previously.
Show 13 quoted lines
> Using "/!Message" to match commits that do not match Message
> directly goes against that extensivility design.
>
> We need to always remind ourselves that our latest shiny new toy
> will not be the final new feature.  There always will be need to add
> yet another new thing, and we need to keep the door open for them.
>
> Perhaps
>
>         /!-string       -> find commit without "string"
>
> or something?
>

What I'm thinking now is that "@^{/foo}" can be thought of as a potential "shorthand-form" of what could be "@^{/!(m=foo)}", in which case "@^{/!-foo}" could similarly be thought of as a potential shorthand-form of what could be "@^{/!(m-foo)}".

So with that in mind, I agree that a syntax of "@^{/!-foo}" could indeed give me the results I'm looking for, while leaving room for the previously mentioned forms of future extension.

I don't know if I consider those potential extensions to be commendable as a unified (and chain-able) syntax for finding revisions in the graph, or to be needless clutter which would only add "yet another way to specify the same thing". I mean, I like the idea of being able to specify that I want "The third parent of the first commit authored by Fred which is also an ancestor of a commit which touched a file in the libraries subdirectory", it sounds like maybe it would be good to be able to do that sort of thing without bringing xargs and shell expansion into the picture... but I certainly don't have a clue what it might be good for!

In any case, it sounds like we have a good way forward for this smaller change, at least. I'll re-submit with the suggested syntax.

Previous: Junio C HamanoNext: Junio C Hamano
Message 4 of 7 in “specify commit by negative pattern”
  1. 0/2 specify commit by negative patternWill Palmer, Jun 3, 2015
  2. 1/2 test for '!' handling in rev-parse's named commitsWill Palmer, Jun 3, 2015
  3. Junio C HamanoJun 3, 2015
  4. Will PalmerJun 3, 2015
  5. Junio C HamanoJun 4, 2015
  6. Junio C HamanoJun 3, 2015
  7. 2/2 object name: introduce '^{/!<negative pattern>}' notationWill Palmer, Jun 3, 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.