From: Junio C Hamano Date: Wed, 14 Mar 2007 17:06:53 GMT Subject: Re: [PATCH] Allow git-diff exit with codes similar to diff(1) Message-ID: <7vodmvah5e.fsf@assigned-by-dhcp.cox.net> In-Reply-To: <81b0412b0703140933v5c684aa9g1f61d61e502c6783@mail.gmail.com> "Alex Riesen" writes: > On 3/14/07, Junio C Hamano 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;