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

Re: [PATCH] notes: mention --notes in more places

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 17, 2012, 21:50 UTC
Message-ID
<7vsj9cn4z5.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20121017190507.GA17648@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 23 quoted lines
> On Wed, Oct 17, 2012 at 07:30:56AM -0600, Eric Blake wrote:
>
>> > We've talked about it several times, but it's never happened (probably
>> > because most people don't actually use notes).
>> 
>> And people (like me) don't use notes because they aren't documented.
>> Catch-22, so we have to start somewhere.
>
> Oh, I definitely agree your patch is the right direction. I was just
> explaining why it hasn't happened, even though people think it's a good
> idea.
>
>> I'll submit a v2 with the non-controversial edits, and spend some time
>> trying to figure out how to isolate the portion of pretty-options.txt
>> that is relevant to format-patch.  If it's easy enough, I can also
>> consider using --- instead of Notes: as the separator when using
>> format-patch.
>
> Hmm. After digging in the archive, it seems we (including both you and
> me!) have discussed this several times, and there are even some patches
> floating around. Maybe one of them would be a good starting point for
> your submission (I did not read carefully over all of the arguments for
> each):

Thomas's oldest one looked like a good starting point but we've gained a codepath to spit out the contents of notes since then, which probably needs to be killed at least for this codepath.

A few problems I noticed while looking at log-tree.c and pretty.c
 * pretty_print_commit() shows notes at the end of existing
   message.  There is no provision for the callers to affect what
   comes between the existing log message and the notes text.
 * show_log() has the "add-signoff" that appends a sign-off after
   whatever pretty_print_commit() gives.

Taken together, they make it unnecessarily cumbersome to inject a new sign-off and "---" between the log message and notes.

The easiest is to add another parameter to pretty_print_commit that is inserted immediately after the log message before notes are appended. That way, we can update show_log() to first format additional sign off (if needed) and then "---\n" (again, if needed) to a new strbuf and pass it as the new argument when calling the pretty_print_commit() function.

Previous: Jeff KingNext: Michael J Gruber
Message 7 of 8 in “notes: mention --notes in more places”
  1. notes: mention --notes in more placesEric Blake, Oct 17, 2012
  2. Junio C HamanoOct 17, 2012
  3. Jeff KingOct 17, 2012
  4. Junio C HamanoOct 17, 2012
  5. Eric BlakeOct 17, 2012
  6. Jeff KingOct 17, 2012
  7. Junio C HamanoOct 17, 2012
  8. Michael J GruberOct 18, 2012

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.