Re: [PATCH v6 09/19] fsck: Handle multiple authors in commits specially

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

 



Hi Junio,

On 2015-06-19 22:16, Junio C Hamano wrote:
> Johannes Schindelin <johannes.schindelin@xxxxxx> writes:
> 
>>  	err = fsck_ident(&buffer, &commit->object, options);
>>  	if (err)
>>  		return err;
>> +	while (skip_prefix(buffer, "author ", &buffer)) {
>> +		err = report(options, &commit->object, FSCK_MSG_MULTIPLE_AUTHORS, "invalid format - multiple 'author' lines");
>> +		if (err)
>> +			return err;
>> +		err = fsck_ident(&buffer, &commit->object, options);
>> +		if (err)
>> +			return err;
>> +	}
> 
> Hmph, naively I would have expected that you wouldn't need an
> extra call to fsck_ident() here, and instead would see something
> like this:
> 
> 	author_count = 0;
> 	while (skip_prefix("author ")) {
>         	author_count++;
>                 ... do the existing check as-is ...
> 	}
>         if (author_count < 1)
>         	err |= report(missing author);
> 	else if (author_count > 1)
>         	err |= report(multiple authors);

Good idea! I fixed this in my branch and it will be part of v7.

Ciao,
Dscho
--
To unsubscribe from this list: send the line "unsubscribe git" in



[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]