* [PATCH 1/2] mergetools/kompare: simplify can_merge() by using "false"
@ 2016-12-10 3:21 David Aguilar
2016-12-10 3:21 ` [PATCH 2/2] mergetools/tortoisemerge: simplify can_diff() " David Aguilar
0 siblings, 1 reply; 5+ messages in thread
From: David Aguilar @ 2016-12-10 3:21 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Git ML
Signed-off-by: David Aguilar <davvid@gmail.com>
---
This patch builds upon da/mergetool-trust-exit-code
mergetools/kompare | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mergetools/kompare b/mergetools/kompare
index e8c0bfa678..321022500b 100644
--- a/mergetools/kompare
+++ b/mergetools/kompare
@@ -1,5 +1,5 @@
can_merge () {
- return 1
+ false
}
diff_cmd () {
--
2.11.0.27.gdeff8c7
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/2] mergetools/tortoisemerge: simplify can_diff() by using "false"
2016-12-10 3:21 [PATCH 1/2] mergetools/kompare: simplify can_merge() by using "false" David Aguilar
@ 2016-12-10 3:21 ` David Aguilar
2016-12-10 8:15 ` Johannes Sixt
0 siblings, 1 reply; 5+ messages in thread
From: David Aguilar @ 2016-12-10 3:21 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Git ML
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
}
merge_cmd () {
--
2.11.0.27.gdeff8c7
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] mergetools/tortoisemerge: simplify can_diff() by using "false"
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
0 siblings, 1 reply; 5+ messages in thread
From: Johannes Sixt @ 2016-12-10 8:15 UTC (permalink / raw)
To: David Aguilar; +Cc: Junio C Hamano, Git ML
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.
-- Hannes
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] mergetools/tortoisemerge: simplify can_diff() by using "false"
2016-12-10 8:15 ` Johannes Sixt
@ 2016-12-12 7:16 ` David Aguilar
2016-12-12 11:44 ` Philip Oakley
0 siblings, 1 reply; 5+ messages in thread
From: David Aguilar @ 2016-12-12 7:16 UTC (permalink / raw)
To: Johannes Sixt; +Cc: Junio C Hamano, Git ML
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] mergetools/tortoisemerge: simplify can_diff() by using "false"
2016-12-12 7:16 ` David Aguilar
@ 2016-12-12 11:44 ` Philip Oakley
0 siblings, 0 replies; 5+ messages in thread
From: Philip Oakley @ 2016-12-12 11:44 UTC (permalink / raw)
To: David Aguilar, Johannes Sixt; +Cc: Junio C Hamano, Git ML
From: "David Aguilar" <davvid@gmail.com>
> 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".
>
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
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2016-12-12 11:45 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2016-12-12 11:44 ` Philip Oakley
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).