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

Re: [PATCH 0/2] [RFD] Using gitrevisions :/search style with other operators

From
Jakub Narebski <jnareb@gmail.com>
Date
Dec 9, 2010, 01:54 UTC
Message-ID
<201012090254.24999.jnareb@gmail.com>
In-Reply-To
<AANLkTimU6Bhx-2XsZ45_7BmT9fo9MpK8TJWB3zZ=j-i7@mail.gmail.com>
Nguyen Thai Ngoc Duy wrote:
Show 31 quoted lines
> On Thu, Dec 9, 2010 at 2:51 AM, Jakub Narebski <jnareb@gmail.com> wrote:
>> Dnia środa 8. grudnia 2010 19:06, Jonathan Nieder napisał:
>>> Nguyễn Thái Ngọc Duy wrote:
>>>
>>>> Let's start off from where the previous discussion [1] stopped. People
>>>> seem to agree ref^{/regex} is a good choice. But we have not come to
>>>> conclusion how to specify the count yet. Possible suggestions are
>>>>
>>>>  - ref^{/foo}2
>>>>  - ref^{2/foo}
>>>>  - ref^{:2/foo}
>>>>  - ref^{2nd/foo}
>>>
>>> How about
>>>
>>>       ref^{/foo}^^{/foo}
>>>
>>> ?
>>
>> I'll assume that there is invisible ";)" emoticon here.
>>
>>
>> First, it would be ref^{/foo}^@^{/foo}, otherwise you would follow only
>> first parent.
>>
>> Second, consider ref^{:nth(10)/foo} in your workaround...
> 
> Maybe we should generalize this to apply to all operators. Currently
> foo~3 is expanded to foo^^^. How about ~~X (or xN) denote repeat the
> last operator N times? For example, HEAD^2x3 => HEAD^2^2^2,
> HEAD^{/foo}x3 => HEAD^{/foo}^{/foo}^{/foo}.

Unless you allow grouping, it wouldn't help in the case of ^{/foo}, because ^{/foo} is idempotent. HEAD^{/foo} finds first commit that contains "foo", and HEAD^{/foo}^{/foo} finds first commit containing "foo" starting from *and including* first commit from HEAD containing "foo" - which is HEAD^{/foo}

  HEAD^{/foo}^{/foo} === HEAD^{/foo}

You would need HEAD{^{/foo}^@}x3, or use special rule that HEAD^{/foo}x2 means really HEAD^{/foo}^@^{/foo}, with ^@ used to join them.

-- 
Jakub Narebski
Poland
Previous: Nguyen Thai Ngoc DuyNext: Jonathan Nieder
Message 9 of 32 in “[RFD] Using gitrevisions :/search style with other operators”
  1. 0/2 [RFD] Using gitrevisions :/search style with other operatorsNguyễn Thái Ngọc Duy, Dec 8, 2010
  2. 1/2 get_sha1_oneline: allow to input commit_listNguyễn Thái Ngọc Duy, Dec 8, 2010
  3. Thiago FarinaDec 8, 2010
  4. 2/2 get_sha1: support ref^{/regex} syntaxNguyễn Thái Ngọc Duy, Dec 8, 2010
  5. Junio C HamanoDec 8, 2010
  6. Jonathan NiederDec 8, 2010
  7. Jakub NarebskiDec 8, 2010
  8. Nguyen Thai Ngoc DuyDec 9, 2010
  9. Jakub NarebskiDec 9, 2010
  10. Jonathan NiederDec 9, 2010
  11. Kevin BallardDec 9, 2010
  12. Nguyen Thai Ngoc DuyDec 9, 2010
  13. Jonathan NiederDec 9, 2010
  14. Junio C HamanoDec 9, 2010
  15. Jakub NarebskiDec 9, 2010
  16. Nguyen Thai Ngoc DuyDec 10, 2010
  17. Jonathan NiederDec 10, 2010
  18. Jakub NarebskiDec 10, 2010
  19. Kevin BallardDec 10, 2010
  20. Jeff KingDec 10, 2010
  21. Junio C HamanoDec 10, 2010
  22. Kevin BallardDec 10, 2010
  23. Junio C HamanoDec 10, 2010
  24. Junio C HamanoDec 9, 2010
  25. Jakub NarebskiDec 8, 2010
  26. Jonathan NiederDec 8, 2010
  27. Nguyen Thai Ngoc DuyDec 9, 2010
  28. Jakub NarebskiDec 9, 2010
  29. Nguyen Thai Ngoc DuyDec 9, 2010
  30. Kevin BallardDec 9, 2010
  31. Jakub NarebskiDec 9, 2010
  32. Nguyen Thai Ngoc DuyDec 9, 2010

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.