[PATCH] send-email: simplify Gmail example in the documentation

2018-04-07 Thread Michal Nazarewicz
There is no need for use to manually call ‘git credential’ especially as the interface isn’t super user-friendly and a bit confusing. ‘git send-email’ will do that for them at the first execution and if the password matches, it will be saved in the store. Simplify the documentaion so it dosn’t in

[PATCH] send-email: fix docs regarding storing password with git credential

2018-04-02 Thread Michal Nazarewicz
First of all, ‘git credential fill’ does not store credentials but is used to *read* them. The command which adds credentials to the helper’s store is ‘git credential approve’. Second of all, git-send-email will include port number in host parameter when getting the password so it has to be set w

[PATCH] send-email: report host and port separately when calling git credential

2018-03-31 Thread Michal Nazarewicz
When git-send-email uses git-credential to get SMTP password, it will communicate SMTP host and port (if both are provided) as a single entry ‘host=:’. This trips the ‘git-credential-store’ helper which expects those values as separate keys (‘host’ and ‘port’). Send the values as separate pieces

[PATCH] path: for clarity, rename get_pathname to get_path_buffer

2014-07-08 Thread Michal Nazarewicz
The get_pathname function does not really return path name but rather a buffer to store pathname in. As such, current name is a bit confusing. Change the name as to make it clearer what the function is doing. Signed-off-by: Michal Nazarewicz --- path.c | 8 1 file changed, 4

[PATCH] path: for clarity, rename get_pathname to get_path_buffer

2014-07-08 Thread Michal Nazarewicz
The get_pathname function does not really return path name but rather a buffer to store pathname in. As such, current name is a bit confusing. Change the name as to make it clearer what the function is doing. Signed-off-by: Michal Nazarewicz --- path.c | 8 1 file changed, 4

Re: [PATCH] Remove dead link

2013-08-23 Thread Michal Nazarewicz
On Fri, Aug 23 2013, Junio C Hamano wrote: > That is unfortunate, especially given the last line that the patch > removes. Has anybody asked pastebin folks why it is gone and if it > can be resurrected? Way Back Machine has nothing. What was under that link? If IRC logs, then those appear to be

[PATCH] Remove dead link

2013-08-23 Thread Michal Nazarewicz
From: Michal Nazarewicz Signed-off-by: Michal Nazarewicz --- Documentation/technical/pack-heuristics.txt | 6 -- 1 file changed, 6 deletions(-) diff --git a/Documentation/technical/pack-heuristics.txt b/Documentation/technical/pack-heuristics.txt index 8b7ae1c..b7bd951 100644 --- a

Re: [PATCHv4 6/6] git-send-email: use git credential to obtain password

2013-02-27 Thread Michal Nazarewicz
On Wed, Feb 27 2013, Junio C Hamano wrote: > Matthieu Moy writes: > >> Michal Nazarewicz writes: >> >>> + $auth = Git::credential({ >>> + 'protocol' => 'smtp', >>> + 'host' => join(':&#x

Re: [PATCHv4 4/6] Git.pm: allow pipes to be closed prior to calling command_close_bidi_pipe

2013-02-12 Thread Michal Nazarewicz
On Tue, Feb 12 2013, Junio C Hamano wrote: > I would actually vote for the most explicit: > > _cmd_close($ctx, (grep { defined } ($in, $out))); To me that looks weird at best, but I don't have strong opinions on that matter. -- Best regards, _ _

Re: [PATCHv4 4/6] Git.pm: allow pipes to be closed prior to calling command_close_bidi_pipe

2013-02-12 Thread Michal Nazarewicz
On Tue, Feb 12 2013, Jeff King wrote: > On Tue, Feb 12, 2013 at 03:02:31PM +0100, Michal Nazarewicz wrote: > >> sub command_close_bidi_pipe { >> local $?; >> my ($self, $pid, $in, $out, $ctx) = _maybe_self(@_); >> -_cmd_close($ctx, $in, $out); >>

Re: [PATCHv4 3/6] Git.pm: refactor command_close_bidi_pipe to use _cmd_close

2013-02-12 Thread Michal Nazarewicz
>> Michal Nazarewicz writes: >> > The body of the loop in command_close_bidi_pipe function is identical to >> > what _cmd_close function does so instead of duplicating, refactor change >> > _cmd_close so that it accepts list of file handlers to be closed, which

[PATCHv4 3/6] Git.pm: refactor command_close_bidi_pipe to use _cmd_close

2013-02-12 Thread Michal Nazarewicz
From: Michal Nazarewicz The body of the loop in command_close_bidi_pipe function is identical to what _cmd_close function does so instead of duplicating, refactor change _cmd_close so that it accepts list of file handlers to be closed, which makes it usable with command_close_bidi_pipe. Signed

[PATCHv4 2/6] Git.pm: fix example in command_close_bidi_pipe documentation

2013-02-12 Thread Michal Nazarewicz
From: Michal Nazarewicz Signed-off-by: Michal Nazarewicz --- perl/Git.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/perl/Git.pm b/perl/Git.pm index bbb753a..11f310a 100644 --- a/perl/Git.pm +++ b/perl/Git.pm @@ -418,7 +418,7 @@ and it is the fourth value returned by

[PATCHv4 5/6] Git.pm: add interface for git credential command

2013-02-12 Thread Michal Nazarewicz
From: Michal Nazarewicz Add a credential() function which is an interface to the git credential command. The code is heavily based on credential_* functions in . Signed-off-by: Michal Nazarewicz --- perl/Git.pm | 151 1 file

[PATCHv4 1/6] Git.pm: allow command_close_bidi_pipe to be called as method

2013-02-12 Thread Michal Nazarewicz
From: Michal Nazarewicz The documentation of command_close_bidi_pipe() claims that it can be called as a method, but it does not check whether the first argument is $self or not assuming the latter. Using _maybe_self() fixes this. Signed-off-by: Michal Nazarewicz --- perl/Git.pm | 2 +- 1

[PATCHv4 6/6] git-send-email: use git credential to obtain password

2013-02-12 Thread Michal Nazarewicz
From: Michal Nazarewicz If smtp_user is provided but smtp_pass is not, instead of prompting for password, make git-send-email use git credential command instead. Signed-off-by: Michal Nazarewicz --- Documentation/git-send-email.txt | 4 +-- git-send-email.perl | 59

[PATCHv4 0/6] git-credential support in git-send-email

2013-02-12 Thread Michal Nazarewicz
From: Michal Nazarewicz Besids git-credential support in git-send-email, there are some other minor improvements to Git.pm in this patchset. Patch 3/6 is new compared to the previous patchset. Michal Nazarewicz (6): Git.pm: allow command_close_bidi_pipe to be called as method Git.pm: fix

[PATCHv4 4/6] Git.pm: allow pipes to be closed prior to calling command_close_bidi_pipe

2013-02-12 Thread Michal Nazarewicz
From: Michal Nazarewicz The command_close_bidi_pipe() function will insist on closing both input and output pipes returned by command_bidi_pipe(). With this change it is possible to close one of the pipes in advance and pass undef as an argument. Signed-off-by: Michal Nazarewicz --- perl

Re: [PATCHv3 0/5] Add git-credential support to git-send-email

2013-02-11 Thread Michal Nazarewicz
On Mon, Feb 11 2013, Jeff King wrote: > Based on our discussion, I think it would just need the patch below > squashed into your 4/5 (this handles the "undef" thing, and I also fixed > a few typos in the API documentation): > @@ -1152,7 +1155,9 @@ sub credential { > if ('CODE' eq ref $op_or_

Re: [PATCHv3 0/5] Add git-credential support to git-send-email

2013-02-11 Thread Michal Nazarewicz
On Mon, Feb 11 2013, Jeff King wrote: > I have two minor comments, which I'll reply inline with. But even with > those comments, I think this would be OK to merge. I'll send a new patchset tomorrow with. -- Best regards, _ _ .o. | Liege of Serenely Enl

Re: [PATCHv3 5/5] git-send-email: use git credential to obtain password

2013-02-11 Thread Michal Nazarewicz
> On Mon, Feb 11, 2013 at 05:23:39PM +0100, Michal Nazarewicz wrote: >> +# TODO: Authentication may fail not because credentials were >> +# invalid but due to other reasons, in which we should not >> +# reject credentials. >> +$auth = Git::credential(

Re: [PATCHv3 4/5] Git.pm: add interface for git credential command

2013-02-11 Thread Michal Nazarewicz
On Mon, Feb 11 2013, Jeff King wrote: > On Mon, Feb 11, 2013 at 05:23:38PM +0100, Michal Nazarewicz wrote: > >> +=item credential_read( FILE_HANDLE ) >> + >> +Reads credential key-value pairs from C. Reading stops at EOF >> or >> +when an empty line is encount

[PATCHv3 5/5] git-send-email: use git credential to obtain password

2013-02-11 Thread Michal Nazarewicz
From: Michal Nazarewicz If smtp_user is provided but smtp_pass is not, instead of prompting for password, make git-send-email use git credential command instead. Signed-off-by: Michal Nazarewicz --- Documentation/git-send-email.txt | 4 +-- git-send-email.perl | 59

[PATCHv3 4/5] Git.pm: add interface for git credential command

2013-02-11 Thread Michal Nazarewicz
From: Michal Nazarewicz Add a credential() function which is an interface to the git credential command. The code is heavily based on credential_* functions in . Signed-off-by: Michal Nazarewicz --- perl/Git.pm | 148 +++- 1 file

[PATCHv3 2/5] Git.pm: fix example in command_close_bidi_pipe documentation

2013-02-11 Thread Michal Nazarewicz
From: Michal Nazarewicz Signed-off-by: Michal Nazarewicz --- perl/Git.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/perl/Git.pm b/perl/Git.pm index bbb753a..11f310a 100644 --- a/perl/Git.pm +++ b/perl/Git.pm @@ -418,7 +418,7 @@ and it is the fourth value returned by

[PATCHv3 1/5] Git.pm: allow command_close_bidi_pipe to be called as method

2013-02-11 Thread Michal Nazarewicz
From: Michal Nazarewicz The documentation of command_close_bidi_pipe() claims that it can be called as a method, but it does not check whether the first argument is $self or not assuming the latter. Using _maybe_self() fixes this. Signed-off-by: Michal Nazarewicz --- perl/Git.pm | 2 +- 1

[PATCHv3 3/5] Git.pm: allow pipes to be closed prior to calling command_close_bidi_pipe

2013-02-11 Thread Michal Nazarewicz
From: Michal Nazarewicz The command_close_bidi_pipe() function will insist on closing both input and output pipes returned by command_bidi_pipe(). With this change it is possible to close one of the pipes in advance and pass undef as an argument. Signed-off-by: Michal Nazarewicz --- perl

[PATCHv3 0/5] Add git-credential support to git-send-email

2013-02-11 Thread Michal Nazarewicz
From: Michal Nazarewicz The third version of the patch with changes suggested by Jeff in the 4/5 patch. Also credential_read and credential_write are now public functions in case someone wants to write a helper in perl. Michal Nazarewicz (5): Git.pm: allow command_close_bidi_pipe to be

Re: [PATCHv2 4/5] Git.pm: add interface for git credential command

2013-02-07 Thread Michal Nazarewicz
On Fri, Feb 08 2013, Junio C Hamano wrote: > I'd actually be more worried about the error checking issue > Peff raised during his review. I have a feeling that "when in doubt, > do not cause harm" is a more prudent way to go than "I do not know, > so I'll let anything pass". I can implement whate

[PATCHv2 5/5] git-send-email: use git credential to obtain password

2013-02-07 Thread Michal Nazarewicz
From: Michal Nazarewicz If smtp_user is provided but smtp_pass is not, instead of prompting for password, make git-send-email use git credential command instead. Signed-off-by: Michal Nazarewicz --- Documentation/git-send-email.txt | 4 +-- git-send-email.perl | 59

[PATCHv2 3/5] Git.pm: allow pipes to be closed prior to calling command_close_bidi_pipe

2013-02-07 Thread Michal Nazarewicz
From: Michal Nazarewicz The command_close_bidi_pipe() function will insist on closing both input and output pipes returned by command_bidi_pipe(). With this change it is possible to close one of the pipes in advance and pass undef as an argument. Signed-off-by: Michal Nazarewicz --- perl

[PATCHv2 2/5] Git.pm: fix example in command_close_bidi_pipe documentation

2013-02-07 Thread Michal Nazarewicz
From: Michal Nazarewicz File handle goes as the first argument when calling print on it. Signed-off-by: Michal Nazarewicz --- perl/Git.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/perl/Git.pm b/perl/Git.pm index bbb753a..11f310a 100644 --- a/perl/Git.pm +++ b/perl

[PATCHv2 4/5] Git.pm: add interface for git credential command

2013-02-07 Thread Michal Nazarewicz
From: Michal Nazarewicz Add a credential() function which is an interface to the git credential command. The code is heavily based on credential_* functions in . Signed-off-by: Michal Nazarewicz --- perl/Git.pm | 110 +++- 1 file

[PATCHv2 1/5] Git.pm: allow command_close_bidi_pipe to be called as method

2013-02-07 Thread Michal Nazarewicz
From: Michal Nazarewicz The documentation of command_close_bidi_pipe() claims that it can be called as a method, but it does not check whether the first argument is $self or not assuming the latter. Using _maybe_self() fixes this. Signed-off-by: Michal Nazarewicz --- perl/Git.pm | 2 +- 1

[PATCHv2 0/5] Make git-send-email use git-credential

2013-02-07 Thread Michal Nazarewicz
From: Michal Nazarewicz Minor fixes as suggested in emails. Michal Nazarewicz (5): Git.pm: allow command_close_bidi_pipe to be called as method Git.pm: fix example in command_close_bidi_pipe documentation Git.pm: allow pipes to be closed prior to calling command_close_bidi_pipe

[PATCH 4/4] git-send-email: Use git credential to obtain password.

2013-02-06 Thread Michal Nazarewicz
From: Michal Nazarewicz If smtp_user is provided but smtp_pass is not, instead of prompting for password, make git-send-email use git credential command instead. Signed-off-by: Michal Nazarewicz --- Documentation/git-send-email.txt | 4 +-- git-send-email.perl | 59

[PATCH 3/4] Git.pm: Add interface for git credential command.

2013-02-06 Thread Michal Nazarewicz
From: Michal Nazarewicz Add a credential() function which is an interface to the git credential command. Signed-off-by: Michal Nazarewicz --- perl/Git.pm | 112 +++- 1 file changed, 111 insertions(+), 1 deletion(-) diff --git a/perl

[PATCH 1/4] Git.pm: Allow command_close_bidi_pipe() to be called as method

2013-02-06 Thread Michal Nazarewicz
From: Michal Nazarewicz The documentation of command_close_bidi_pipe() claims that it can be called as a method, but it does not check whether the first argument is $self or not assuming the latter. Using _maybe_self() fixes this. Signed-off-by: Michal Nazarewicz --- perl/Git.pm | 2 +- 1

[PATCH 2/4] Git.pm: Allow pipes to be closed prior to calling command_close_bidi_pipe

2013-02-06 Thread Michal Nazarewicz
From: Michal Nazarewicz The command_close_bidi_pipe() function will insist on closing both input and output pipes returned by command_bidi_pipe(). With this change it is possible to close one of the pipes in advance and pass undef as an argument. This allows for something like: my ($pid

[PATCH 0/4] Make git-send-email git-credential

2013-02-06 Thread Michal Nazarewicz
From: Michal Nazarewicz As discussed on the list, adding git-credential interface to Git.pm (sort of copied from git-remote-mediawiki) and making git-send-email use it. I see git-remote-mediawiki does not have “use Git” so I did not touch it. On top of that I'd have no way to tests the ch

Re: [PATCH 0/4] Make git-send-email git-credential

2013-02-06 Thread Michal Nazarewicz
On Wed, Feb 06 2013, Michal Nazarewicz wrote: > As discussed on the list, adding git-credential interface to Git.pm > (sort of copied from git-remote-mediawiki) and making git-send-email > use it. > > I see git-remote-mediawiki does not have “use Git” so I did not touch > it.

[PATCH 0/4] Make git-send-email git-credential

2013-02-06 Thread Michal Nazarewicz
From: Michal Nazarewicz As discussed on the list, adding git-credential interface to Git.pm (sort of copied from git-remote-mediawiki) and making git-send-email use it. I see git-remote-mediawiki does not have “use Git” so I did not touch it. On top of that I'd have no way to tests the ch

Re: [PATCH] git-send-email: add ~/.authinfo parsing

2013-02-06 Thread Michal Nazarewicz
On Wed, Feb 06 2013, Junio C Hamano wrote: > I see a lot of rerolls on the credential helper front, but is there > anybody working on hooking send-email to the credential framework? I assumed someone had, but if not I can take a stab at it. I'm not sure however how should I map server, server-po

Re: [PATCH] git-send-email: add ~/.authinfo parsing

2013-02-04 Thread Michal Nazarewicz
On Wed, Jan 30 2013, Jeff King wrote: > I do not mind a .netrc or .authinfo parser, because while those formats > do have security problems, they are standard files that may already be > in use. So as long as we are not encouraging their use, I do not see a > problem in supporting them (and we alre

[PATCHv3] git-send-email: add ~/.authinfo parsing

2013-01-29 Thread Michal Nazarewicz
From: Michal Nazarewicz Make git-send-email read password from a ~/.authinfo or ~/.netrc file instead of requiring it to be stored in git configuration, passed as command line argument or typed in. There are various other applications that use this file for authentication information so letting

[PATCHv2] git-send-email: add ~/.authinfo parsing

2013-01-29 Thread Michal Nazarewicz
From: Michal Nazarewicz Make git-send-email read password from a ~/.authinfo or a ~/.netrc file instead of requiring it to be stored in git configuration, passed as command line argument or typed in. There are various other applications that use this file for authentication information so

[PATCH] git-send-email: add ~/.authinfo parsing

2013-01-29 Thread Michal Nazarewicz
From: Michal Nazarewicz Make git-send-email read password from a ~/.authinfo file instead of requiring it to be stored in git configuration, passed as command line argument or typed in. There are various other applications that use this file for authentication information so letting users use