@matheusbsbs / matheus-bagliano / commits / afd5424085
Fork 0

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>

Petr Baudis committed Sep 25, 2008 at 00:05 UTC afd5424085151990b5ac87da09e5cea76809d7c0
1 file changed +18
git-gui.sh
+18
@@ -1869,6 +1869,19 @@ proc do_gitk {revs} {
1869 }
1870 }
1871
1872 +proc do_explore {} {
1873 + set explorer {}
1874 + if {[is_Cygwin] || [is_Windows]} {
1875 + set explorer "explorer.exe"
1876 + } elseif {[is_MacOSX]} {
1877 + set explorer "open"
1878 + } else {
1879 + # freedesktop.org-conforming system is our best shot
1880 + set explorer "xdg-open"
1881 + }
1882 + eval exec $explorer [file dirname [gitdir]] &
1883 +}
1884 +
1885 set is_quitting 0
1886 set ret_code 1
1887
@@ -2220,6 +2233,11 @@ if {[is_enabled transport]} {
2233 #
2234 menu .mbar.repository
2235
2236 +.mbar.repository add command \
2237 + -label [mc "Explore Working Copy"] \
2238 + -command {do_explore}
2239 +.mbar.repository add separator
2240 +
2241 .mbar.repository add command \
2242 -label [mc "Browse Current Branch's Files"] \
2243 -command {browser::new $current_branch}