{"thread":{"id":"65301","subject":"[RFC] git am: apply patches directly via message id","startedAt":"2026-03-19T09:24:52Z","lastAt":"2026-03-19T15:46:07Z","messageCount":5,"participants":["Shreyansh Paliwal","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"539373","messageId":"20260319092441.1283001-1-shreyanshpaliwalcmsmn@gmail.com","threadId":"65301","inReplyTo":null,"subject":"[RFC] git am: apply patches directly via message id","fromName":"Shreyansh Paliwal","fromEmail":"shreyanshpaliwalcmsmn@gmail.com","sentAt":"2026-03-19T09:23:36Z","receivedAt":"2026-03-19T09:24:52Z","isPatch":false,"sender":{"key":"shreyanshpaliwalcmsmn@gmail.com","avatar":"https://avatars.githubusercontent.com/u/152720574?v=4"},"body":"Hi,\n\nCurrently, git am supports applying patches through several methods, mbox\nfiles, .patch files, maildir directories etc. However, all of these require\nthe user to first obtain the patch file locally before applying it. I was\nthinking that it would be a lot more convinient to directly apply patches\nby by their message id of emails, without any manual downloading by the\nhelp of a new option '--fetch-mid'. It would something be like,\n\n        git am --fetch-mid \"foo1@bar\" \"foo2@bar\"\n\nWe can fetch the patch/es from the standard url format like,\n\n        `https://lore.kernel.org/git/<message-id>/raw`\n\nWe can also make the base URL configurable via a new config key\nam.publicInboxUrl, defaulting to https://lore.kernel.org, so that users on\nprivate setups can point it at their own public-inbox instance. The fetched\ncontent is already in mbox format, so the patch application logic won't\nneed any change. A further addition to this can be to just provide the\nmessage id of the cover letter of patch and automatically it would fetch\nall the patches.\n\nDoes this sound like a useful feature to add or maybe any kind of indirect\nimplementation is already there and I am missing anything. Let me know what\nare your thoughts on this.\n\nBest,\nShreyansh\n"},{"id":"539382","messageId":"xmqqy0jolyte.fsf@gitster.g","threadId":"65301","inReplyTo":"20260319092441.1283001-1-shreyanshpaliwalcmsmn@gmail.com","subject":"Re: [RFC] git am: apply patches directly via message id","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-03-19T13:43:25Z","receivedAt":"2026-03-19T13:43:28Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Shreyansh Paliwal <shreyanshpaliwalcmsmn@gmail.com> writes:\n\n> Does this sound like a useful feature to add or maybe any kind of indirect\n> implementation is already there and I am missing anything. Let me know what\n> are your thoughts on this.\n\nSounds a lot like \"b4 am -o-\" piped to \"git am\" to me.\n"},{"id":"539388","messageId":"20260319152313.1324081-1-shreyanshpaliwalcmsmn@gmail.com","threadId":"65301","inReplyTo":"xmqqy0jolyte.fsf@gitster.g","subject":"Re: [RFC] git am: apply patches directly via message id","fromName":"Shreyansh Paliwal","fromEmail":"shreyanshpaliwalcmsmn@gmail.com","sentAt":"2026-03-19T15:21:11Z","receivedAt":"2026-03-19T15:23:46Z","isPatch":false,"sender":{"key":"shreyanshpaliwalcmsmn@gmail.com","avatar":"https://avatars.githubusercontent.com/u/152720574?v=4"},"body":"> Shreyansh Paliwal <shreyanshpaliwalcmsmn@gmail.com> writes:\n>\n> > Does this sound like a useful feature to add or maybe any kind of indirect\n> > implementation is already there and I am missing anything. Let me know what\n> > are your thoughts on this.\n>\n> Sounds a lot like \"b4 am -o-\" piped to \"git am\" to me.\n>\n\nI see. Though I think b4 is an external library, and I am reckoning that\nthis functionality is used commonly so would it make sense to add this\nnatively in git am ? or it is fine using b4 for this.\n"},{"id":"539389","messageId":"xmqqjyv7n872.fsf@gitster.g","threadId":"65301","inReplyTo":"20260319152313.1324081-1-shreyanshpaliwalcmsmn@gmail.com","subject":"Re: [RFC] git am: apply patches directly via message id","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-03-19T15:35:29Z","receivedAt":"2026-03-19T15:35:32Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Shreyansh Paliwal <shreyanshpaliwalcmsmn@gmail.com> writes:\n\n>> Sounds a lot like \"b4 am -o-\" piped to \"git am\" to me.\n>\n> I see. Though I think b4 is an external library, and I am reckoning that\n> this functionality is used commonly so would it make sense to add this\n> natively in git am ? or it is fine using b4 for this.\n\nBut lore (and the way it takes the message-ID and returns not just a\nsingle message but a mbox with all patches in a complete series) is\nvery specific external dependency.  It does not belong to \"git am\",\nwhose only purpose is to accept a mailbox with bunch of patches (and\nwe do not care how you downloaded the mailbox) and create commits\nout of them.  Interacting with lore and downloading patches from it\nis what \"b4\" does and it does it well.\n\nSo, no, it is not _fine_ using b4 for this.  It is crazy not to use\nit for this.\n"},{"id":"539391","messageId":"20260319154554.1328074-1-shreyanshpaliwalcmsmn@gmail.com","threadId":"65301","inReplyTo":"xmqqjyv7n872.fsf@gitster.g","subject":"Re: [RFC] git am: apply patches directly via message id","fromName":"Shreyansh Paliwal","fromEmail":"shreyanshpaliwalcmsmn@gmail.com","sentAt":"2026-03-19T15:45:24Z","receivedAt":"2026-03-19T15:46:07Z","isPatch":false,"sender":{"key":"shreyanshpaliwalcmsmn@gmail.com","avatar":"https://avatars.githubusercontent.com/u/152720574?v=4"},"body":"> Shreyansh Paliwal <shreyanshpaliwalcmsmn@gmail.com> writes:\n>\n> >> Sounds a lot like \"b4 am -o-\" piped to \"git am\" to me.\n> >\n> > I see. Though I think b4 is an external library, and I am reckoning that\n> > this functionality is used commonly so would it make sense to add this\n> > natively in git am ? or it is fine using b4 for this.\n>\n> But lore (and the way it takes the message-ID and returns not just a\n> single message but a mbox with all patches in a complete series) is\n> very specific external dependency.  It does not belong to \"git am\",\n> whose only purpose is to accept a mailbox with bunch of patches (and\n> we do not care how you downloaded the mailbox) and create commits\n> out of them.  Interacting with lore and downloading patches from it\n> is what \"b4\" does and it does it well.\n\nHmm. That makes sense. Thanks.\n"}]}