From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Michael J Gruber <git@drmicha.warpmail.net>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>,
Marc Kleine-Budde <m.kleine-budde@pengutronix.de>
Subject: Re: [PATCH] send-email: lazily assign editor variable
Date: Mon, 22 Mar 2010 17:41:52 +0100 [thread overview]
Message-ID: <20100322164152.GA30332@pengutronix.de> (raw)
In-Reply-To: <eb0d92cf28820eb9783e789a8c4c62c3af4dd0d0.1269274203.git.git@drmicha.warpmail.net>
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@drmicha.warpmail.net>
> Reported-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
> 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@pengutronix.de>
Best regards and thanks for the quick response,
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
next prev parent reply other threads:[~2010-03-22 16:42 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-22 14:59 [REGRESSION] git var GIT_EDITOR fails without tty Uwe Kleine-König
2010-03-22 16:12 ` [PATCH] send-email: lazily assign editor variable Michael J Gruber
2010-03-22 16:41 ` Uwe Kleine-König [this message]
2010-03-23 0:58 ` Jonathan Nieder
2010-03-23 10:56 ` Michael J Gruber
2010-03-24 17:52 ` Junio C Hamano
2010-03-25 5:17 ` Jonathan Nieder
2010-03-26 19:32 ` Junio C Hamano
2010-03-26 21:45 ` Jonathan Nieder
2010-03-25 8:03 ` Michael J Gruber
2010-03-26 19:32 ` Junio C Hamano
2010-03-22 23:25 ` [PATCH] send-email: do not check for editor until needed Jonathan Nieder
2010-03-23 9:15 ` Peter Kjellerstedt
2010-03-23 19:25 ` Jonathan Nieder
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100322164152.GA30332@pengutronix.de \
--to=u.kleine-koenig@pengutronix.de \
--cc=git@drmicha.warpmail.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=m.kleine-budde@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).