git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] gitk: catch mkdtemp errors

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 26, 2014, 20:47 UTC
Message-ID
<xmqq4mz74cuv.fsf@gitster.dls.corp.google.com>
In-Reply-To
<1403146394-9589-1-git-send-email-davvid@gmail.com>
David Aguilar <davvid@gmail.com> writes:
Show 11 quoted lines
> 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.
>
> Helped-by: Junio C Hamano <gitster@pobox.com>
> Helped-by: brian m. carlson <sandals@crustytoothpaste.net>
> Signed-off-by: David Aguilar <davvid@gmail.com>
> ---

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.
Show 18 quoted lines
>  gitk | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/gitk b/gitk
> index 41e5071..9237830 100755
> --- a/gitk
> +++ b/gitk
> @@ -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
Previous: David AguilarNext: Paul Mackerras
Message 4 of 7 in “gitk: catch mkdtemp errors”
  1. gitk: catch mkdtemp errorsDavid Aguilar, Jun 19, 2014
  2. Junio C HamanoJun 26, 2014
  3. David AguilarJun 27, 2014
  4. Junio C HamanoJun 26, 2014
  5. Paul MackerrasJun 27, 2014
  6. Junio C HamanoJun 27, 2014
  7. Paul MackerrasJun 27, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.