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

Re: [PATCH] git-mailinfo: Fix getting the subject from the body

From
DZDon Zickus <dzickus@redhat.com>
Date
Jul 15, 2008, 03:13 UTC
Message-ID
<20080715031356.GQ16127@redhat.com>
In-Reply-To
<7v3amfxx3a.fsf@gitster.siamese.dyndns.org>
On Sat, Jul 12, 2008 at 02:36:57AM -0700, Junio C Hamano wrote:
Show 8 quoted lines
> Another thing I noticed and found puzzling is the handling of ">From "
> line that is shown in the context below.  check_header() is supposed to
> return true when it handled header (i.e. not part of the commit message)
> and return false when line is not part of the header.  As ">From " is part
> of the commit log message, shouldn't it return zero?
> 
> Don, this part was what you introduced.  Has this codepath ever been
> exercised in the real life?

Heh. Most emails I deal with usually wind up causing the code to stop looking for header info (still_looking=0). So I never ran into that scenario. And I never really tried to rely on inbody stuff.

I thought I was mimicing the original code, guess not.

Now that I think about it, I did run into a situation last year where git-mailinfo parsed the '>From' as an inbody header instead of a commit msg. I just put a stupid hack in my scripts to work around, thinking it was my scripts.

Anyway if it returns zero, wouldn't it be better to just remove the check to begin with? I kinda forgot why it is there in the first place (my changes just copied it from somewhere else).

Cheers, Don

Previous: Lukas SandströmNext: Lukas Sandström
Message 4 of 14 in “git-mailinfo: Fix getting the subject from the body”
  1. git-mailinfo: Fix getting the subject from the bodyLukas Sandström, Jul 10, 2008
  2. Junio C HamanoJul 12, 2008
  3. Lukas SandströmJul 12, 2008
  4. Don ZickusJul 15, 2008
  5. Lukas SandströmJul 10, 2008
  6. Junio C HamanoJul 10, 2008
  7. Add some useful functions for strbuf manipulation.Lukas Sandström, Jul 10, 2008
  8. git-mailinfo: use strbuf's instead of fixed buffersLukas Sandström, Jul 10, 2008
  9. Junio C HamanoJul 12, 2008
  10. Lukas SandströmJul 13, 2008
  11. Make some strbuf_*() struct strbuf arguments const.Lukas Sandström, Jul 13, 2008
  12. Add some useful functions for strbuf manipulation.Lukas Sandström, Jul 13, 2008
  13. git-mailinfo: use strbuf's instead of fixed buffersLukas Sandström, Jul 13, 2008
  14. Junio C HamanoJul 13, 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.