summaryrefslogtreecommitdiff
path: root/git-gui.sh
diff options
context:
space:
mode:
authorPetr Baudis <pasky@suse.cz>2008-09-24 22:05:53 (GMT)
committerShawn O. Pearce <spearce@spearce.org>2008-09-30 19:59:18 (GMT)
commitafd5424085151990b5ac87da09e5cea76809d7c0 (patch)
treeaea49dfb2727d3fe65590536169332a59875ebc4 /git-gui.sh
parent2db21e709a1345d84178e53079e861232c243bd1 (diff)
downloadgit-afd5424085151990b5ac87da09e5cea76809d7c0.zip
git-afd5424085151990b5ac87da09e5cea76809d7c0.tar.gz
git-afd5424085151990b5ac87da09e5cea76809d7c0.tar.bz2
git-gui: Add Explore Working Copy to the Repository menu
Especially when cloning is finished, the Git GUI window pops up, but there is not really much one can do within it - there needs to be a way to easily start exploring and working with the new working copy using the standard system interface: explorer.exe on Windows, open on MacOS/X and xdg-open as a fallback (all modern Linux desktops). This might be also a post-clone option instead (possibly opening the window automagically) but I believe that this might be useful also in other situations, e.g. you don't have to keep the working copy window around if you work in multiple repositories. This operation will not make sense on bare repositories. Signed-off-by: Petr Baudis <petr.baudis@novartis.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'git-gui.sh')
-rwxr-xr-xgit-gui.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/git-gui.sh b/git-gui.sh
index fffb1e9..c4c66c0 100755
--- a/git-gui.sh
+++ b/git-gui.sh
@@ -1869,6 +1869,19 @@ proc do_gitk {revs} {
}
}
+proc do_explore {} {
+ set explorer {}
+ if {[is_Cygwin] || [is_Windows]} {
+ set explorer "explorer.exe"
+ } elseif {[is_MacOSX]} {
+ set explorer "open"
+ } else {
+ # freedesktop.org-conforming system is our best shot
+ set explorer "xdg-open"
+ }
+ eval exec $explorer [file dirname [gitdir]] &
+}
+
set is_quitting 0
set ret_code 1
@@ -2221,6 +2234,11 @@ if {[is_enabled transport]} {
menu .mbar.repository
.mbar.repository add command \
+ -label [mc "Explore Working Copy"] \
+ -command {do_explore}
+.mbar.repository add separator
+
+.mbar.repository add command \
-label [mc "Browse Current Branch's Files"] \
-command {browser::new $current_branch}
set ui_browse_current [.mbar.repository index last]