mbox series

[v2,0/3] send-email: teach git send-email mode to translate aliases

Message ID 20240813-jk-translate-alias-send-email-v2-0-912db4eb6846@gmail.com (mailing list archive)
Headers show
Series send-email: teach git send-email mode to translate aliases | expand

Message

Jacob Keller Aug. 14, 2024, 12:05 a.m. UTC
The b4 program has its own "b4 send" utility for sending a patch series. It
is similar in many respects to git send-email. Currently, it lacks support
for processing aliases, which makes switching between git send-email and b4
send somewhat annoying.

It would be convenient if b4 (or other programs interacting with git) could
make use of git send-email's alias file support.

Teach git send-email a new --translate-aliases option, which enables a new
mode for git send-email. When executed with this option, git send-email
will read standard input and convert each input according to the configured
alias file. The resulting address will be output to standard out.

I also considered implementing a new "full" format for --dump-aliases which
would dump the entire alias file along with its configured email addresses.
I ended up dropping that change as I felt that it would be less usable than
the translation feature.

Signed-off-by: Jacob Keller <jacob.keller@gmail.com>
---
Changes in v2:
- Use standard input instead of command line arguments
- Link to v1: https://lore.kernel.org/r/20240808-jk-translate-alias-send-email-v1-0-10a03b3d6b06@gmail.com

---
Jacob Keller (3):
      t90001-send-email.sh: fix quoting for mailrc --dump-aliases test
      t9001-send-email.sh: update alias list used for pine test
      send-email: teach git send-email option to translate aliases

 Documentation/git-send-email.txt |   7 +++
 git-send-email.perl              |  21 ++++++-
 t/t9001-send-email.sh            | 118 +++++++++++++++++++++++++++++++++++++--
 3 files changed, 139 insertions(+), 7 deletions(-)
---
base-commit: 406f326d271e0bacecdb00425422c5fa3f314930
change-id: 20240808-jk-translate-alias-send-email-1ce048643e5d

Best regards,

Comments

Junio C Hamano Aug. 14, 2024, 4:54 p.m. UTC | #1
Jacob Keller <jacob.e.keller@intel.com> writes:

> The b4 program has its own "b4 send" utility for sending a patch series. It
> is similar in many respects to git send-email. Currently, it lacks support
> for processing aliases, which makes switching between git send-email and b4
> send somewhat annoying.
>
> It would be convenient if b4 (or other programs interacting with git) could
> make use of git send-email's alias file support.
>
> Teach git send-email a new --translate-aliases option, which enables a new
> mode for git send-email. When executed with this option, git send-email
> will read standard input and convert each input according to the configured
> alias file. The resulting address will be output to standard out.
>
> I also considered implementing a new "full" format for --dump-aliases which
> would dump the entire alias file along with its configured email addresses.
> I ended up dropping that change as I felt that it would be less usable than
> the translation feature.
>
> Signed-off-by: Jacob Keller <jacob.keller@gmail.com>
> ---
> Changes in v2:
> - Use standard input instead of command line arguments
> - Link to v1: https://lore.kernel.org/r/20240808-jk-translate-alias-send-email-v1-0-10a03b3d6b06@gmail.com
>
> ---
> Jacob Keller (3):
>       t90001-send-email.sh: fix quoting for mailrc --dump-aliases test

Nobody noticed the typo in the filename since the previous iteration
was posted?

>       t9001-send-email.sh: update alias list used for pine test
>       send-email: teach git send-email option to translate aliases
>
>  Documentation/git-send-email.txt |   7 +++
>  git-send-email.perl              |  21 ++++++-
>  t/t9001-send-email.sh            | 118 +++++++++++++++++++++++++++++++++++++--
>  3 files changed, 139 insertions(+), 7 deletions(-)
> ---
> base-commit: 406f326d271e0bacecdb00425422c5fa3f314930
> change-id: 20240808-jk-translate-alias-send-email-1ce048643e5d
>
> Best regards,
Jacob Keller Aug. 14, 2024, 5:45 p.m. UTC | #2
On Wed, Aug 14, 2024 at 9:54 AM Junio C Hamano <gitster@pobox.com> wrote:
> Jacob Keller <jacob.e.keller@intel.com> writes:
> > ---
> > Jacob Keller (3):
> >       t90001-send-email.sh: fix quoting for mailrc --dump-aliases test
>
> Nobody noticed the typo in the filename since the previous iteration
> was posted?
>

I certainly did not :D Woops. If you had pointed this out in the
initial review, I apologize as I missed that comment.
Junio C Hamano Aug. 14, 2024, 6:41 p.m. UTC | #3
Jacob Keller <jacob.keller@gmail.com> writes:

> On Wed, Aug 14, 2024 at 9:54 AM Junio C Hamano <gitster@pobox.com> wrote:
>> Jacob Keller <jacob.e.keller@intel.com> writes:
>> > ---
>> > Jacob Keller (3):
>> >       t90001-send-email.sh: fix quoting for mailrc --dump-aliases test
>>
>> Nobody noticed the typo in the filename since the previous iteration
>> was posted?
>>
>
> I certainly did not :D Woops. If you had pointed this out in the
> initial review, I apologize as I missed that comment.

I do recall raising an eyebrow but I do also recall saying nothing
about it ;-)
Konstantin Ryabitsev Aug. 15, 2024, 2:29 p.m. UTC | #4
On Tue, Aug 13, 2024 at 05:05:08PM GMT, Jacob Keller wrote:
> It would be convenient if b4 (or other programs interacting with git) could
> make use of git send-email's alias file support.

This is, indeed, a very frequent request.

Acked-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>

-KK
Junio C Hamano Aug. 15, 2024, 10:57 p.m. UTC | #5
Jacob Keller <jacob.e.keller@intel.com> writes:

> Jacob Keller (3):
>       t90001-send-email.sh: fix quoting for mailrc --dump-aliases test
>       t9001-send-email.sh: update alias list used for pine test
>       send-email: teach git send-email option to translate aliases

Seems to fail t9001 rather miserably on Windows.

https://github.com/git/git/actions/runs/10411559740/job/28835810137#step:5:2444

There seem to be way too many PREREQ related skippage, it is not all
that surprising (it does not make it excuable, though) if a new test
that comes later and not skipped is broken because earlier steps are
not executed.
Jacob Keller Aug. 15, 2024, 11:46 p.m. UTC | #6
> -----Original Message-----
> From: Junio C Hamano <gitster@pobox.com>
> Sent: Thursday, August 15, 2024 3:57 PM
> To: Keller, Jacob E <jacob.e.keller@intel.com>
> Cc: git@vger.kernel.org; Jacob Keller <jacob.keller@gmail.com>; Konstantin
> Ryabitsev <konstantin@linuxfoundation.org>
> Subject: Re: [PATCH v2 0/3] send-email: teach git send-email mode to translate
> aliases
> 
> Jacob Keller <jacob.e.keller@intel.com> writes:
> 
> > Jacob Keller (3):
> >       t90001-send-email.sh: fix quoting for mailrc --dump-aliases test
> >       t9001-send-email.sh: update alias list used for pine test
> >       send-email: teach git send-email option to translate aliases
> 
> Seems to fail t9001 rather miserably on Windows.
> 
> https://github.com/git/git/actions/runs/10411559740/job/28835810137#step:5:24
> 44
> 
> There seem to be way too many PREREQ related skippage, it is not all
> that surprising (it does not make it excuable, though) if a new test
> that comes later and not skipped is broken because earlier steps are
> not executed.

It looks like we're missing the perl PREREQ on the tests, so these execute and then fail because of lack of perl. Should be easy to fix.