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

Re: How to get next commit that just after a specified commit

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Feb 13, 2019, 09:49 UTC
Message-ID
<87mun0j9vv.fsf@evledraar.gmail.com>
In-Reply-To
<383c14cc.9289.168e61d39e8.Coremail.wuzhouhui14@mails.ucas.ac.cn>

(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
Previous: wuzhouhuiNext: Junio C Hamano
Message 2 of 6 in “How to get next commit that just after a specified commit”
  1. wuzhouhuiFeb 13, 2019
  2. Ævar Arnfjörð BjarmasonFeb 13, 2019
  3. Junio C HamanoFeb 13, 2019
  4. Ævar Arnfjörð BjarmasonFeb 13, 2019
  5. Derrick StoleeFeb 18, 2019
  6. Philip OakleyFeb 15, 2019

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.