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

Re: [PATCH] git-send-email.perl: Really add angle brackets to In-Reply-To if necessary

From
Randal L. Schwartz <merlyn@stonehenge.com>
Date
Dec 9, 2007, 18:53 UTC
Message-ID
<86aboju2bp.fsf@blue.stonehenge.com>
In-Reply-To
<851w9vsp8o.fsf@lola.goethe.zz>
>>>>> "David" == David Kastrup <dak@gnu.org> writes:
Show 7 quoted lines
>>> $initial_reply_to = $_;
>>> -	$initial_reply_to =~ s/^\s+<?/</;
>>> -	$initial_reply_to =~ s/>?\s+$/>/;
>>> }
>> 
>> I wonder what the original rationale for these \s+ was.
>> Will apply, anyway.  Thanks.
David> The original line read
David> 	$initial_reply_to =~ s/(^\s+|\s+$)//g;

David> and was used just for stripping spaces (no stripping necessary when David> there is no space, so \s+ was ok). The change was supposed to work David> on the brackets, too.

David> That Mike got bitten here is proof that the original idea had merit. David> Too bad the implementation did not actually work.

I think what you were trying to do would work with:
  for ($initial_reply_to) {
      s/^\s*<?/</;
      s/>?\s*$/>/;
  }
Untested, but I get this stuff right most of the time. :)
-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
Previous: David KastrupNext: David Kastrup
Message 19 of 23 in “Cleanup variables in http.[ch]”
  1. 1/4 Cleanup variables in http.[ch]Mike Hommey, Dec 9, 2007
  2. 2/4 Use strbuf in http codeMike Hommey, Dec 9, 2007
  3. 3/4 Move the file read logic to read_patch_file() in builtin-apply.cMike Hommey, Dec 9, 2007
  4. 4/4 Add support for URLs to git-applyMike Hommey, Dec 9, 2007
  5. 4/4 Add support for URLs to git-applyMike Hommey, Dec 10, 2007
  6. Junio C HamanoDec 9, 2007
  7. Junio C HamanoDec 9, 2007
  8. Mike HommeyDec 9, 2007
  9. Junio C HamanoDec 9, 2007
  10. 2/4 Use strbuf in http codeMike Hommey, Dec 9, 2007
  11. Junio C HamanoDec 11, 2007
  12. Mike HommeyDec 11, 2007
  13. 2/4 Use strbuf in http codeMike Hommey, Dec 11, 2007
  14. git-send-email.perl: Really add angle brackets to In-Reply-To if necessaryMike Hommey, Dec 9, 2007
  15. Mike HommeyDec 9, 2007
  16. Junio C HamanoDec 9, 2007
  17. Mike HommeyDec 9, 2007
  18. David KastrupDec 9, 2007
  19. Randal L. SchwartzDec 9, 2007
  20. David KastrupDec 9, 2007
  21. Randal L. SchwartzDec 9, 2007
  22. git-send-email.perl: Really add angle brackets to In-Reply-To if necessaryMike Hommey, Dec 9, 2007
  23. Junio C HamanoDec 9, 2007

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.