public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox•com>
To: Paul Mackerras <paulus@samba•org>
Cc: David Aguilar <davvid@gmail•com>,
	git@vger•kernel.org,
	"brian m. carlson" <sandals@crustytoothpaste•net>,
	Pat Thoyts <patthoyts@users•sourceforge.net>
Subject: Re: [PATCH] gitk: catch mkdtemp errors
Date: Thu, 26 Jun 2014 13:47:36 -0700	[thread overview]
Message-ID: <xmqq4mz74cuv.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <1403146394-9589-1-git-send-email-davvid@gmail.com> (David Aguilar's message of "Wed, 18 Jun 2014 19:53:14 -0700")

David Aguilar <davvid@gmail•com> writes:

> 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.

>  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

  parent reply	other threads:[~2014-06-26 20:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-19  2:53 [PATCH] gitk: catch mkdtemp errors David Aguilar
2014-06-26 20:42 ` Junio C Hamano
2014-06-27  3:05   ` David Aguilar
2014-06-26 20:47 ` Junio C Hamano [this message]
2014-06-27  6:59   ` Paul Mackerras
2014-06-27 17:16     ` Junio C Hamano
2014-06-27  6:58 ` Paul Mackerras

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=xmqq4mz74cuv.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox$(echo .)com \
    --cc=davvid@gmail$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=patthoyts@users$(echo .)sourceforge.net \
    --cc=paulus@samba$(echo .)org \
    --cc=sandals@crustytoothpaste$(echo .)net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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