* [RFC] git am: apply patches directly via message id
@ 2026-03-19 9:23 Shreyansh Paliwal
2026-03-19 13:43 ` Junio C Hamano
0 siblings, 1 reply; 5+ messages in thread
From: Shreyansh Paliwal @ 2026-03-19 9:23 UTC (permalink / raw)
To: git
Hi,
Currently, git am supports applying patches through several methods, mbox
files, .patch files, maildir directories etc. However, all of these require
the user to first obtain the patch file locally before applying it. I was
thinking that it would be a lot more convinient to directly apply patches
by by their message id of emails, without any manual downloading by the
help of a new option '--fetch-mid'. It would something be like,
git am --fetch-mid "foo1@bar" "foo2@bar"
We can fetch the patch/es from the standard url format like,
`https://lore.kernel.org/git/<message-id>/raw`
We can also make the base URL configurable via a new config key
am.publicInboxUrl, defaulting to https://lore.kernel.org, so that users on
private setups can point it at their own public-inbox instance. The fetched
content is already in mbox format, so the patch application logic won't
need any change. A further addition to this can be to just provide the
message id of the cover letter of patch and automatically it would fetch
all the patches.
Does this sound like a useful feature to add or maybe any kind of indirect
implementation is already there and I am missing anything. Let me know what
are your thoughts on this.
Best,
Shreyansh
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [RFC] git am: apply patches directly via message id
2026-03-19 9:23 [RFC] git am: apply patches directly via message id Shreyansh Paliwal
@ 2026-03-19 13:43 ` Junio C Hamano
2026-03-19 15:21 ` Shreyansh Paliwal
0 siblings, 1 reply; 5+ messages in thread
From: Junio C Hamano @ 2026-03-19 13:43 UTC (permalink / raw)
To: Shreyansh Paliwal; +Cc: git
Shreyansh Paliwal <shreyanshpaliwalcmsmn@gmail.com> writes:
> Does this sound like a useful feature to add or maybe any kind of indirect
> implementation is already there and I am missing anything. Let me know what
> are your thoughts on this.
Sounds a lot like "b4 am -o-" piped to "git am" to me.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFC] git am: apply patches directly via message id
2026-03-19 13:43 ` Junio C Hamano
@ 2026-03-19 15:21 ` Shreyansh Paliwal
2026-03-19 15:35 ` Junio C Hamano
0 siblings, 1 reply; 5+ messages in thread
From: Shreyansh Paliwal @ 2026-03-19 15:21 UTC (permalink / raw)
To: git; +Cc: gitster
> Shreyansh Paliwal <shreyanshpaliwalcmsmn@gmail.com> writes:
>
> > Does this sound like a useful feature to add or maybe any kind of indirect
> > implementation is already there and I am missing anything. Let me know what
> > are your thoughts on this.
>
> Sounds a lot like "b4 am -o-" piped to "git am" to me.
>
I see. Though I think b4 is an external library, and I am reckoning that
this functionality is used commonly so would it make sense to add this
natively in git am ? or it is fine using b4 for this.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFC] git am: apply patches directly via message id
2026-03-19 15:21 ` Shreyansh Paliwal
@ 2026-03-19 15:35 ` Junio C Hamano
2026-03-19 15:45 ` Shreyansh Paliwal
0 siblings, 1 reply; 5+ messages in thread
From: Junio C Hamano @ 2026-03-19 15:35 UTC (permalink / raw)
To: Shreyansh Paliwal; +Cc: git
Shreyansh Paliwal <shreyanshpaliwalcmsmn@gmail.com> writes:
>> Sounds a lot like "b4 am -o-" piped to "git am" to me.
>
> I see. Though I think b4 is an external library, and I am reckoning that
> this functionality is used commonly so would it make sense to add this
> natively in git am ? or it is fine using b4 for this.
But lore (and the way it takes the message-ID and returns not just a
single message but a mbox with all patches in a complete series) is
very specific external dependency. It does not belong to "git am",
whose only purpose is to accept a mailbox with bunch of patches (and
we do not care how you downloaded the mailbox) and create commits
out of them. Interacting with lore and downloading patches from it
is what "b4" does and it does it well.
So, no, it is not _fine_ using b4 for this. It is crazy not to use
it for this.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RFC] git am: apply patches directly via message id
2026-03-19 15:35 ` Junio C Hamano
@ 2026-03-19 15:45 ` Shreyansh Paliwal
0 siblings, 0 replies; 5+ messages in thread
From: Shreyansh Paliwal @ 2026-03-19 15:45 UTC (permalink / raw)
To: git; +Cc: gitster
> Shreyansh Paliwal <shreyanshpaliwalcmsmn@gmail.com> writes:
>
> >> Sounds a lot like "b4 am -o-" piped to "git am" to me.
> >
> > I see. Though I think b4 is an external library, and I am reckoning that
> > this functionality is used commonly so would it make sense to add this
> > natively in git am ? or it is fine using b4 for this.
>
> But lore (and the way it takes the message-ID and returns not just a
> single message but a mbox with all patches in a complete series) is
> very specific external dependency. It does not belong to "git am",
> whose only purpose is to accept a mailbox with bunch of patches (and
> we do not care how you downloaded the mailbox) and create commits
> out of them. Interacting with lore and downloading patches from it
> is what "b4" does and it does it well.
Hmm. That makes sense. Thanks.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-03-19 15:46 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-19 9:23 [RFC] git am: apply patches directly via message id Shreyansh Paliwal
2026-03-19 13:43 ` Junio C Hamano
2026-03-19 15:21 ` Shreyansh Paliwal
2026-03-19 15:35 ` Junio C Hamano
2026-03-19 15:45 ` Shreyansh Paliwal
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox