All of lore.kernel.org
 help / color / mirror / Atom feed
* base-commit when prerequisite-patch-id is specified
@ 2024-03-28 21:34 Konstantin Ryabitsev
  2024-03-29  0:06 ` Junio C Hamano
  0 siblings, 1 reply; 2+ messages in thread
From: Konstantin Ryabitsev @ 2024-03-28 21:34 UTC (permalink / raw)
  To: git

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

In theory, #2 makes no sense, because we don't know where to apply
prerequisite-patch-id's and therefore can't reasonably arrive at whatever is
specified as "base-commit".

I expect the answer is "it's whatever you think it should be," because
prerequisite-patch-id's aren't really widely used, but I'll be happy to learn
that there's an established practice.

-K

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: base-commit when prerequisite-patch-id is specified
  2024-03-28 21:34 base-commit when prerequisite-patch-id is specified Konstantin Ryabitsev
@ 2024-03-29  0:06 ` Junio C Hamano
  0 siblings, 0 replies; 2+ messages in thread
From: Junio C Hamano @ 2024-03-29  0:06 UTC (permalink / raw)
  To: Konstantin Ryabitsev; +Cc: git

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.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-03-29  0:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-28 21:34 base-commit when prerequisite-patch-id is specified Konstantin Ryabitsev
2024-03-29  0:06 ` Junio C Hamano

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.