git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: commit 'git-send-email: add support for TLS via Net::SMTP::SSL' causes warnings

From
Thomas Rast <trast@student.ethz.ch>
Date
Jun 26, 2008, 21:03 UTC
Message-ID
<200806262303.23269.trast@student.ethz.ch>
In-Reply-To
<200806262248.02866.trast@student.ethz.ch>
I wrote:
> 
> and thanks for the fix

Well, actually at second glance your fix is wrong. Putting it in read_config() means it will be executed the first time around already, when we read the identity's settings. So with the patch, $smtp_encryption is set to '' during identity parsing, and any value set in the global [sendemail] section never takes effect.

Let's do the following instead.  Sorry for all the noise.

-- 8< -- git-send-email: prevent undefined variable warnings if no encryption is set

With the previous patch, not configuring any encryption (either on or off) would leave $smtp_encryption undefined. We simply set it to the empty string in that case.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
---
 git-send-email.perl |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/git-send-email.perl b/git-send-email.perl
index 7630720..edb12c2 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -313,6 +313,9 @@ foreach my $setting (values %config_bool_settings) {
 	${$setting->[0]} = $setting->[1] unless (defined (${$setting->[0]}));
 }
 
+# 'default' encryption is none -- this only prevents a warning
+$smtp_encryption = '' unless (defined $smtp_encryption);
+
 # Set CC suppressions
 my(%suppress_cc);
 if (@suppress_cc) {
-- 
1.5.6.1.187.g35a8
Previous: Thomas Rast
Message 4 of 4 in “commit 'git-send-email: add support for TLS via Net::SMTP::SSL' causes warnings”
  1. Kevin BallardJun 26, 2008
  2. git-send-email: Fix warning triggered by f6bebd12 when no encryption is setKevin Ballard, Jun 26, 2008
  3. Thomas RastJun 26, 2008
  4. Thomas RastJun 26, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.