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

Re: commit summary, --pretty=short and other tools

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Sep 18, 2007, 10:54 UTC
Message-ID
<Pine.LNX.4.64.0709181153530.28586@racer.site>
In-Reply-To
<CEE6032F-39FB-42D8-A57A-671E4E0875C7@lrde.epita.fr>
Hi,
On Tue, 18 Sep 2007, Benoit SIGOURE wrote:
Show 29 quoted lines
> On Sep 18, 2007, at 12:13 PM, Johannes Schindelin wrote:
> 
> > On Tue, 18 Sep 2007, Andreas Ericsson wrote:
> > 
> > > const char *find_commit_subject_end(const char *commit_msg)
> > > {
> > > 	const char *dot, *paragraph_end;
> > > 		paragraph_end = strstr(commit_msg, "\n\n");
> > > 	dot = strchr(commit_msg, '.');
> > > 		return min_non_null(dot, paragraph_end); }
> > > 
> > > would probably get it right very nearly always.
> > 
> > Counterexample (not even mentioning the missing handling of NULL):
> > 
> > http://brick.kernel.dk/git/?p=qemu.git;a=commit;h=eb66d86e295cd5a8f13221589806e15db62a62fa
> > 
> > And no, the responsible developer showed a strong unwillingness to adapt
> > to better tools and workflows.
> > 
> 
> OK, look, I think this is the typical case where there is no single solution
> to fit all use cases.
> To handle this specific case, you could say "OK let's stop at punctuation
> symbols then".  But what if my commit message is "Add namespace::member
> whatever."
> 
> If there is a single line followed by a blank line: it's a git-style commit
> message, do what was done before.
That's the current behaviour already.  And has been for a long time.
> Otherwise, we need some heuristic to find the relevant part of the commit
> message (if there is such a relevant part in the first place!).
Or do we?

I was opposed to this change, since I think that there is really no way to fit all exisiting (!) repositories.

And since oneline was always only meant as a hint, it might just as well have stayed at "just one line, the first one".

Maybe you guys find a better method, such as providing a regular expression in the config or something, but let's not do another change that does not work for all cases.

Ciao, Dscho

Previous: Benoit SIGOURENext: Wincent Colaiuta
Message 9 of 10 in “commit summary, --pretty=short and other tools”
  1. Mike HommeySep 17, 2007
  2. Jeff KingSep 17, 2007
  3. Benoit SIGOURESep 17, 2007
  4. Junio C HamanoSep 18, 2007
  5. Andreas EricssonSep 18, 2007
  6. Johannes SchindelinSep 18, 2007
  7. Andreas EricssonSep 18, 2007
  8. Benoit SIGOURESep 18, 2007
  9. Johannes SchindelinSep 18, 2007
  10. Wincent ColaiutaSep 18, 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.