Re: [PATCH] Allow git-diff exit with codes similar to diff(1)

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

 



"Alex Riesen" <raa.lkml@xxxxxxxxx> writes:

> On 3/14/07, Junio C Hamano <junkio@xxxxxxx> wrote:
>> > -     return run_diff_files_cmd(&rev, argc, argv);
>> > +     result = run_diff_files_cmd(&rev, argc, argv);
>> > +     return rev.diffopt.diff_exit_code ? rev.diffopt.exit_code: result;
>> >  }
>>
>> Yuck.  Let's call the former "exit_with_status" (meaning, the
>> caller instructed us to do that) and the latter "has_changes".
>
> I like "exit_with_status". But has_changes looks confusing
> good near return value of run_diff_files_cmd, which "has"
> nothing. Or do you mean to highlight this "difference"?

Maybe 'found_changes' would be a better name, then?

	if (exit_with_status)
        	return !!found_changes;
	else
        	return result;


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