{"thread":{"id":"43820","subject":"[PATCH] git-gui: Add Explore Working Copy to the Repository menu","startedAt":"2008-09-24T22:05:53Z","lastAt":"2008-09-24T22:05:53Z","messageCount":1,"participants":["Petr Baudis"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"299068","messageId":"1222293953-14320-1-git-send-email-pasky@suse.cz","threadId":"43820","inReplyTo":null,"subject":"[PATCH] git-gui: Add Explore Working Copy to the Repository menu","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2008-09-24T22:05:53Z","receivedAt":"2008-09-24T22:05:53Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"Especially when cloning is finished, the Git GUI window pops up,\nbut there is not really much one can do within it - there needs to be\na way to easily start exploring and working with the new working copy\nusing the standard system interface: explorer.exe on Windows, open on\nMacOS/X and xdg-open as a fallback (all modern Linux desktops).\n\nThis might be also a post-clone option instead (possibly opening the window\nautomagically) but I believe that this might be useful also in other\nsituations, e.g. you don't have to keep the working copy window around\nif you work in multiple repositories.\n\nThis operation will not make sense on bare repositories.\n\nThis patch has been sponsored by Novartis.\n\nSigned-off-by: Petr Baudis <pasky@suse.cz>\n\n---\n git-gui/git-gui.sh |   18 ++++++++++++++++++\n 1 files changed, 18 insertions(+), 0 deletions(-)\n\ndiff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh\nindex 10d8a44..a64d34d 100755\n--- a/git-gui/git-gui.sh\n+++ b/git-gui/git-gui.sh\n@@ -1750,6 +1750,19 @@ proc do_gitk {revs} {\n \t}\n }\n \n+proc do_explore {} {\n+\tset explorer {}\n+\tif {[is_Cygwin] || [is_Windows]} {\n+\t\tset explorer \"explorer.exe\"\n+\t} elseif {[is_MacOSX]} {\n+\t\tset explorer \"open\"\n+\t} else {\n+\t\t# freedesktop.org-conforming system is our best shot\n+\t\tset explorer \"xdg-open\"\n+\t}\n+\teval exec $explorer [file dirname [gitdir]] &\n+}\n+\n set is_quitting 0\n \n proc do_quit {} {\n@@ -2089,6 +2102,11 @@ if {[is_enabled transport]} {\n menu .mbar.repository\n \n .mbar.repository add command \\\n+\t-label [mc \"Explore Working Copy\"] \\\n+\t-command {do_explore}\n+.mbar.repository add separator\n+\n+.mbar.repository add command \\\n \t-label [mc \"Browse Current Branch's Files\"] \\\n \t-command {browser::new $current_branch}\n set ui_browse_current [.mbar.repository index last]\n-- \ntg: (c427559..) t/git-gui/explore (depends on: vanilla/master)\n"}]}