Skip to contentSkip to conversation

mergetools/kompare: simplify can_merge() by using "false"

PATCH In review David Aguilar 3 participants 5 messages Dec 10, 2016 – Dec 12, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 mergetools/kompare: simplify can_merge() by using "false"

---
This patch builds upon da/mergetool-trust-exit-code

 mergetools/kompare | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mergetools/kompare +1 -1
index e8c0bfa678..321022500b 100644
@@ -1,5 +1,5 @@
 can_merge () {
-	return 1
+	false
 }
 
 diff_cmd () {
Signature · 1 line
2.11.0.27.gdeff8c7
#1 lore raw

PATCH 2/2 mergetools/tortoisemerge: simplify can_diff() by using "false"

---
This patch builds upon da/mergetool-trust-exit-code

 mergetools/tortoisemerge | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mergetools/tortoisemerge +1 -1
index d7ab666a59..9067d8a4e5 100644
@@ -1,5 +1,5 @@
 can_diff () {
-	return 1
+	false
 }
 
 merge_cmd () {
Signature · 1 line
2.11.0.27.gdeff8c7
#2 lore raw

Re: [PATCH 2/2] mergetools/tortoisemerge: simplify can_diff() by using "false"

Am 10.12.2016 um 04:21 schrieb David Aguilar:

Quoted 12 lines

---
This patch builds upon da/mergetool-trust-exit-code

 mergetools/tortoisemerge | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mergetools/tortoisemerge +0 -0
index d7ab666a59..9067d8a4e5 100644

mergetools/tortoisemerge line 3

Quoted 4 lines
mergetools/tortoisemerge +1 -1
@@ -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

#3 lore raw

Re: [PATCH 2/2] mergetools/tortoisemerge: simplify can_diff() by using "false"

Quoted 20 lines · Johannes Sixt

Am 10.12.2016 um 04:21 schrieb David Aguilar:

Quoted 12 lines

---
This patch builds upon da/mergetool-trust-exit-code

 mergetools/tortoisemerge | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mergetools/tortoisemerge +0 -0
index d7ab666a59..9067d8a4e5 100644

mergetools/tortoisemerge line 3

Quoted 4 lines
mergetools/tortoisemerge +1 -1
@@ -1,5 +1,5 @@
 can_diff () {
-	return 1
+	false
 }

Why is this a simplification?

Quoted 2 lines

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.

Signature · 1 line
David
#4 lore raw

Re: [PATCH 2/2] mergetools/tortoisemerge: simplify can_diff() by using "false"

From: "David Aguilar" <[email protected]>

Quoted 24 lines · Johannes Sixt
Quoted 20 lines

Am 10.12.2016 um 04:21 schrieb David Aguilar:

Quoted 12 lines

---
This patch builds upon da/mergetool-trust-exit-code

 mergetools/tortoisemerge | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mergetools/tortoisemerge +0 -0
index d7ab666a59..9067d8a4e5 100644

mergetools/tortoisemerge line 3

Quoted 4 lines
mergetools/tortoisemerge +1 -1
@@ -1,5 +1,5 @@
 can_diff () {
- return 1
+ false
 }

Why is this a simplification?

Quoted 2 lines

My concern is that 'false' is not necessarily a shell built-in. Then this is actually a pessimization.

Quoted 7 lines

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 */

Quoted 5 lines

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

Signature · 1 line
David

--
Philip