Re: [PATCH v2 2/3] pretty: make %H/%h dependent on --abbrev[-commit]

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

 



Jonathan Nieder wrote:
> Jeff King wrote:
>> On Sun, Apr 25, 2010 at 10:11:37PM -0500, Jonathan Nieder wrote:

>>> +static void abbreviate_commit_hashes(char *fmt)
>>> +{
>>> +	char *p;
>>> +	for (p = fmt; p != NULL; p = strchr(p + 1, '%')) {
>>> +		p++;
>>> +		switch (*p) {
>>> +		case 'H':
>>> +			*p = 'h';
>>> +			break;
>>> +		case 'P':
>>> +			*p = 'p';
>>> +			break;
>>> +		case 'T':
>>> +		default:
>>> +			break;
>>> +		}
>>> +	}
>>> +}
>>
>> You parse '%%H' incorrectly.
>
> I’m pretty sure I don’t.

Aggh, I see it now.  The first line should be

 for (p = strchr(fmt, '%'); ...

as I would have noticed with even a little testing.

Sorry for the nonsense.
Jonathan
--
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]