Re: [PATCH] Allow git-diff exit with codes similar to diff(1)
- From
Alex Riesen <raa.lkml@gmail.com>
- Date
- Mar 14, 2007, 17:15 UTC
- Message-ID
- <81b0412b0703141015m1f7cb68dkf89fe13a968a30d0@mail.gmail.com>
- In-Reply-To
- <7vodmvah5e.fsf@assigned-by-dhcp.cox.net>
On 3/14/07, Junio C Hamano <junkio@cox.net> wrote:
Show 18 quoted lines
> >> > - 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;
Nah... has_changes has almost the same meaning, and I'm weary regarding making it a changing counter (which one can assume it to be when seeing !!found_changes). And I already sent the patch off.