Re: [PATCH] send-email: lazily assign editor variable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Michael,

On Mon, Mar 22, 2010 at 05:12:53PM +0100, Michael J Gruber wrote:
> b4479f0 (add -i, send-email, svn, p4, etc: use "git var GIT_EDITOR",
> 2009-10-30) introduced the use of git var GIT_EDITOR which may lead to
> problems when send-mail is used without a tty.
> 
> Therefore, use git var GIT_EDITOR only when we actually edit something.
> 
> Signed-off-by: Michael J Gruber <git@xxxxxxxxxxxxxxxxxxxx>
> Reported-by: Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxxxx>
> ---
>  git-send-email.perl |    5 ++++-
>  1 files changed, 4 insertions(+), 1 deletions(-)
> 
> diff --git a/git-send-email.perl b/git-send-email.perl
> index d612ae8..bb09c0d 100755
> --- a/git-send-email.perl
> +++ b/git-send-email.perl
> @@ -162,9 +162,12 @@ my $compose_filename;
>  
>  # Handle interactive edition of files.
>  my $multiedit;
> -my $editor = Git::command_oneline('var', 'GIT_EDITOR');
> +my $editor;
>  
>  sub do_edit {
> +	if (!defined($editor)) {
> +		$editor = Git::command_oneline('var', 'GIT_EDITOR');
> +	}
>  	if (defined($multiedit) && !$multiedit) {
>  		map {
>  			system('sh', '-c', $editor.' "$@"', $editor, $_);
I havn't tested yet, but (maybe apart from a comment) this looks exactly
like the patch I would have done if I knew perl :-)

So, Acked-by: Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxxxx>

Best regards and thanks for the quick response,
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]