{"thread":{"id":"29903","subject":"[PATCH] git-gui: Use PWD if it exists on Mac OS X.","startedAt":"2012-03-09T23:17:22Z","lastAt":"2012-03-10T23:18:48Z","messageCount":3,"participants":["Marcus Karlsson","Junio C Hamano","Pat Thoyts"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"186602","messageId":"1331335042-25509-1-git-send-email-mk@acc.umu.se","threadId":"29903","inReplyTo":null,"subject":"[PATCH] git-gui: Use PWD if it exists on Mac OS X.","fromName":"Marcus Karlsson","fromEmail":"mk@acc.umu.se","sentAt":"2012-03-09T23:17:22Z","receivedAt":"2012-03-09T23:17:22Z","isPatch":true,"sender":{"key":"mk@acc.umu.se","avatar":null},"body":"The current working directory is set to / when git-gui is invoked\nusing the Git Gui.app bundle on Mac OS X. This means that if it is\nlaunched from a directory which contains a repository then git-gui\nwon't automatically find it unless the repository happens to be\nlocated in /.\n\nThe PWD environment variable is however preserved if the bundle is\ninvoked using open(1). If git-gui would check for PWD then a user\ncould for example type open -a 'Git Gui' on a command line in order to\nlaunch the program and it would automatically find the repository.\n\nTeach git-gui to use the PWD environment variable on Mac OS X.\n\nSigned-off-by: Marcus Karlsson <mk@acc.umu.se>\n---\n git-gui/macosx/AppMain.tcl |    4 +++-\n 1 file changed, 3 insertions(+), 1 deletion(-)\n\ndiff --git a/git-gui/macosx/AppMain.tcl b/git-gui/macosx/AppMain.tcl\nindex ddbe633..738bdd0 100644\n--- a/git-gui/macosx/AppMain.tcl\n+++ b/git-gui/macosx/AppMain.tcl\n@@ -12,7 +12,9 @@ if {[file tail [lindex $argv 0]] eq {gitk}} {\n } else {\n \tset argv0 [file join $gitexecdir [file tail [lindex $argv 0]]]\n \tset AppMain_source [file join $gitguilib git-gui.tcl]\n-\tif {[pwd] eq {/}} {\n+\tif {[info exists env(PWD)]} {\n+\t\tcd $env(PWD)\n+\t} elseif {[pwd] eq {/}} {\n \t\tcd $env(HOME)\n \t}\n }\n-- \n1.7.10.rc0.17.g36a9f\n"},{"id":"186603","messageId":"7vty1x2vod.fsf@alter.siamese.dyndns.org","threadId":"29903","inReplyTo":"1331335042-25509-1-git-send-email-mk@acc.umu.se","subject":"Re: [PATCH] git-gui: Use PWD if it exists on Mac OS X.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-03-09T23:37:06Z","receivedAt":"2012-03-09T23:37:06Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thanks, Marcus.\n\nJust forwarding to the current maintainer; please note that my\nsign-off does not mean anything more than what D-C-O says it means;\nI rarely if ever use git-gui myself and do not have a Macintosh.\n\n-- >8 --\nFrom: Marcus Karlsson <mk@acc.umu.se>\nSubject: [PATCH] git-gui: Use PWD if it exists on Mac OS X\nDate: Sat, 10 Mar 2012 00:17:22 +0100\n\nThe current working directory is set to / when git-gui is invoked\nusing the Git Gui.app bundle on Mac OS X. This means that if it is\nlaunched from a directory which contains a repository then git-gui\nwon't automatically find it unless the repository happens to be\nlocated in /.\n\nThe PWD environment variable is however preserved if the bundle is\ninvoked using open(1). If git-gui would check for PWD then a user\ncould for example type open -a 'Git Gui' on a command line in order to\nlaunch the program and it would automatically find the repository.\n\nTeach git-gui to use the PWD environment variable on Mac OS X.\n\nSigned-off-by: Marcus Karlsson <mk@acc.umu.se>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n git-gui/macosx/AppMain.tcl |    4 +++-\n 1 file changed, 3 insertions(+), 1 deletion(-)\n\ndiff --git a/git-gui/macosx/AppMain.tcl b/git-gui/macosx/AppMain.tcl\nindex ddbe633..738bdd0 100644\n--- a/git-gui/macosx/AppMain.tcl\n+++ b/git-gui/macosx/AppMain.tcl\n@@ -12,7 +12,9 @@ if {[file tail [lindex $argv 0]] eq {gitk}} {\n } else {\n \tset argv0 [file join $gitexecdir [file tail [lindex $argv 0]]]\n \tset AppMain_source [file join $gitguilib git-gui.tcl]\n-\tif {[pwd] eq {/}} {\n+\tif {[info exists env(PWD)]} {\n+\t\tcd $env(PWD)\n+\t} elseif {[pwd] eq {/}} {\n \t\tcd $env(HOME)\n \t}\n }\n-- \n1.7.10.rc0.17.g36a9f\n"},{"id":"186862","messageId":"877gys11uv.fsf@fox.patthoyts.tk","threadId":"29903","inReplyTo":"7vty1x2vod.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] git-gui: Use PWD if it exists on Mac OS X.","fromName":"Pat Thoyts","fromEmail":"patthoyts@users.sourceforge.net","sentAt":"2012-03-10T23:18:48Z","receivedAt":"2012-03-10T23:18:48Z","isPatch":true,"sender":{"key":"patthoyts@users.sourceforge.net","avatar":"https://avatars.githubusercontent.com/u/30739?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n>Thanks, Marcus.\n>\n>Just forwarding to the current maintainer; please note that my\n>sign-off does not mean anything more than what D-C-O says it means;\n>I rarely if ever use git-gui myself and do not have a Macintosh.\n\nThanks for this. I also don't have a Mac but this looks sensible\nso applied.\n\n-- \nPat Thoyts                            http://www.patthoyts.tk/\nPGP fingerprint 2C 6E 98 07 2C 59 C8 97  10 CE 11 E6 04 E0 B9 DD\n"}]}