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

[PATCH 6/9] send-email: simplify sendmail aliases comment and blank line recognizer

From
Eric Sunshine <sunshine@sunshineco.com>
Date
May 31, 2015, 22:29 UTC
Message-ID
<1433111371-19573-7-git-send-email-sunshine@sunshineco.com>
In-Reply-To
<1433111371-19573-1-git-send-email-sunshine@sunshineco.com>

Replace unnecessarily complex regular expression for recognizing comment and blanks lines in sendmail aliases with idiomatic expressions which can be easily understood at a glance.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
---
 git-send-email.perl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/git-send-email.perl b/git-send-email.perl
index 76bb499..e777bd3 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -505,7 +505,7 @@ sub parse_sendmail_alias {
 sub parse_sendmail_aliases {
 	my $fh = shift;
 	while (<$fh>) {
-		if (/^\s*(?:#.*)?$/) { next; }
+		next if /^\s*$/ || /^\s*#/;
 		parse_sendmail_alias($_);
 	}
 }
-- 
2.4.2.538.g5f4350e
Previous: Eric SunshineNext: Eric Sunshine
Message 10 of 15 in “send-email: add sendmail aliases line continuation support”
  1. 0/9 send-email: add sendmail aliases line continuation supportEric Sunshine, May 31, 2015
  2. 1/9 send-email: further document missing sendmail aliases functionalityEric Sunshine, May 31, 2015
  3. Allen HubbeJun 1, 2015
  4. Eric SunshineJun 1, 2015
  5. Allen HubbeJun 1, 2015
  6. 2/9 send-email: visually distinguish sendmail aliases parser warningsEric Sunshine, May 31, 2015
  7. 3/9 send-email: drop noise comments which merely repeat what code saysEric Sunshine, May 31, 2015
  8. 4/9 send-email: fix style: cuddle 'elsif' and 'else' with closing braceEric Sunshine, May 31, 2015
  9. 5/9 send-email: refactor sendmail aliases parserEric Sunshine, May 31, 2015
  10. 6/9 send-email: simplify sendmail aliases comment and blank line recognizerEric Sunshine, May 31, 2015
  11. Eric SunshineJun 1, 2015
  12. 7/9 send-email: implement sendmail aliases line continuation supportEric Sunshine, May 31, 2015
  13. 8/9 t9001: refactor sendmail aliases test infrastructureEric Sunshine, May 31, 2015
  14. 9/9 t9001: add sendmail aliases line continuation testsEric Sunshine, May 31, 2015
  15. Allen HubbeJun 1, 2015

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.