git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Rast <trast@student.ethz.ch>
To: Junio C Hamano <gitster@pobox.com>
Cc: Michael Haggerty <mhagger@alum.mit.edu>,
	Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>,
	<git@vger.kernel.org>
Subject: Re: [PATCH v2] rev-list docs: clarify --topo-order description
Date: Fri, 17 Aug 2012 19:37:36 +0200	[thread overview]
Message-ID: <87obm9a07z.fsf@thomas.inf.ethz.ch> (raw)
In-Reply-To: <7v1uj5wi72.fsf@alter.siamese.dyndns.org> (Junio C. Hamano's message of "Fri, 17 Aug 2012 10:18:25 -0700")

Junio C Hamano <gitster@pobox.com> writes:

> Thomas Rast <trast@inf.ethz.ch> writes:
>
>> However, suppose we knew generation numbers.  I haven't actually looked
>> into the old threads again, but my understanding was that they are
>> numbers g(C) attached to each commit C such that
>>
>>   g(C) = 1 + max(g(P) for P a parent of C)   for non-root commits
>>
>>   g(C) = 0                                   for root commits
>>
>> They are invariant given the commit, so they can be cached.
>> ...
>> I hope I got that right.  The order of commits is still entirely
>> determined by the choice of "any tentative source", but the algorithm
>> should now stream nicely once the generation numbers are known.
>
> That matches the definition of generation number I remember from the
> old discussion.  Now look at the illustration in this discussion
> again:
>
>       ---A---B---C---D
>                       \
>     ---1---2---3---4---* = HEAD
[...]
> The numbered commits 1 2 3 4 are building on top of recent "master",
> while alphabetized A B C D are building on aged maintenance track.
> The difference in generation numbers between 1 and 2, 2 and 3,... A
> and B, B and C, C and D are all one, and HEAD (the tip of 'pu') would
> have generation number of commit 4 plus 1, as commit 4's generation
> number would be a thousand or more ahead of that of commit D.  And
> there are a thousand ancestors of '1' with larger generation numbers
> than 'D'.
>
> When the user runs "git log" (i.e. the casual "the last few commit"
> macthes), the expectation of the user is "I want to see what I did
> recently".  If you substituted the commit timestamp with such a
> generation number, how would that expectation satisified?

Umm, have you looked at the algorithm I proposed?

It does not substitute the generation numbers for anything, let alone
the date.  It merely uses them to determine a point where it knows
"enough" of the history to be able to emit the next commit; that is,
where it can use the generation numbers to prove that no unknown commit
can be a descendant of what it wants to emit next.

It does *not* have to use the generation numbers in the final ordering
of the commits.  That final order is determined by how the algorithm
chooses the next candidate commit.  If you use a stack, it winds up
being --topo-order.  If you use a date-ordered priority queue, it
becomes --date-order.

So really, this is only about modifying the algorithm that generates the
existing order to allow for streaming output as it reads through
history.

-- 
Thomas Rast
trast@{inf,student}.ethz.ch

  reply	other threads:[~2012-08-17 17:37 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-13 22:21 [PATCH] rev-list docs: clarify --topo-order description Junio C Hamano
2012-08-13 22:46 ` Martin von Zweigbergk
2012-08-13 23:05   ` Junio C Hamano
2012-08-14  5:33     ` Martin von Zweigbergk
2012-08-14 14:54       ` Junio C Hamano
2012-08-14  8:22 ` Michael Haggerty
2012-08-14  8:45 ` Thomas Rast
2012-08-14 14:30   ` Junio C Hamano
2012-08-14 14:51     ` Thomas Rast
2012-08-14 15:47       ` Junio C Hamano
2012-08-15 20:02       ` [PATCH v2] " Junio C Hamano
2012-08-16  6:06         ` Martin von Zweigbergk
2012-08-16  6:20           ` Junio C Hamano
2012-08-16  6:26             ` Junio C Hamano
2012-08-16  8:51               ` Thomas Rast
2012-08-16 10:01                 ` Michael Haggerty
2012-08-16 12:00                   ` Thomas Rast
2012-08-16 16:10                     ` Junio C Hamano
2012-08-17  9:34                       ` Thomas Rast
2012-08-17  9:50                         ` Thomas Rast
2012-08-17 17:18                         ` Junio C Hamano
2012-08-17 17:37                           ` Thomas Rast [this message]
2012-08-17 18:11                             ` Junio C Hamano
2012-08-17 17:40                         ` Junio C Hamano
2012-08-16 16:35                     ` Michael Haggerty
2012-08-16  8:42         ` Thomas Rast

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87obm9a07z.fsf@thomas.inf.ethz.ch \
    --to=trast@student.ethz.ch \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=martin.von.zweigbergk@gmail.com \
    --cc=mhagger@alum.mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).