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

Re: [RFC/PATCH] log: add log.firstparent option

From
Jeff King <peff@peff.net>
Date
Jul 24, 2015, 08:17 UTC
Message-ID
<20150724081753.GA29451@peff.net>
In-Reply-To
<CA+P7+xo11PwE+L3zCy8Nw=xt+ZWKadd_-ra7C-QvNV80B6dCGw@mail.gmail.com>
On Fri, Jul 24, 2015 at 12:46:57AM -0700, Jacob Keller wrote:
Show 16 quoted lines
> On Fri, Jul 24, 2015 at 12:40 AM, Jeff King <peff@peff.net> wrote:
> > Whoops. Usually I "format-patch -s" and then add any notes while
> > sending. But the wifi at OSCON was so abysmal that instead I wrote the
> > notes directly into the commit message to send the whole thing later.
> > And of course format-patch is not smart enough to know that I meant
> > everything after the "---" as notes. :)
> 
> Kind of a side track but...
> 
> I think it's up to the caller of git-am to use "--scissors" to cut the
> log? But maybe we could add an option to git-format patch which
> formats and cuts via scissors as it generates the message? Not sure
> the best way to interpret this, but I know I've had trouble where I
> wrote some notes into an email and lost it because I killed the email
> for some other edit. Keeping them inside my local commits before
> sending out email would be handy.. hmmmm

The "---" is orthogonal to "--scissors". With "--scissors", the full format of the body is:

   some notes or cover letter
   -- >8 --
   the actual commit message
   ---
   more notes
   diff --git ...etc...

So here I was trying to use the "---" to add notes at the end (not because --scissors is not used consistently, but because I wanted the reader to see them after reading the commit message). So you could keep notes in the commit message by writing:

  my notes here
  -- >8 --
  the real commit message

and then "format-patch -s" just works, because it is munging the end. But if you want to be able to add commit notes at the end, you need format-patch to realize that any trailers should go before the "---" (i.e., to realize that the "---" is syntactically significant, and not just part of your message).

Another option would be to teach git-commit to split the "---" from the commit message itself, and put the bits after it into git-notes (and then format-patch already knows how to handle that). I had a patch series to do that long ago, but I found that I never used it (I usually _do_ type my notes in the mailer as I'm sending), so I never seriously pushed for inclusion. I might be able to dig it out of the archive if you're interested.

-Peff
Previous: Jacob KellerNext: Junio C Hamano
Message 14 of 32 in “log: add log.firstparent option”
  1. log: add log.firstparent optionJeff King, Jul 23, 2015
  2. Config variables and scripting // was Re: [RFC/PATCH] log: add log.firstparent optionDavid Aguilar, Jul 23, 2015
  3. Jeff KingJul 23, 2015
  4. Jeff KingJul 23, 2015
  5. Jacob KellerJul 23, 2015
  6. Jeff KingJul 23, 2015
  7. Jacob KellerJul 23, 2015
  8. Michael J GruberJul 23, 2015
  9. Jeff KingJul 23, 2015
  10. Junio C HamanoJul 23, 2015
  11. Stefan BellerJul 23, 2015
  12. Jeff KingJul 24, 2015
  13. Jacob KellerJul 24, 2015
  14. Jeff KingJul 24, 2015
  15. Junio C HamanoJul 24, 2015
  16. Jeff KingJul 25, 2015
  17. Jeff KingJul 25, 2015
  18. Junio C HamanoJul 25, 2015
  19. Jeff KingJul 27, 2015
  20. Junio C HamanoJul 23, 2015
  21. Jacob KellerJul 24, 2015
  22. Jeff KingJul 24, 2015
  23. Jacob KellerJul 24, 2015
  24. Junio C HamanoJul 24, 2015
  25. Jeff KingJul 24, 2015
  26. Jeff KingJul 24, 2015
  27. Jeff KingJul 24, 2015
  28. Junio C HamanoJul 24, 2015
  29. Jeff KingJul 25, 2015
  30. Junio C HamanoJul 25, 2015
  31. Jacob KellerJul 25, 2015
  32. Jeff KingJul 27, 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.