unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Use .authinfo for git credentials
@ 2018-04-25  9:23 Pierre Neidhardt
  2018-04-25 10:07 ` Marius Bakke
  2018-04-27  3:11 ` Chris Marusich
  0 siblings, 2 replies; 8+ messages in thread
From: Pierre Neidhardt @ 2018-04-25  9:23 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: Type: text/plain, Size: 644 bytes --]


I would like `git send-email` to use the credentials from ~/.authinfo.gpg
to send patches to the Guix mailing list.

While not related to Guix code per se, I'm posting this here because I
primarily use `git send-email` for Guix and I suppose people around here
must have an answer to that question.

Or else how do you people configure `git send-email' to not prompt for a
password?

All I've found so far is this:

	https://github.com/git/git/blob/master/contrib/credential/netrc/git-credential-netrc

--
Pierre Neidhardt

He laughs at every joke three times... once when it's told, once when
it's explained, and once when he understands it.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

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

* Re: Use .authinfo for git credentials
  2018-04-25  9:23 Use .authinfo for git credentials Pierre Neidhardt
@ 2018-04-25 10:07 ` Marius Bakke
  2018-04-25 10:17   ` Pierre Neidhardt
  2018-04-25 19:02   ` Efraim Flashner
  2018-04-27  3:11 ` Chris Marusich
  1 sibling, 2 replies; 8+ messages in thread
From: Marius Bakke @ 2018-04-25 10:07 UTC (permalink / raw)
  To: Pierre Neidhardt, guix-devel

[-- Attachment #1: Type: text/plain, Size: 525 bytes --]

Pierre Neidhardt <ambrevar@gmail.com> writes:

> Or else how do you people configure `git send-email' to not prompt for a
> password?

I use 'msmtp' as the transport and have configured it to look up
passwords from 'password-store'.

$ git config --get-regexp sendemail.*
sendemail.smtpserver /home/marius/.guix-profile/bin/msmtp
sendemail.envelopesender auto

My ~/.msmtprc contains a line such as
'passwordeval "pass Email/fm/mbakke/out 2>/dev/null"'.  Obviously you
can use any other shell command here.

Hope this helps!

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

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

* Re: Use .authinfo for git credentials
  2018-04-25 10:07 ` Marius Bakke
@ 2018-04-25 10:17   ` Pierre Neidhardt
  2018-04-25 10:42     ` Marius Bakke
  2018-04-25 19:02   ` Efraim Flashner
  1 sibling, 1 reply; 8+ messages in thread
From: Pierre Neidhardt @ 2018-04-25 10:17 UTC (permalink / raw)
  To: Marius Bakke; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 1333 bytes --]


Marius Bakke <mbakke@fastmail.com> writes:

> I use 'msmtp' as the transport and have configured it to look up
> passwords from 'password-store'.
>
> $ git config --get-regexp sendemail.*
> sendemail.smtpserver /home/marius/.guix-profile/bin/msmtp
> sendemail.envelopesender auto

From the (1)git-send-email man page:

--8<---------------cut here---------------start------------->8---
       --smtp-server=<host>
           If set, specifies the outgoing SMTP server to use (e.g.
           smtp.example.com or a raw IP address). Alternatively it can specify
           a full pathname of a sendmail-like program instead; the program
           must support the -i option. Default value can be specified by the
           sendemail.smtpServer configuration option; the built-in default is
           to search for sendmail in /usr/sbin, /usr/lib and $PATH if such
           program is available, falling back to localhost otherwise.
--8<---------------cut here---------------end--------------->8---

The smtp program must support the -i option.

I use Emacs' message-send to send e-mails.
I don't think Emacs accepts the -i option.

I could write a wrapper, but I don't think this is the most ideal
option.

-- 
Pierre Neidhardt

"Success covers a multitude of blunders."
-- George Bernard Shaw

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

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

* Re: Use .authinfo for git credentials
  2018-04-25 10:17   ` Pierre Neidhardt
@ 2018-04-25 10:42     ` Marius Bakke
  0 siblings, 0 replies; 8+ messages in thread
From: Marius Bakke @ 2018-04-25 10:42 UTC (permalink / raw)
  To: Pierre Neidhardt; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 1777 bytes --]

Pierre Neidhardt <ambrevar@gmail.com> writes:

> Marius Bakke <mbakke@fastmail.com> writes:
>
>> I use 'msmtp' as the transport and have configured it to look up
>> passwords from 'password-store'.
>>
>> $ git config --get-regexp sendemail.*
>> sendemail.smtpserver /home/marius/.guix-profile/bin/msmtp
>> sendemail.envelopesender auto
>
> From the (1)git-send-email man page:
>
> --8<---------------cut here---------------start------------->8---
>        --smtp-server=<host>
>            If set, specifies the outgoing SMTP server to use (e.g.
>            smtp.example.com or a raw IP address). Alternatively it can specify
>            a full pathname of a sendmail-like program instead; the program
>            must support the -i option. Default value can be specified by the
>            sendemail.smtpServer configuration option; the built-in default is
>            to search for sendmail in /usr/sbin, /usr/lib and $PATH if such
>            program is available, falling back to localhost otherwise.
> --8<---------------cut here---------------end--------------->8---
>
> The smtp program must support the -i option.
>
> I use Emacs' message-send to send e-mails.
> I don't think Emacs accepts the -i option.
>
> I could write a wrapper, but I don't think this is the most ideal
> option.

I see.  FWIW my emacs uses 'msmtp' too, with this snippet:

(setq mail-specify-envelope-from t
      message-sendmail-envelope-from 'header
      mail-envelope-from 'header
      sendmail-program "/home/marius/.guix-profile/bin/msmtp"
      mail-host-address "fastmail.com"
      send-mail-function 'message-send-mail-with-sendmail
      message-send-mail-function 'message-send-mail-with-sendmail
      message-directory "~/Mail/drafts"
      message-kill-buffer-on-exit t)

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

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

* Re: Use .authinfo for git credentials
  2018-04-25 10:07 ` Marius Bakke
  2018-04-25 10:17   ` Pierre Neidhardt
@ 2018-04-25 19:02   ` Efraim Flashner
  1 sibling, 0 replies; 8+ messages in thread
From: Efraim Flashner @ 2018-04-25 19:02 UTC (permalink / raw)
  To: Marius Bakke; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 952 bytes --]

On Wed, Apr 25, 2018 at 12:07:35PM +0200, Marius Bakke wrote:
> Pierre Neidhardt <ambrevar@gmail.com> writes:
> 
> > Or else how do you people configure `git send-email' to not prompt for a
> > password?
> 
> I use 'msmtp' as the transport and have configured it to look up
> passwords from 'password-store'.
> 
> $ git config --get-regexp sendemail.*
> sendemail.smtpserver /home/marius/.guix-profile/bin/msmtp
> sendemail.envelopesender auto
> 
> My ~/.msmtprc contains a line such as
> 'passwordeval "pass Email/fm/mbakke/out 2>/dev/null"'.  Obviously you
> can use any other shell command here.
> 
> Hope this helps!

The similar line in my .msmtprc is:
passwordeval gpg --no-tty -q -d $HOME/.msmtp.password.gpg


-- 
Efraim Flashner   <efraim@flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: Use .authinfo for git credentials
  2018-04-25  9:23 Use .authinfo for git credentials Pierre Neidhardt
  2018-04-25 10:07 ` Marius Bakke
@ 2018-04-27  3:11 ` Chris Marusich
  2018-04-27  9:23   ` Pierre Neidhardt
  1 sibling, 1 reply; 8+ messages in thread
From: Chris Marusich @ 2018-04-27  3:11 UTC (permalink / raw)
  To: Pierre Neidhardt; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 1205 bytes --]

Pierre Neidhardt <ambrevar@gmail.com> writes:

> I would like `git send-email` to use the credentials from ~/.authinfo.gpg
> to send patches to the Guix mailing list.
>
> While not related to Guix code per se, I'm posting this here because I
> primarily use `git send-email` for Guix and I suppose people around here
> must have an answer to that question.
>
> Or else how do you people configure `git send-email' to not prompt for a
> password?
>
> All I've found so far is this:
>
> 	https://github.com/git/git/blob/master/contrib/credential/netrc/git-credential-netrc

At first blush, this looks like the right solution given your problem
statement.  I believe this is actually included in the Git source under
the contrib/credential subdirectory.  We just don't build it today.
Perhaps you could submit a patch to build it?  I wonder if it would be
simpler to define a separate package that builds it from the source
you've linked above, rather than trying to build it within the (already
rather large) Git package definition.

I type my password when I invoke git-send-email, and it makes me a
little sad inside every time, so I'd love to be able to use this!

-- 
Chris

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

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

* Re: Use .authinfo for git credentials
  2018-04-27  3:11 ` Chris Marusich
@ 2018-04-27  9:23   ` Pierre Neidhardt
  2018-05-18  9:26     ` Pierre Neidhardt
  0 siblings, 1 reply; 8+ messages in thread
From: Pierre Neidhardt @ 2018-04-27  9:23 UTC (permalink / raw)
  To: Chris Marusich; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 137 bytes --]


Yes, that sounds like the right approach.  I'll look into packaging it then!

-- 
Pierre Neidhardt

The other line moves faster.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

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

* Re: Use .authinfo for git credentials
  2018-04-27  9:23   ` Pierre Neidhardt
@ 2018-05-18  9:26     ` Pierre Neidhardt
  0 siblings, 0 replies; 8+ messages in thread
From: Pierre Neidhardt @ 2018-05-18  9:26 UTC (permalink / raw)
  To: Chris Marusich; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 464 bytes --]


I've sent a patch to add the git:credential-netrc output: #31488.

I went down the road of a new output because:

- It's part of the same repository as git, so I wanted to avoid
duplicating code and effort.

- Users will not want to clutter their PATH with a collection of
credentials, they will probably want to use only one.  With a dedicated
output they are free to choose which one.

-- 
Pierre Neidhardt

We have DIFFERENT amounts of HAIR --

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

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

end of thread, other threads:[~2018-05-18  9:26 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-25  9:23 Use .authinfo for git credentials Pierre Neidhardt
2018-04-25 10:07 ` Marius Bakke
2018-04-25 10:17   ` Pierre Neidhardt
2018-04-25 10:42     ` Marius Bakke
2018-04-25 19:02   ` Efraim Flashner
2018-04-27  3:11 ` Chris Marusich
2018-04-27  9:23   ` Pierre Neidhardt
2018-05-18  9:26     ` Pierre Neidhardt

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).