git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* git send-email should always ask for in-reply-to
@ 2010-06-01 14:41 Alexander Stein
  2010-06-01 15:46 ` Matthieu Moy
  0 siblings, 1 reply; 8+ messages in thread
From: Alexander Stein @ 2010-06-01 14:41 UTC (permalink / raw)
  To: git

Hi,

i currently have the problem that, if I set sendemail.from and sendemail.to in 
git-config (from global and to project-specific but that doesn't matter) git 
send-email doesn't ask me for a in-reply-to message-ID. I set these 2 config 
options for convenience. But i also want to specify a message-id after calling 
git send-email to get a proper thread on the mailing list.
I dived into git-send-email.perl and found $prompting which is only != 0 if 
$sender or @to isn't already set (lines 672-685). On line 706-709 there are 
some check whether $initial_reply_to should be asked or not. If $prompting is 
sitll 0 $initial_reply_to will not be asked.
In my opinion git send-email should always ask for in-reply-to. I know there 
is --in-reply-to option but this keeps me from using the git command from 
shell history as i have to modify the parameter each time.

What do you think about it?
Best regards
Alexander

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

* Re: git send-email should always ask for in-reply-to
  2010-06-01 14:41 git send-email should always ask for in-reply-to Alexander Stein
@ 2010-06-01 15:46 ` Matthieu Moy
  2010-06-01 18:08   ` [PATCH] send-email: Ask for in-reply message ID even if from and to is already known Alexander Stein
  0 siblings, 1 reply; 8+ messages in thread
From: Matthieu Moy @ 2010-06-01 15:46 UTC (permalink / raw)
  To: Alexander Stein; +Cc: git

Alexander Stein <alexander.stein@informatik.tu-chemnitz.de> writes:

> i currently have the problem that, if I set sendemail.from and sendemail.to in 
> git-config (from global and to project-specific but that doesn't matter) git 
> send-email doesn't ask me for a in-reply-to message-ID.
[...]
> What do you think about it?

I do find this annoying: my name doesn't change often, so I want to
give it in ~/.gitconfig, but then the prompt for a message-id
disapears. But I didn't find time to make a patch :-(.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

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

* [PATCH] send-email: Ask for in-reply message ID even if from and to is already known
  2010-06-01 15:46 ` Matthieu Moy
@ 2010-06-01 18:08   ` Alexander Stein
  2010-06-10 17:08     ` Alexander Stein
  2010-06-10 22:28     ` Matthieu Moy
  0 siblings, 2 replies; 8+ messages in thread
From: Alexander Stein @ 2010-06-01 18:08 UTC (permalink / raw)
  To: git; +Cc: Alexander Stein

This patch removes the prompting variable so git send-email always asks
for a in-reply message ID (unless specified on command line) even when
sendemail.from and sendemail.to is set in ~/.gitconfig or .git/config

Signed-off-by: Alexander Stein <alexander.stein@informatik.tu-chemnitz.de>
---
 git-send-email.perl |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/git-send-email.perl b/git-send-email.perl
index 111c981..4487472 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -136,7 +136,7 @@ my $auth;
 sub unique_email_list(@);
 sub cleanup_compose_files();
 
-# Variables we fill in automatically, or via prompting:
+# Variables we fill in automatically:
 my (@to,$no_to,@cc,$no_cc,@initial_cc,@bcclist,$no_bcc,@xh,
 	$initial_reply_to,$initial_subject,@files,
 	$author,$sender,$smtp_authpass,$annotate,$compose,$time);
@@ -669,19 +669,16 @@ sub ask {
 	return undef;
 }
 
-my $prompting = 0;
 if (!defined $sender) {
 	$sender = $repoauthor || $repocommitter || '';
 	$sender = ask("Who should the emails appear to be from? [$sender] ",
 	              default => $sender);
 	print "Emails will be sent from: ", $sender, "\n";
-	$prompting++;
 }
 
 if (!@to) {
 	my $to = ask("Who should the emails be sent to? ");
 	push @to, parse_address_line($to) if defined $to; # sanitized/validated later
-	$prompting++;
 }
 
 sub expand_aliases {
@@ -703,7 +700,7 @@ sub expand_one_alias {
 @initial_cc = expand_aliases(@initial_cc);
 @bcclist = expand_aliases(@bcclist);
 
-if ($thread && !defined $initial_reply_to && $prompting) {
+if ($thread && !defined $initial_reply_to) {
 	$initial_reply_to = ask(
 		"Message-ID to be used as In-Reply-To for the first email? ");
 }
-- 
1.6.4.4

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

* Re: [PATCH] send-email: Ask for in-reply message ID even if from and to is already known
  2010-06-01 18:08   ` [PATCH] send-email: Ask for in-reply message ID even if from and to is already known Alexander Stein
@ 2010-06-10 17:08     ` Alexander Stein
  2010-06-10 17:18       ` Ævar Arnfjörð Bjarmason
  2010-06-11 19:06       ` Junio C Hamano
  2010-06-10 22:28     ` Matthieu Moy
  1 sibling, 2 replies; 8+ messages in thread
From: Alexander Stein @ 2010-06-10 17:08 UTC (permalink / raw)
  To: git

Did get this patch overlooked?

Am Dienstag 01 Juni 2010, 20:08:50 schrieb Alexander Stein:
> This patch removes the prompting variable so git send-email always asks
> for a in-reply message ID (unless specified on command line) even when
> sendemail.from and sendemail.to is set in ~/.gitconfig or .git/config
> 
> Signed-off-by: Alexander Stein <alexander.stein@informatik.tu-chemnitz.de>
> ---
>  git-send-email.perl |    7 ++-----
>  1 files changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/git-send-email.perl b/git-send-email.perl
> index 111c981..4487472 100755
> --- a/git-send-email.perl
> +++ b/git-send-email.perl
> @@ -136,7 +136,7 @@ my $auth;
>  sub unique_email_list(@);
>  sub cleanup_compose_files();
> 
> -# Variables we fill in automatically, or via prompting:
> +# Variables we fill in automatically:
>  my (@to,$no_to,@cc,$no_cc,@initial_cc,@bcclist,$no_bcc,@xh,
>  	$initial_reply_to,$initial_subject,@files,
>  	$author,$sender,$smtp_authpass,$annotate,$compose,$time);
> @@ -669,19 +669,16 @@ sub ask {
>  	return undef;
>  }
> 
> -my $prompting = 0;
>  if (!defined $sender) {
>  	$sender = $repoauthor || $repocommitter || '';
>  	$sender = ask("Who should the emails appear to be from? [$sender] ",
>  	              default => $sender);
>  	print "Emails will be sent from: ", $sender, "\n";
> -	$prompting++;
>  }
> 
>  if (!@to) {
>  	my $to = ask("Who should the emails be sent to? ");
>  	push @to, parse_address_line($to) if defined $to; # sanitized/validated
> later -	$prompting++;
>  }
> 
>  sub expand_aliases {
> @@ -703,7 +700,7 @@ sub expand_one_alias {
>  @initial_cc = expand_aliases(@initial_cc);
>  @bcclist = expand_aliases(@bcclist);
> 
> -if ($thread && !defined $initial_reply_to && $prompting) {
> +if ($thread && !defined $initial_reply_to) {
>  	$initial_reply_to = ask(
>  		"Message-ID to be used as In-Reply-To for the first email? ");
>  }

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

* Re: [PATCH] send-email: Ask for in-reply message ID even if from and  to is already known
  2010-06-10 17:08     ` Alexander Stein
@ 2010-06-10 17:18       ` Ævar Arnfjörð Bjarmason
  2010-06-11 19:06       ` Junio C Hamano
  1 sibling, 0 replies; 8+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2010-06-10 17:18 UTC (permalink / raw)
  To: Alexander Stein; +Cc: git

On Thu, Jun 10, 2010 at 17:08, Alexander Stein
<alexander.stein@informatik.tu-chemnitz.de> wrote:
> Did get this patch overlooked?

Perhaps it would be better accompanied with a test addition in
t9001-send-email.sh.

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

* Re: [PATCH] send-email: Ask for in-reply message ID even if from and to is already known
  2010-06-01 18:08   ` [PATCH] send-email: Ask for in-reply message ID even if from and to is already known Alexander Stein
  2010-06-10 17:08     ` Alexander Stein
@ 2010-06-10 22:28     ` Matthieu Moy
  1 sibling, 0 replies; 8+ messages in thread
From: Matthieu Moy @ 2010-06-10 22:28 UTC (permalink / raw)
  To: Alexander Stein; +Cc: git

Alexander Stein <alexander.stein@informatik.tu-chemnitz.de> writes:

> This patch removes the prompting variable so git send-email always asks
> for a in-reply message ID (unless specified on command line) even when
> sendemail.from and sendemail.to is set in ~/.gitconfig or .git/config

Does this mean there's no way to run send-email non-interactively
without a reply-to?

I do want to get the prompt even though I want to set the sender field
in my ~/.gitconfig, but I wouldn't want the prompt to appear in the
cron job I run every nights to send me new patches in some repo for
example (a change in git-send-email already broke it in the past,
that's a rather anoying failure).

You probably want an option to enable/disable prompting. I'm not sure
whether it should be opt-in or opt-out.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

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

* Re: [PATCH] send-email: Ask for in-reply message ID even if from and to is already known
  2010-06-10 17:08     ` Alexander Stein
  2010-06-10 17:18       ` Ævar Arnfjörð Bjarmason
@ 2010-06-11 19:06       ` Junio C Hamano
  2010-06-11 20:11         ` Alexander Stein
  1 sibling, 1 reply; 8+ messages in thread
From: Junio C Hamano @ 2010-06-11 19:06 UTC (permalink / raw)
  To: Alexander Stein; +Cc: git

Alexander Stein <alexander.stein@informatik.tu-chemnitz.de> writes:

> Did get this patch overlooked?

Did you run the existing test suite unattended and make sure everything
still passes?

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

* Re: [PATCH] send-email: Ask for in-reply message ID even if from and to is already known
  2010-06-11 19:06       ` Junio C Hamano
@ 2010-06-11 20:11         ` Alexander Stein
  0 siblings, 0 replies; 8+ messages in thread
From: Alexander Stein @ 2010-06-11 20:11 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

Am Freitag 11 Juni 2010, 21:06:53 schrieb Junio C Hamano:
> Did you run the existing test suite unattended and make sure everything
> still passes?

During test suite run I noticed this patch doesn't allow to run the suite 
unattended. This may only work with some config option as Matthieu already 
pointed out.
I will rethink about this problem and repost a new patch

Alexander

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

end of thread, other threads:[~2010-06-11 20:12 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-01 14:41 git send-email should always ask for in-reply-to Alexander Stein
2010-06-01 15:46 ` Matthieu Moy
2010-06-01 18:08   ` [PATCH] send-email: Ask for in-reply message ID even if from and to is already known Alexander Stein
2010-06-10 17:08     ` Alexander Stein
2010-06-10 17:18       ` Ævar Arnfjörð Bjarmason
2010-06-11 19:06       ` Junio C Hamano
2010-06-11 20:11         ` Alexander Stein
2010-06-10 22:28     ` Matthieu Moy

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

	https://80x24.org/mirrors/git.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).