git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
To: Eric Wong <e@yhbt.net>
Cc: git@vger.kernel.org
Subject: Re: Guess the base-commit of a series
Date: Thu, 30 Apr 2020 15:52:11 -0400	[thread overview]
Message-ID: <20200430195211.36zhvfcdrpfirewr@chatter.i7.local> (raw)
In-Reply-To: <20200430173302.GA18877@dcvr>

On Thu, Apr 30, 2020 at 05:33:02PM +0000, Eric Wong wrote:
> > 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...

Hmm... I'd assumed as much, given the whole "one-way" bit in "one-way 
hashing." :) However, I'm not very familiar with deep git internals, so 
wasn't sure if perhaps git kept a mapping index of sorts that could be 
queries.

There's a reasonable way to do it with the patches sent against the 
kernel, since they are likely against one of the tags created in the 
past few weeks. So, we just create a filename/blob index mapping and do:

git show tagname:filename | git hash-object --stdin

If we find a tagname where all the indexes match, then it's *probably* 
the base-commit (not guaranteed to be correct, obviously, because the 
patch may depend on changes made to other files in the tree, but 
hopefully we'll get most folks to start providing base-commit info soon 
and this guesswork will become increasingly obsolete).

-K

      parent reply	other threads:[~2020-04-30 19:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-30 17:21 Guess the base-commit of a series Konstantin Ryabitsev
2020-04-30 17:33 ` Eric Wong
2020-04-30 19:49   ` Junio C Hamano
2020-04-30 19:52   ` Konstantin Ryabitsev [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=20200430195211.36zhvfcdrpfirewr@chatter.i7.local \
    --to=konstantin@linuxfoundation.org \
    --cc=e@yhbt.net \
    --cc=git@vger.kernel.org \
    /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).