git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
Cc: git@vger.kernel.org
Subject: Re: base-commit when prerequisite-patch-id is specified
Date: Thu, 28 Mar 2024 17:06:09 -0700	[thread overview]
Message-ID: <xmqqzfuhsxzi.fsf@gitster.g> (raw)
In-Reply-To: <20240328-vehement-fine-tarantula-2b864a@lemur> (Konstantin Ryabitsev's message of "Thu, 28 Mar 2024 17:34:41 -0400")

Konstantin Ryabitsev <konstantin@linuxfoundation.org> writes:

> Hello:
>
> I'm working on automatically supporting dependencies with b4, and I'm curious
> if "base-commit" should be used to indicate where to start applying
> dependencies, or if that's purely for the patch series itself.
>
> E.g.:
>
>     base-commit: [commit-ish]
>     prerequisite-patch-id: abcd...1234
>     prerequisite-patch-id: cdef...3456
>
> In this situation, does base-commit mean:
> 1. where to apply abcd...1234
> 2. the sha we should find when we apply both prerequisite patches

"git format-patch --help" has this to say:

  Imagine that on top of the public commit P, you applied well-known patches X, Y
  and Z from somebody else, and then built your three-patch series A, B, C, the
  history would be like:

      ---P---X---Y---Z---A---B---C

  With git format-patch --base=P -3 C (or variants thereof, e.g. with --cover-letter
  or using Z..C instead of -3 C to specify the range), the base tree information
  block is shown at the end of the first message the command outputs (either the
  first patch, or the cover letter), like this:

      base-commit: P
      prerequisite-patch-id: X
      prerequisite-patch-id: Y
      prerequisite-patch-id: Z

So, it appears to me that the only way to read your example is that
there is P, on top of which abcd...1234 and cdef...3456 should be
applied, before our series is ready to be applied on top?

There is no way to express the desired topology on top of P that X,
Y and Z are built, and I think it is acceptable to assume the author
of such a patch series, who took it out of a history other than the
above depicted single strand of pearls, e.g. a mergy one in the
example given in the "git format-patch --help" output:

  For non-linear topology, such as

      ---P---X---A---M---C
          \         /
           Y---Z---B

  You can also use git format-patch --base=P -3 C to generate patches for A, B and
  C, and the identifiers for P, X, Y, Z are appended at the end of the first
  message.

is responsible to ensure that linear application of X Y Z A B C on
top of P should give the same result as C the author had taken the
patches out of.  The recipient, or b4 tool, cannot do anything with
the existing information.



      reply	other threads:[~2024-03-29  0:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-28 21:34 base-commit when prerequisite-patch-id is specified Konstantin Ryabitsev
2024-03-29  0:06 ` Junio C Hamano [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=xmqqzfuhsxzi.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=konstantin@linuxfoundation.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).