All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael J Gruber <git@drmicha.warpmail.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	"Jonathan Nieder" <jrnieder@gmail.com>
Subject: Re: [PATCH] send-email: lazily assign editor variable
Date: Thu, 25 Mar 2010 09:03:18 +0100	[thread overview]
Message-ID: <4BAB18C6.6010202@drmicha.warpmail.net> (raw)
In-Reply-To: <7vaatxobef.fsf@alter.siamese.dyndns.org>

Junio C Hamano venit, vidit, dixit 24.03.2010 18:52:
> Michael J Gruber <git@drmicha.warpmail.net> writes:
> 
>> 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.
> 
> We would want to describe what kind of problems they are better than "may
> lead to problems", though.  Something like this?
> 
>     b4479f0 (add -i, send-email, svn, p4, etc: use "git var GIT_EDITOR",
>     2009-10-30) introduced the use of "git var GIT_EDITOR" to obtain the
>     preferred editor program, instead of reading environment variables
>     themselves.
> 
>     However, "git var GIT_EDITOR" run without a tty (think "cron job") would

Also think "hook" ;)

>     give a fatal error "Terminal is dumb, but EDITOR unset".  This is not a
>     problem for add-i, svn, p4 and callers of git_editor() defined in
>     git-sh-setup, as all of these call it just before launching the editor.
>     At that point, we know the caller wants to edit, and they cannot without a
>     tty.
> 
>     But send-email ran this near the beginning of the program, even if it is
>     not going to use any editor (e.g. run without --compose).  Fix this by
>     calling the command only when we edit a file.
> 
> 

Yep, I'm fine with this.

Cheers,
Michael

  parent reply	other threads:[~2010-03-25  8:06 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
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 [this message]
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=4BAB18C6.6010202@drmicha.warpmail.net \
    --to=git@drmicha.warpmail.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jrnieder@gmail.com \
    --cc=u.kleine-koenig@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.