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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sep 18, 2007, at 12:13 PM, Johannes Schindelin wrote:

Hi,

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. 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!).

--
Benoit Sigoure aka Tsuna
EPITA Research and Development Laboratory


Attachment: PGP.sig
Description: This is a digitally signed message part


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux