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

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

 



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):


Well, pseudo code doesn't have to handle NULL's, as it never gets bad
pseudo-input ;-)

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.


Hmm, how about any interpunctuation char or newline followed by newline or
the first dot?

It would cover this case and not be overly hard to code.

--
Andreas Ericsson                   andreas.ericsson@xxxxxx
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[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