gitk: catch mkdtemp errors
PATCH 1/1 gitk: catch mkdtemp errors
105b5d3fbb1c00bb0aeaf9d3e0fbe26a7b1993fc introduced a dependency on mkdtemp, which is not available on Windows.
Use the original temporary directory behavior when mkdtemp fails. This makes the code use mkdtemp when available and gracefully fallback to the existing behavior when it is not available.
--- gitk | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
gitk +3 -1
@@ -3504,7 +3504,9 @@ proc gitknewtmpdir {} { set tmpdir $gitdir } set gitktmpformat [file join $tmpdir ".gitk-tmp.XXXXXX"] - set gitktmpdir [exec mktemp -d $gitktmpformat] + if {[catch {set gitktmpdir [exec mktemp -d $gitktmpformat]}]} { + set gitktmpdir [file join $gitdir [format ".gitk-tmp.%s" [pid]]] + } if {[catch {file mkdir $gitktmpdir} err]} { error_popup "[mc "Error creating temporary directory %s:" $gitktmpdir] $err" unset gitktmpdir
Signature · 1 line
2.0.0.257.g75cc6c6
Paul Mackerras
AppliedQuoted 10 lines · David Aguilar
105b5d3fbb1c00bb0aeaf9d3e0fbe26a7b1993fcintroduced a dependency on mkdtemp, which is not available on Windows.Use the original temporary directory behavior when mkdtemp fails. This makes the code use mkdtemp when available and gracefully fallback to the existing behavior when it is not available.
Helped-by Junio C Hamano <[email protected]>Helped-by brian m. carlson <[email protected]>Signed-off-by David Aguilar <[email protected]>
Thanks, applied (with slight modification to commit message).
Paul.
Quoted 11 lines · David Aguilar
105b5d3fbb1c00bb0aeaf9d3e0fbe26a7b1993fcintroduced a dependency on mkdtemp, which is not available on Windows.Use the original temporary directory behavior when mkdtemp fails. This makes the code use mkdtemp when available and gracefully fallback to the existing behavior when it is not available.
Helped-by Junio C Hamano <[email protected]>Helped-by brian m. carlson <[email protected]>Signed-off-by David Aguilar <[email protected]>---
In the meantime, I've fetched from you and merged up to your master~2 aka 17f9836c (gitk: Show staged submodules regardless of ignore config, 2014-04-08).
Thanks.
Quoted 18 lines
gitk | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)gitk +3
-1@@ -3504,7 +3504,9 @@ proc gitknewtmpdir {} { set tmpdir $gitdir } set gitktmpformat [file join $tmpdir ".gitk-tmp.XXXXXX"] - set gitktmpdir [exec mktemp -d $gitktmpformat] + if {[catch {set gitktmpdir [exec mktemp -d $gitktmpformat]}]} { + set gitktmpdir [file join $gitdir [format ".gitk-tmp.%s" [pid]]] + } if {[catch {file mkdir $gitktmpdir} err]} { error_popup "[mc "Error creating temporary directory %s:" $gitktmpdir] $err" unset gitktmpdir
Quoted 9 lines · Junio C Hamano
Quoted 7 lines · David Aguilar
105b5d3fbb1c00bb0aeaf9d3e0fbe26a7b1993fcintroduced a dependency on mkdtemp, which is not available on Windows.Use the original temporary directory behavior when mkdtemp fails. This makes the code use mkdtemp when available and gracefully fallback to the existing behavior when it is not available.
Quoted 8 lines
Quoted 4 lines
Helped-by Junio C Hamano <[email protected]>Helped-by brian m. carlson <[email protected]>Signed-off-by David Aguilar <[email protected]>---
In the meantime, I've fetched from you and merged up to your master~2 aka
17f9836c(gitk: Show staged submodules regardless of ignore config, 2014-04-08).
I have applied and pushed out this patch, along with one from Max Kirillov, so please do another fetch.
Thanks,
Paul.
Quoted 8 lines · Paul Mackerras
Quoted 4 lines · Junio C Hamano
In the meantime, I've fetched from you and merged up to your master~2 aka
17f9836c(gitk: Show staged submodules regardless of ignore config, 2014-04-08).I have applied and pushed out this patch, along with one from Max Kirillov, so please do another fetch.
Thanks, will do.
Quoted 11 lines · David Aguilar
105b5d3fbb1c00bb0aeaf9d3e0fbe26a7b1993fcintroduced a dependency on mkdtemp, which is not available on Windows.Use the original temporary directory behavior when mkdtemp fails. This makes the code use mkdtemp when available and gracefully fallback to the existing behavior when it is not available.
Helped-by Junio C Hamano <[email protected]>Helped-by brian m. carlson <[email protected]>Signed-off-by David Aguilar <[email protected]>---
Does this still need to be applied before I can pull from Paulus?
Quoted 18 lines
gitk | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)gitk +3
-1@@ -3504,7 +3504,9 @@ proc gitknewtmpdir {} { set tmpdir $gitdir } set gitktmpformat [file join $tmpdir ".gitk-tmp.XXXXXX"] - set gitktmpdir [exec mktemp -d $gitktmpformat] + if {[catch {set gitktmpdir [exec mktemp -d $gitktmpformat]}]} { + set gitktmpdir [file join $gitdir [format ".gitk-tmp.%s" [pid]]] + } if {[catch {file mkdir $gitktmpdir} err]} { error_popup "[mc "Error creating temporary directory %s:" $gitktmpdir] $err" unset gitktmpdir
Quoted 9 lines · Junio C Hamano
Quoted 7 lines · David Aguilar
105b5d3fbb1c00bb0aeaf9d3e0fbe26a7b1993fcintroduced a dependency on mkdtemp, which is not available on Windows.Use the original temporary directory behavior when mkdtemp fails. This makes the code use mkdtemp when available and gracefully fallback to the existing behavior when it is not available.
Quoted 6 lines
Quoted 4 lines
Helped-by Junio C Hamano <[email protected]>Helped-by brian m. carlson <[email protected]>Signed-off-by David Aguilar <[email protected]>---
Does this still need to be applied before I can pull from Paulus?
Yes, it would be nice to have this, especially for Windows users.
Signature · 1 line
David