Re: [PATCH] Allow git-diff exit with codes similar to diff(1)
"Alex Riesen" <raa.lkml@gmail.com> writes:
Show 12 quoted lines
> On 3/14/07, Junio C Hamano <junkio@cox.net> 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;