{"thread":{"id":"36960","subject":"[PATCH] gitk: catch mkdtemp errors","startedAt":"2014-06-19T02:53:14Z","lastAt":"2014-06-27T17:16:30Z","messageCount":7,"participants":["David Aguilar","Junio C Hamano","Paul Mackerras"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"244614","messageId":"1403146394-9589-1-git-send-email-davvid@gmail.com","threadId":"36960","inReplyTo":null,"subject":"[PATCH] gitk: catch mkdtemp errors","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2014-06-19T02:53:14Z","receivedAt":"2014-06-19T02:53:14Z","isPatch":true,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"105b5d3fbb1c00bb0aeaf9d3e0fbe26a7b1993fc introduced a dependency\non mkdtemp, which is not available on Windows.\n\nUse the original temporary directory behavior when mkdtemp fails.\nThis makes the code use mkdtemp when available and gracefully\nfallback to the existing behavior when it is not available.\n\nHelped-by: Junio C Hamano <gitster@pobox.com>\nHelped-by: brian m. carlson <sandals@crustytoothpaste.net>\nSigned-off-by: David Aguilar <davvid@gmail.com>\n---\n gitk | 4 +++-\n 1 file changed, 3 insertions(+), 1 deletion(-)\n\ndiff --git a/gitk b/gitk\nindex 41e5071..9237830 100755\n--- a/gitk\n+++ b/gitk\n@@ -3504,7 +3504,9 @@ proc gitknewtmpdir {} {\n \t    set tmpdir $gitdir\n \t}\n \tset gitktmpformat [file join $tmpdir \".gitk-tmp.XXXXXX\"]\n-\tset gitktmpdir [exec mktemp -d $gitktmpformat]\n+\tif {[catch {set gitktmpdir [exec mktemp -d $gitktmpformat]}]} {\n+\t    set gitktmpdir [file join $gitdir [format \".gitk-tmp.%s\" [pid]]]\n+\t}\n \tif {[catch {file mkdir $gitktmpdir} err]} {\n \t    error_popup \"[mc \"Error creating temporary directory %s:\" $gitktmpdir] $err\"\n \t    unset gitktmpdir\n-- \n2.0.0.257.g75cc6c6\n"},{"id":"245041","messageId":"xmqq8uoj4d43.fsf@gitster.dls.corp.google.com","threadId":"36960","inReplyTo":"1403146394-9589-1-git-send-email-davvid@gmail.com","subject":"Re: [PATCH] gitk: catch mkdtemp errors","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-06-26T20:42:04Z","receivedAt":"2014-06-26T20:42:04Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"David Aguilar <davvid@gmail.com> writes:\n\n> 105b5d3fbb1c00bb0aeaf9d3e0fbe26a7b1993fc introduced a dependency\n> on mkdtemp, which is not available on Windows.\n>\n> Use the original temporary directory behavior when mkdtemp fails.\n> This makes the code use mkdtemp when available and gracefully\n> fallback to the existing behavior when it is not available.\n>\n> Helped-by: Junio C Hamano <gitster@pobox.com>\n> Helped-by: brian m. carlson <sandals@crustytoothpaste.net>\n> Signed-off-by: David Aguilar <davvid@gmail.com>\n> ---\n\nDoes this still need to be applied before I can pull from Paulus?\n\n>  gitk | 4 +++-\n>  1 file changed, 3 insertions(+), 1 deletion(-)\n>\n> diff --git a/gitk b/gitk\n> index 41e5071..9237830 100755\n> --- a/gitk\n> +++ b/gitk\n> @@ -3504,7 +3504,9 @@ proc gitknewtmpdir {} {\n>  \t    set tmpdir $gitdir\n>  \t}\n>  \tset gitktmpformat [file join $tmpdir \".gitk-tmp.XXXXXX\"]\n> -\tset gitktmpdir [exec mktemp -d $gitktmpformat]\n> +\tif {[catch {set gitktmpdir [exec mktemp -d $gitktmpformat]}]} {\n> +\t    set gitktmpdir [file join $gitdir [format \".gitk-tmp.%s\" [pid]]]\n> +\t}\n>  \tif {[catch {file mkdir $gitktmpdir} err]} {\n>  \t    error_popup \"[mc \"Error creating temporary directory %s:\" $gitktmpdir] $err\"\n>  \t    unset gitktmpdir\n"},{"id":"245042","messageId":"xmqq4mz74cuv.fsf@gitster.dls.corp.google.com","threadId":"36960","inReplyTo":"1403146394-9589-1-git-send-email-davvid@gmail.com","subject":"Re: [PATCH] gitk: catch mkdtemp errors","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-06-26T20:47:36Z","receivedAt":"2014-06-26T20:47:36Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"David Aguilar <davvid@gmail.com> writes:\n\n> 105b5d3fbb1c00bb0aeaf9d3e0fbe26a7b1993fc introduced a dependency\n> on mkdtemp, which is not available on Windows.\n>\n> Use the original temporary directory behavior when mkdtemp fails.\n> This makes the code use mkdtemp when available and gracefully\n> fallback to the existing behavior when it is not available.\n>\n> Helped-by: Junio C Hamano <gitster@pobox.com>\n> Helped-by: brian m. carlson <sandals@crustytoothpaste.net>\n> Signed-off-by: David Aguilar <davvid@gmail.com>\n> ---\n\nIn the meantime, I've fetched from you and merged up to your\nmaster~2 aka 17f9836c (gitk: Show staged submodules regardless of\nignore config, 2014-04-08).\n\nThanks.\n\n>  gitk | 4 +++-\n>  1 file changed, 3 insertions(+), 1 deletion(-)\n>\n> diff --git a/gitk b/gitk\n> index 41e5071..9237830 100755\n> --- a/gitk\n> +++ b/gitk\n> @@ -3504,7 +3504,9 @@ proc gitknewtmpdir {} {\n>  \t    set tmpdir $gitdir\n>  \t}\n>  \tset gitktmpformat [file join $tmpdir \".gitk-tmp.XXXXXX\"]\n> -\tset gitktmpdir [exec mktemp -d $gitktmpformat]\n> +\tif {[catch {set gitktmpdir [exec mktemp -d $gitktmpformat]}]} {\n> +\t    set gitktmpdir [file join $gitdir [format \".gitk-tmp.%s\" [pid]]]\n> +\t}\n>  \tif {[catch {file mkdir $gitktmpdir} err]} {\n>  \t    error_popup \"[mc \"Error creating temporary directory %s:\" $gitktmpdir] $err\"\n>  \t    unset gitktmpdir\n"},{"id":"245049","messageId":"20140627030540.GB50083@gmail.com","threadId":"36960","inReplyTo":"xmqq8uoj4d43.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH] gitk: catch mkdtemp errors","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2014-06-27T03:05:40Z","receivedAt":"2014-06-27T03:05:40Z","isPatch":true,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"On Thu, Jun 26, 2014 at 01:42:04PM -0700, Junio C Hamano wrote:\n> David Aguilar <davvid@gmail.com> writes:\n> \n> > 105b5d3fbb1c00bb0aeaf9d3e0fbe26a7b1993fc introduced a dependency\n> > on mkdtemp, which is not available on Windows.\n> >\n> > Use the original temporary directory behavior when mkdtemp fails.\n> > This makes the code use mkdtemp when available and gracefully\n> > fallback to the existing behavior when it is not available.\n> >\n> > Helped-by: Junio C Hamano <gitster@pobox.com>\n> > Helped-by: brian m. carlson <sandals@crustytoothpaste.net>\n> > Signed-off-by: David Aguilar <davvid@gmail.com>\n> > ---\n> \n> Does this still need to be applied before I can pull from Paulus?\n\nYes, it would be nice to have this, especially for Windows users.\n-- \nDavid\n"},{"id":"245052","messageId":"20140627065842.GA21103@iris.ozlabs.ibm.com","threadId":"36960","inReplyTo":"1403146394-9589-1-git-send-email-davvid@gmail.com","subject":"Re: [PATCH] gitk: catch mkdtemp errors","fromName":"Paul Mackerras","fromEmail":"paulus@samba.org","sentAt":"2014-06-27T06:58:42Z","receivedAt":"2014-06-27T06:58:42Z","isPatch":true,"sender":{"key":"paulus@samba.org","avatar":"https://avatars.githubusercontent.com/u/1606439?v=4"},"body":"On Wed, Jun 18, 2014 at 07:53:14PM -0700, David Aguilar wrote:\n> 105b5d3fbb1c00bb0aeaf9d3e0fbe26a7b1993fc introduced a dependency\n> on mkdtemp, which is not available on Windows.\n> \n> Use the original temporary directory behavior when mkdtemp fails.\n> This makes the code use mkdtemp when available and gracefully\n> fallback to the existing behavior when it is not available.\n> \n> Helped-by: Junio C Hamano <gitster@pobox.com>\n> Helped-by: brian m. carlson <sandals@crustytoothpaste.net>\n> Signed-off-by: David Aguilar <davvid@gmail.com>\n\nThanks, applied (with slight modification to commit message).\n\nPaul.\n"},{"id":"245053","messageId":"20140627065924.GB21103@iris.ozlabs.ibm.com","threadId":"36960","inReplyTo":"xmqq4mz74cuv.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH] gitk: catch mkdtemp errors","fromName":"Paul Mackerras","fromEmail":"paulus@samba.org","sentAt":"2014-06-27T06:59:24Z","receivedAt":"2014-06-27T06:59:24Z","isPatch":true,"sender":{"key":"paulus@samba.org","avatar":"https://avatars.githubusercontent.com/u/1606439?v=4"},"body":"On Thu, Jun 26, 2014 at 01:47:36PM -0700, Junio C Hamano wrote:\n> David Aguilar <davvid@gmail.com> writes:\n> \n> > 105b5d3fbb1c00bb0aeaf9d3e0fbe26a7b1993fc introduced a dependency\n> > on mkdtemp, which is not available on Windows.\n> >\n> > Use the original temporary directory behavior when mkdtemp fails.\n> > This makes the code use mkdtemp when available and gracefully\n> > fallback to the existing behavior when it is not available.\n> >\n> > Helped-by: Junio C Hamano <gitster@pobox.com>\n> > Helped-by: brian m. carlson <sandals@crustytoothpaste.net>\n> > Signed-off-by: David Aguilar <davvid@gmail.com>\n> > ---\n> \n> In the meantime, I've fetched from you and merged up to your\n> master~2 aka 17f9836c (gitk: Show staged submodules regardless of\n> ignore config, 2014-04-08).\n\nI have applied and pushed out this patch, along with one from Max\nKirillov, so please do another fetch.\n\nThanks,\nPaul.\n"},{"id":"245080","messageId":"xmqqmwcy2ryp.fsf@gitster.dls.corp.google.com","threadId":"36960","inReplyTo":"20140627065924.GB21103@iris.ozlabs.ibm.com","subject":"Re: [PATCH] gitk: catch mkdtemp errors","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-06-27T17:16:30Z","receivedAt":"2014-06-27T17:16:30Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Paul Mackerras <paulus@samba.org> writes:\n\n> On Thu, Jun 26, 2014 at 01:47:36PM -0700, Junio C Hamano wrote:\n>> \n>> In the meantime, I've fetched from you and merged up to your\n>> master~2 aka 17f9836c (gitk: Show staged submodules regardless of\n>> ignore config, 2014-04-08).\n>\n> I have applied and pushed out this patch, along with one from Max\n> Kirillov, so please do another fetch.\n\nThanks, will do.\n"}]}