{"thread":{"id":"61220","subject":"base-commit when prerequisite-patch-id is specified","startedAt":"2024-03-28T21:34:42Z","lastAt":"2024-03-29T00:06:12Z","messageCount":2,"participants":["Konstantin Ryabitsev","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"491787","messageId":"20240328-vehement-fine-tarantula-2b864a@lemur","threadId":"61220","inReplyTo":null,"subject":"base-commit when prerequisite-patch-id is specified","fromName":"Konstantin Ryabitsev","fromEmail":"konstantin@linuxfoundation.org","sentAt":"2024-03-28T21:34:41Z","receivedAt":"2024-03-28T21:34:42Z","isPatch":false,"sender":{"key":"konstantin@linuxfoundation.org","avatar":"https://gravatar.com/avatar/7cb8827c6de56e1bd2dea16508c6708aa43feed3bf3813bcdacecdf96ceadd79?d=mp&s=160"},"body":"Hello:\n\nI'm working on automatically supporting dependencies with b4, and I'm curious\nif \"base-commit\" should be used to indicate where to start applying\ndependencies, or if that's purely for the patch series itself.\n\nE.g.:\n\n    base-commit: [commit-ish]\n    prerequisite-patch-id: abcd...1234\n    prerequisite-patch-id: cdef...3456\n\nIn this situation, does base-commit mean:\n1. where to apply abcd...1234\n2. the sha we should find when we apply both prerequisite patches\n\nIn theory, #2 makes no sense, because we don't know where to apply\nprerequisite-patch-id's and therefore can't reasonably arrive at whatever is\nspecified as \"base-commit\".\n\nI expect the answer is \"it's whatever you think it should be,\" because\nprerequisite-patch-id's aren't really widely used, but I'll be happy to learn\nthat there's an established practice.\n\n-K\n"},{"id":"491795","messageId":"xmqqzfuhsxzi.fsf@gitster.g","threadId":"61220","inReplyTo":"20240328-vehement-fine-tarantula-2b864a@lemur","subject":"Re: base-commit when prerequisite-patch-id is specified","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-03-29T00:06:09Z","receivedAt":"2024-03-29T00:06:12Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Konstantin Ryabitsev <konstantin@linuxfoundation.org> writes:\n\n> Hello:\n>\n> I'm working on automatically supporting dependencies with b4, and I'm curious\n> if \"base-commit\" should be used to indicate where to start applying\n> dependencies, or if that's purely for the patch series itself.\n>\n> E.g.:\n>\n>     base-commit: [commit-ish]\n>     prerequisite-patch-id: abcd...1234\n>     prerequisite-patch-id: cdef...3456\n>\n> In this situation, does base-commit mean:\n> 1. where to apply abcd...1234\n> 2. the sha we should find when we apply both prerequisite patches\n\n\"git format-patch --help\" has this to say:\n\n  Imagine that on top of the public commit P, you applied well-known patches X, Y\n  and Z from somebody else, and then built your three-patch series A, B, C, the\n  history would be like:\n\n      ---P---X---Y---Z---A---B---C\n\n  With git format-patch --base=P -3 C (or variants thereof, e.g. with --cover-letter\n  or using Z..C instead of -3 C to specify the range), the base tree information\n  block is shown at the end of the first message the command outputs (either the\n  first patch, or the cover letter), like this:\n\n      base-commit: P\n      prerequisite-patch-id: X\n      prerequisite-patch-id: Y\n      prerequisite-patch-id: Z\n\nSo, it appears to me that the only way to read your example is that\nthere is P, on top of which abcd...1234 and cdef...3456 should be\napplied, before our series is ready to be applied on top?\n\nThere is no way to express the desired topology on top of P that X,\nY and Z are built, and I think it is acceptable to assume the author\nof such a patch series, who took it out of a history other than the\nabove depicted single strand of pearls, e.g. a mergy one in the\nexample given in the \"git format-patch --help\" output:\n\n  For non-linear topology, such as\n\n      ---P---X---A---M---C\n          \\         /\n           Y---Z---B\n\n  You can also use git format-patch --base=P -3 C to generate patches for A, B and\n  C, and the identifiers for P, X, Y, Z are appended at the end of the first\n  message.\n\nis responsible to ensure that linear application of X Y Z A B C on\ntop of P should give the same result as C the author had taken the\npatches out of.  The recipient, or b4 tool, cannot do anything with\nthe existing information.\n\n"}]}