git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Aguilar <davvid@gmail.com>
To: Johannes Sixt <j6t@kdbg.org>
Cc: Junio C Hamano <gitster@pobox.com>, Git ML <git@vger.kernel.org>
Subject: Re: [PATCH 2/2] mergetools/tortoisemerge: simplify can_diff() by using "false"
Date: Sun, 11 Dec 2016 23:16:46 -0800	[thread overview]
Message-ID: <20161212071646.5bqnnjpfnmnj6fm4@gmail.com> (raw)
In-Reply-To: <37d8bc43-9f24-b8e8-cb52-de9cc9b2adde@kdbg.org>

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 <davvid@gmail.com>
> > ---
> > 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".

I care less about semantics then I do about making things better
for Windows, so we can forget about these two patches.
-- 
David

  reply	other threads:[~2016-12-12  7:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-10  3:21 [PATCH 1/2] mergetools/kompare: simplify can_merge() by using "false" David Aguilar
2016-12-10  3:21 ` [PATCH 2/2] mergetools/tortoisemerge: simplify can_diff() " David Aguilar
2016-12-10  8:15   ` Johannes Sixt
2016-12-12  7:16     ` David Aguilar [this message]
2016-12-12 11:44       ` Philip Oakley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161212071646.5bqnnjpfnmnj6fm4@gmail.com \
    --to=davvid@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=j6t@kdbg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).