Gnus development mailing list
 help / color / mirror / Atom feed
* Applying patches sent via email
@ 2021-07-13 21:42 Eric Abrahamsen
  2021-07-13 21:50 ` Lars Ingebrigtsen
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Eric Abrahamsen @ 2021-07-13 21:42 UTC (permalink / raw)
  To: ding

Hi all,

I've always been slightly annoyed at the hoops I have to jump through to
apply git patches that I get in email to various repos that I have on
disk. I'm starting to realize that it's actually easier than I thought
(specifically, "git am" is much more capable than I realized), and I'm
thinking that there's only a couple bits of glue missing, which means
someone has probably already done this.

Does anyone have a facility that can be used to apply git patches
received via email to local repos? I'd like equivalents to both
`gnus-summary-pipe-part' and `gnus-summary-pipe-output' -- ie applicable
either to a mime part or to the message as a whole -- where it prompts
me for a local directory (git repo), possibly for a git branch in that
repo, then handles the running of "git am" for me.

Please let me know if you've got anything like this on hand!

TIA,
Eric



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

* Re: Applying patches sent via email
  2021-07-13 21:42 Applying patches sent via email Eric Abrahamsen
@ 2021-07-13 21:50 ` Lars Ingebrigtsen
  2021-07-13 22:38   ` Eric Abrahamsen
  2021-07-15 16:15 ` Štěpán Němec
  2021-07-15 20:06 ` Tassilo Horn
  2 siblings, 1 reply; 8+ messages in thread
From: Lars Ingebrigtsen @ 2021-07-13 21:50 UTC (permalink / raw)
  To: Eric Abrahamsen; +Cc: ding

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

> I've always been slightly annoyed at the hoops I have to jump through to
> apply git patches that I get in email to various repos that I have on
> disk. I'm starting to realize that it's actually easier than I thought
> (specifically, "git am" is much more capable than I realized), and I'm
> thinking that there's only a couple bits of glue missing, which means
> someone has probably already done this.

If it's a patch generated from Git, then "git am" does indeed work
fine.  For other random patches, I use `debbugs-gnu-apply-patch' (from
the debbugs package), which tries to do a bunch of heuristics that...
sometimes work OK?  I mean, I tweaked it a lot over the years, and it's
geared towards Emacs, but...

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no


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

* Re: Applying patches sent via email
  2021-07-13 21:50 ` Lars Ingebrigtsen
@ 2021-07-13 22:38   ` Eric Abrahamsen
  2021-07-15  4:33     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 8+ messages in thread
From: Eric Abrahamsen @ 2021-07-13 22:38 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: ding

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>
>> I've always been slightly annoyed at the hoops I have to jump through to
>> apply git patches that I get in email to various repos that I have on
>> disk. I'm starting to realize that it's actually easier than I thought
>> (specifically, "git am" is much more capable than I realized), and I'm
>> thinking that there's only a couple bits of glue missing, which means
>> someone has probably already done this.
>
> If it's a patch generated from Git, then "git am" does indeed work
> fine.  For other random patches, I use `debbugs-gnu-apply-patch' (from
> the debbugs package), which tries to do a bunch of heuristics that...
> sometimes work OK?  I mean, I tweaked it a lot over the years, and it's
> geared towards Emacs, but...

That's good! You're right it's pretty Emacs-specific, but it's got all
the bits and pieces you need in it. I suppose the nice thing to have
would be something that was vc.el compatible, that let you move any kind
of patch out of a Gnus message and into any kind of vc repository.


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

* Re: Applying patches sent via email
  2021-07-13 22:38   ` Eric Abrahamsen
@ 2021-07-15  4:33     ` Lars Ingebrigtsen
  0 siblings, 0 replies; 8+ messages in thread
From: Lars Ingebrigtsen @ 2021-07-15  4:33 UTC (permalink / raw)
  To: Eric Abrahamsen; +Cc: ding

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

> I suppose the nice thing to have would be something that was vc.el
> compatible, that let you move any kind of patch out of a Gnus message
> and into any kind of vc repository.

Yeah, there's definitely bits that could be generalised -- like the
stuff that guesses what file(s) the patch actually applies to when
people didn't do the diff from the top-level location, etc.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no


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

* Re: Applying patches sent via email
  2021-07-13 21:42 Applying patches sent via email Eric Abrahamsen
  2021-07-13 21:50 ` Lars Ingebrigtsen
@ 2021-07-15 16:15 ` Štěpán Němec
  2021-07-15 17:37   ` Eric Abrahamsen
  2021-07-15 20:06 ` Tassilo Horn
  2 siblings, 1 reply; 8+ messages in thread
From: Štěpán Němec @ 2021-07-15 16:15 UTC (permalink / raw)
  To: Eric Abrahamsen; +Cc: ding

On Tue, 13 Jul 2021 14:42:17 -0700
Eric Abrahamsen wrote:

> Hi all,
>
> I've always been slightly annoyed at the hoops I have to jump through to
> apply git patches that I get in email to various repos that I have on
> disk. I'm starting to realize that it's actually easier than I thought
> (specifically, "git am" is much more capable than I realized), and I'm
> thinking that there's only a couple bits of glue missing, which means
> someone has probably already done this.
>
> Does anyone have a facility that can be used to apply git patches
> received via email to local repos? I'd like equivalents to both
> `gnus-summary-pipe-part' and `gnus-summary-pipe-output' -- ie applicable
> either to a mime part or to the message as a whole -- where it prompts
> me for a local directory (git repo), possibly for a git branch in that
> repo, then handles the running of "git am" for me.

For git, piem.el comes close to those requirements:

https://docs.kyleam.com/piem/

It lets you define local repository locations corresponding to mailing
list addresses and creates a branch to apply the patch(es) cleanly
(that's customizable).

It also lists some other tools of potential interest:

https://docs.kyleam.com/piem/Related-projects-and-tools.html#Related-projects-and-tools

-- 
Štěpán


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

* Re: Applying patches sent via email
  2021-07-15 16:15 ` Štěpán Němec
@ 2021-07-15 17:37   ` Eric Abrahamsen
  0 siblings, 0 replies; 8+ messages in thread
From: Eric Abrahamsen @ 2021-07-15 17:37 UTC (permalink / raw)
  To: Štěpán Němec; +Cc: ding

Štěpán Němec <stepnem@gmail.com> writes:

> On Tue, 13 Jul 2021 14:42:17 -0700
> Eric Abrahamsen wrote:
>
>> Hi all,
>>
>> I've always been slightly annoyed at the hoops I have to jump through to
>> apply git patches that I get in email to various repos that I have on
>> disk. I'm starting to realize that it's actually easier than I thought
>> (specifically, "git am" is much more capable than I realized), and I'm
>> thinking that there's only a couple bits of glue missing, which means
>> someone has probably already done this.
>>
>> Does anyone have a facility that can be used to apply git patches
>> received via email to local repos? I'd like equivalents to both
>> `gnus-summary-pipe-part' and `gnus-summary-pipe-output' -- ie applicable
>> either to a mime part or to the message as a whole -- where it prompts
>> me for a local directory (git repo), possibly for a git branch in that
>> repo, then handles the running of "git am" for me.
>
> For git, piem.el comes close to those requirements:
>
> https://docs.kyleam.com/piem/
>
> It lets you define local repository locations corresponding to mailing
> list addresses and creates a branch to apply the patch(es) cleanly
> (that's customizable).
>
> It also lists some other tools of potential interest:
>
> https://docs.kyleam.com/piem/Related-projects-and-tools.html#Related-projects-and-tools

This is great! Another very useful reference. Obviously many people have
had similar needs...

Thanks,
Eric


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

* Re: Applying patches sent via email
  2021-07-13 21:42 Applying patches sent via email Eric Abrahamsen
  2021-07-13 21:50 ` Lars Ingebrigtsen
  2021-07-15 16:15 ` Štěpán Němec
@ 2021-07-15 20:06 ` Tassilo Horn
  2021-07-16 14:47   ` Eric Abrahamsen
  2 siblings, 1 reply; 8+ messages in thread
From: Tassilo Horn @ 2021-07-15 20:06 UTC (permalink / raw)
  To: Eric Abrahamsen; +Cc: ding

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

Hi Eric,

> Does anyone have a facility that can be used to apply git patches
> received via email to local repos?

I'm using mu4e these days but it also has a "pipe mail to command"
command (`mu4e-view-pipe' bound to `|') and I simply do | and am queried
for a shell command and type

  cd ~/path/to/checkout && git am

and be done.  That should work fine from Gnus, too.

Bye,
Tassilo


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

* Re: Applying patches sent via email
  2021-07-15 20:06 ` Tassilo Horn
@ 2021-07-16 14:47   ` Eric Abrahamsen
  0 siblings, 0 replies; 8+ messages in thread
From: Eric Abrahamsen @ 2021-07-16 14:47 UTC (permalink / raw)
  To: Tassilo Horn; +Cc: ding

Tassilo Horn <tsdh@gnu.org> writes:

> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>
> Hi Eric,
>
>> Does anyone have a facility that can be used to apply git patches
>> received via email to local repos?
>
> I'm using mu4e these days but it also has a "pipe mail to command"
> command (`mu4e-view-pipe' bound to `|') and I simply do | and am queried
> for a shell command and type
>
>   cd ~/path/to/checkout && git am
>
> and be done.  That should work fine from Gnus, too.

That is what I ended up doing, but it didn't seem like enough
Programming :)


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

end of thread, other threads:[~2021-07-16 14:47 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-13 21:42 Applying patches sent via email Eric Abrahamsen
2021-07-13 21:50 ` Lars Ingebrigtsen
2021-07-13 22:38   ` Eric Abrahamsen
2021-07-15  4:33     ` Lars Ingebrigtsen
2021-07-15 16:15 ` Štěpán Němec
2021-07-15 17:37   ` Eric Abrahamsen
2021-07-15 20:06 ` Tassilo Horn
2021-07-16 14:47   ` Eric Abrahamsen

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 NNTP newsgroup(s).