git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Philip Oakley <philipoakley@iee.org>
To: "Junio C Hamano" <gitster@pobox.com>,
	"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Cc: wuzhouhui <wuzhouhui14@mails.ucas.ac.cn>, git@vger.kernel.org
Subject: Re: How to get next commit that just after a specified commit
Date: Fri, 15 Feb 2019 10:58:31 +0000	[thread overview]
Message-ID: <fbf09f23-6f9c-2353-2416-8c2a12f9cf48@iee.org> (raw)
In-Reply-To: <xmqqimxnbdfq.fsf@gitster-ct.c.googlers.com>

On 13/02/2019 21:12, Junio C Hamano wrote:
> Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
>
>> (Replying to
>> https://public-inbox.org/git/383c14cc.9289.168e61d39e8.Coremail.wuzhouhui14@mails.ucas.ac.cn/
>> which curiously I can see there, but not in my inbox (or spam))
>>
>> Git's data format doesn't make it easy to find "C" given "B" in a commit
>> chain like A->B->C (also there could be any number of "C"
>> successors). We need to walk the graph. This shows how to do it:
>>
>> https://sqlite.org/whynotgit.html#git_makes_it_difficult_to_find_successors_descendents_of_a_check_in
> Of course, the history is not necessarily linear.  Even though you
> *MUST* know all your parents before having a commit (which means
> that when you ask "what came before this commit", there is a
> definitive answer that everybody in the world would agree on), you
> by definition cannot know all the commits that are children of a
> commit (simply because somebody else may be creating a new one), so
> the question "what's the next commit" does not make any sense from
> that point of view ;-)

It will also depend on which heads (branches) one wishes to trace back 
from, or even know about. I'd expect that the default would just be the 
current branch (head) which would definitely limit the potential commit 
list.

--

Philip


      parent reply	other threads:[~2019-02-15 10:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-13  9:08 How to get next commit that just after a specified commit wuzhouhui
2019-02-13  9:49 ` Ævar Arnfjörð Bjarmason
2019-02-13 21:12   ` Junio C Hamano
2019-02-13 21:36     ` Ævar Arnfjörð Bjarmason
2019-02-18 19:41       ` Derrick Stolee
2019-02-15 10:58     ` Philip Oakley [this message]

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=fbf09f23-6f9c-2353-2416-8c2a12f9cf48@iee.org \
    --to=philipoakley@iee.org \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=wuzhouhui14@mails.ucas.ac.cn \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).