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

Re: Guess the base-commit of a series

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 30, 2020, 19:49 UTC
Message-ID
<xmqqk11wsqim.fsf@gitster.c.googlers.com>
In-Reply-To
<20200430173302.GA18877@dcvr>
Eric Wong <e@yhbt.net> writes:
Show 8 quoted lines
> Konstantin Ryabitsev <konstantin@linuxfoundation.org> wrote:
>> Hello:
>> 
>> Given a/ b/ filenames and blob index information, is there a relatively 
>> easy way to find the latest branch commit where a patch series would 
>> apply cleanly (i.e. guess the base-commit)?
>
> Not as far as I know...
Me neither.

I am assuming that this is in the context of the kernel project, where there are numerous but manageable number of well known repositories, so Konstantin can probably create a (bare) repository that fetches from all of them into refs/remotes/{linus,next,...}/ remote-tracking branches. With that, running this command

    $ git rev-list --all | git diff-tree --stdin --raw -r
and write a script that parses its output may not be too hard.

I am not sure what Konstantin wanted to say with "the latest branch commit", but if the starting point (i.e. branch) is known, then such a script can read from the output of the above pipeline but instead of starting from "--all", start the traversal from the branch tip.

There may not be any such tree with all those blobs. For the second patch in an N-patch series, there won't be such a tree anywhere other than the author's repository unless the first patch of the series has been applied somewhere well known.

Previous: Eric WongNext: Konstantin Ryabitsev
Message 3 of 4 in “Guess the base-commit of a series”
  1. Konstantin RyabitsevApr 30, 2020
  2. Eric WongApr 30, 2020
  3. Junio C HamanoApr 30, 2020
  4. Konstantin RyabitsevApr 30, 2020

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.