From: Philip Oakley Date: Mon, 12 Dec 2016 11:45:06 GMT Subject: Re: [PATCH 2/2] mergetools/tortoisemerge: simplify can_diff() by using "false" Message-ID: <775B98CA998147CC9A68CF6040B86CE1@PhilipOakley> In-Reply-To: <20161212071646.5bqnnjpfnmnj6fm4@gmail.com> From: "David Aguilar" > On Sat, Dec 10, 2016 at 09:15:34AM +0100, Johannes Sixt wrote: >> Am 10.12.2016 um 04:21 schrieb David Aguilar: >> > Signed-off-by: David Aguilar >> > --- >> > This patch builds upon da/mergetool-trust-exit-code >> > >> > mergetools/tortoisemerge | 2 +- >> > 1 file changed, 1 insertion(+), 1 deletion(-) >> > >> > diff --git a/mergetools/tortoisemerge b/mergetools/tortoisemerge >> > index d7ab666a59..9067d8a4e5 100644 >> > --- a/mergetools/tortoisemerge >> > +++ b/mergetools/tortoisemerge >> > @@ -1,5 +1,5 @@ >> > can_diff () { >> > - return 1 >> > + false >> > } >> >> Why is this a simplification? >> >> My concern is that 'false' is not necessarily a shell built-in. Then this >> is >> actually a pessimization. > > The "simplification" is semantic only. > > Motivation: if someone reads the implementation of can_diff() > and it says "false" then that communicates intent moreso than > reading "return 1", which a programmer unfamiliar with shell > conventions might misinterpret as boolean "true". > Is this a case where a short comment would be informative? + return 1 /* shell: false */ > I care less about semantics then I do about making things better > for Windows, so we can forget about these two patches. > -- > David > -- Philip