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

Re: Specifying revisions in the future

From
Philip Oakley <philipoakley@iee.org>
Date
Feb 5, 2012, 22:49 UTC
Message-ID
<178AA8FDB02246D9AA9416C0D54E51A8@PhilipOakley>
In-Reply-To
<201202052324.59941.jnareb@gmail.com>
From: "Jakub Narebski" <jnareb@gmail.com>
To: "Andreas Schwab" <schwab@linux-m68k.org>
Cc: "Matthieu Moy" <Matthieu.Moy@grenoble-inp.fr>; <jpaugh@gmx.us>; 
<git@vger.kernel.org>
Sent: Sunday, February 05, 2012 10:24 PM
Show 47 quoted lines
> On Sun, 5 Feb 2012, Andreas Schwab wrote:
>> Jakub Narebski <jnareb@gmail.com> writes:
>>> Andreas Schwab <schwab@linux-m68k.org> writes:
>>>> Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:
>>>>
>>>>> "the successor of <commit>", OTOH, is not well defined, since there 
>>>>> can
>>>>> be several successors, and one can't order them reliably (you can't
>>>>> really know the set of successors, because they can exist in different
>>>>> repositories).
>>>>
>>>> Yet it would be nice to have a concise notation for "the nth successor
>>>> of <commit> towards <commit>" (using --first-parent ordering when
>>>> ambiguous).
>>>
>>> First, "the nth successor"... from which refs?
>>
>> From the first given commit towards the other given commit (the latter
>> defaulting to HEAD).
>
> That helps some, but not all situations, see below.
>
>> > Second, `--first-parent' won't help here.  Take for example the
>> > following situation:
>> >
>> >    ---X<---*<---.<---A
>> >             \
>> >              \--.<---B
>> >
>> > X+3 is A or B?
>>
>> If "towards A" then it is A, if "towards B", it is B.  In other words,
>> to get the "nth successor of C1 towards C2" take the leftmost possible
>> parent when walking from C2 to C1, then walk back n commits along this
>> path.  This way you should have an unambigous definition.
>
> Nope, still ambiguous:
>
>
>
>  ---X<---*<---.<---A<---.<---M<---
>           \                 /
>            \--.<---B<------/
>
> Is X+3 A or B?  Though '--first-parent + towards N' is I think 
> unambiguous.
> -- 
Is there also a rule missing for X+2, viewed from D, in this example
X<---Y<---Z<---
          \          \
A<----B<----C<----D
as to which order the first parent rule should _not_ be applied when D's 
first parent chain doesn't reach X (it reaches A).
Using 'oldest' first for alternate parent testing would make X+2 = B, whilst 
'newest' first would make X+2=Z. I have used the chain order for 
'newest/oldest', rather than commit date.
(I'm sure that there already exists a natural rule in the dag walk order).
Philip 
Previous: Jakub NarebskiNext: Andreas Schwab
Message 8 of 16 in “Specifying revisions in the future”
  1. jpaugh@gmx.usFeb 4, 2012
  2. Jakub NarebskiFeb 5, 2012
  3. Matthieu MoyFeb 5, 2012
  4. Andreas SchwabFeb 5, 2012
  5. Jakub NarebskiFeb 5, 2012
  6. Andreas SchwabFeb 5, 2012
  7. Jakub NarebskiFeb 5, 2012
  8. Philip OakleyFeb 5, 2012
  9. Andreas SchwabFeb 5, 2012
  10. Miles BaderFeb 6, 2012
  11. Jonathan PaughFeb 7, 2012
  12. Matthieu MoyFeb 6, 2012
  13. Andreas SchwabFeb 6, 2012
  14. Andreas SchwabFeb 5, 2012
  15. Junio C HamanoFeb 5, 2012
  16. Jakub NarebskiFeb 5, 2012

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.