From 82a2d6bdf9532812e2f315477494956a2f26e2cd Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Tue, 19 Jun 2007 10:48:09 -0400 Subject: git-gui: Correctly install to /usr/bin on Cygwin Mark Levedahl noted that installation on Cygwin to /usr/bin can cause problems with the automatic guessing of our library location. The problem is that installation to /usr/bin means we actually have: /usr/bin = c:\cygwin\bin /usr/share = c:\cygwin\usr\share So git-gui guesses that its library should be found within the c:\cygwin\share directory, as that is where it should be relative to the script itself in c:\cygwin\bin. In my first version of this patch I tried to use `cygpath` to resolve /usr/bin and /usr/share to test that they were in the same relative locations, but that didn't work out correctly as we were actually testing /usr/share against itself, so it always was equal, and we always used relative paths. So my original solution was quite wrong. Mark suggested we just always disable relative behavior on Cygwin, because of the complexity of the mount mapping problem, so that's all I'm doing. Signed-off-by: Shawn O. Pearce diff --git a/Makefile b/Makefile index 3de0de1..9d99f67 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,8 @@ GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE @$(SHELL_PATH) ./GIT-VERSION-GEN -include GIT-VERSION-FILE +uname_O := $(shell sh -c 'uname -o 2>/dev/null || echo not') + SCRIPT_SH = git-gui.sh GITGUI_BUILT_INS = git-citool ALL_PROGRAMS = $(GITGUI_BUILT_INS) $(patsubst %.sh,%,$(SCRIPT_SH)) @@ -58,8 +60,12 @@ exedir_SQ = $(subst ','\'',$(exedir)) $(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh $(QUIET_GEN)rm -f $@ $@+ && \ + GITGUI_RELATIVE= && \ if test '$(exedir_SQ)' = '$(libdir_SQ)'; then \ - GITGUI_RELATIVE=1; \ + if test "$(uname_O)" = Cygwin; \ + then GITGUI_RELATIVE= ; \ + else GITGUI_RELATIVE=1; \ + fi; \ fi && \ sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \ -e 's|^exec wish "$$0"|exec $(subst |,'\|',$(TCLTK_PATH_SQ)) "$$0"|' \ -- cgit v0.10.2-6-g49f6 From fb626dc00044c106652ae39300b4cb613af70ab1 Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Tue, 12 Jun 2007 00:04:30 -0400 Subject: git-gui: Bind Tab/Shift-Tab to cycle between panes in blame The blame viewer is composed of two different areas, the file area on top and the commit area on the bottom. If users are trying to shift the focus it is probably because they want to shift from one area to the other, so we just setup Tab and Shift-Tab to jump from the one half to the other in a cycle. Signed-off-by: Shawn O. Pearce diff --git a/lib/blame.tcl b/lib/blame.tcl index 139171d..076233c 100644 --- a/lib/blame.tcl +++ b/lib/blame.tcl @@ -272,6 +272,8 @@ constructor new {i_commit i_path} { set cursorW %W tk_popup $w.ctxm %X %Y " + bind $i "[list focus $w_cviewer];break" + bind $i "[list focus $w_cviewer];break" } foreach i [concat $w_columns $w_cviewer] { @@ -287,8 +289,10 @@ constructor new {i_commit i_path} { bind $i {catch {%W yview scroll 1 pages};break} } + bind $w_cviewer "[list focus $w_file];break" + bind $w_cviewer "[list focus $w_file];break" bind $w_cviewer [list focus $w_cviewer] - bind $top [list focus $top] + bind $w_file [list focus $w_file] grid configure $w.header -sticky ew grid configure $w.file_pane -sticky nsew -- cgit v0.10.2-6-g49f6