git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Andreas Ericsson <ae@op5.se>
To: Benoit SIGOURE <tsuna@lrde.epita.fr>
Cc: Mike Hommey <mh@glandium.org>, git@vger.kernel.org
Subject: Re: commit summary, --pretty=short and other tools
Date: Tue, 18 Sep 2007 09:19:19 +0200	[thread overview]
Message-ID: <46EF7BF7.3070107@op5.se> (raw)
In-Reply-To: <55887C88-8523-4839-8B91-236256A5E893@lrde.epita.fr>

Benoit SIGOURE wrote:
> 
> My opinion is that it would be better to keep the first line and never 
> ever rewrite the commit messages.
> 

I've had reason to ponder this quite a lot, as I've imported 15 repos from
CVS and SVN where the commit authors did not follow the git-recommended way
of doing things, but rather put everything as one paragraph, usually without
linebreaks, in the commit message.

>From what I've read from those rather horrid commit-messages so far, it's
usually correct to grab the first sentence in case the empty line isn't
there, so:

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.

I'll submit a patch in 3 hours when I get my lunch, unless someone
beats me to it.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

  parent reply	other threads:[~2007-09-18  7:19 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-17 11:21 commit summary, --pretty=short and other tools Mike Hommey
2007-09-17 11:42 ` Jeff King
2007-09-17 23:52 ` Benoit SIGOURE
2007-09-18  0:24   ` Junio C Hamano
2007-09-18  7:19   ` Andreas Ericsson [this message]
2007-09-18 10:13     ` Johannes Schindelin
2007-09-18 10:23       ` Andreas Ericsson
2007-09-18 10:27       ` Benoit SIGOURE
2007-09-18 10:54         ` Johannes Schindelin
2007-09-18 11:43         ` Wincent Colaiuta

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=46EF7BF7.3070107@op5.se \
    --to=ae@op5.se \
    --cc=git@vger.kernel.org \
    --cc=mh@glandium.org \
    --cc=tsuna@lrde.epita.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).