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

Re: Re: [PATCH] Add `%B' in format strings for raw commit body in `git log' and friends

From
Eli Barzilay <eli@barzilay.org>
Date
Apr 5, 2010, 06:06 UTC
Message-ID
<19385.32203.489776.418681@winooski.ccs.neu.edu>
In-Reply-To
<7vljd2y9c2.fsf@alter.siamese.dyndns.org>
On Apr  4, Junio C Hamano wrote:
Show 14 quoted lines
> Eli Barzilay <eli@barzilay.org> writes:
> 
> > On Apr  4, Junio C Hamano wrote:
> >> Isn't this the same as "%s%n%+b"?
> >
> > The problem with that is that it wraps the first paragraph.  So it's
> > fine as long as it's always used as a subject line.
> >
> > (I'm migrating a project to git, and some people will never remember
> > to do that.)
> 
> Ok, but then "rev-list --pretty=format:%B" would not be as a good
> tool for migration to begin with (imagine a log message that begins
> with "commit"), compared to say "rev-list --pretty=raw".

Ah, sorry -- I phrased that poorely. We're doing the actual migration with git-svn, so that's not the problem. The relation to migrating is that people are not used to using the first paragraph as a subject line, which means that there will be commit messages that look like:

  Fix foo, which means:
  1. Do this,
  2. Do that,
  3. Remove bar.

and such messages come out really ugly. If a project is well behaved in regards to commit messages always having a subject line, then there's no big problem, of course. (It can be a little worse if I have scripts that look for lines with a specific format like commands for a bug tracking system.)

> It also feels a bit funny to list %B that doesn't do the paragraph
> pretty-printing in pretty-formats.txt documentation ;-) but that is
> not an objection.

(Well, my understanding was that the pretty formats is about the format strings in general.)

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!
Previous: Junio C Hamano
Message 6 of 6 in “Add `%B' in format strings for raw commit body in `git log' and friends”
  1. Add `%B' in format strings for raw commit body in `git log' and friendsEli Barzilay, Mar 25, 2010
  2. Eli BarzilayApr 4, 2010
  3. Junio C HamanoApr 4, 2010
  4. Eli BarzilayApr 4, 2010
  5. Junio C HamanoApr 5, 2010
  6. Eli BarzilayApr 5, 2010

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.