summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e734817)
raw | patch | inline | side by side (parent: e734817)
author | Shawn O. Pearce <spearce@spearce.org> | |
Fri, 24 Nov 2006 20:38:18 +0000 (15:38 -0500) | ||
committer | Shawn O. Pearce <spearce@spearce.org> | |
Fri, 24 Nov 2006 20:38:18 +0000 (15:38 -0500) |
Users want to know what branch they are sitting on before making a commit,
as they may need to switch to a different branch first.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
as they may need to switch to a different branch first.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
git-gui | patch | blob | history |
index 34a1daa44d55146c2ac43e4c7a070cd6ce184b98..dd2d750ab17f9c1831ffea70459d07726bfcfaec 100755 (executable)
--- a/git-gui
+++ b/git-gui
## status
proc repository_state {ctvar hdvar mhvar} {
- global gitdir
+ global gitdir current_branch
upvar $ctvar ct $hdvar hd $mhvar mh
set mh [list]
+ if {[catch {set current_branch [exec git symbolic-ref HEAD]}]} {
+ set current_branch {}
+ } else {
+ regsub ^refs/(heads|tags)/ \
+ $current_branch \
+ {} \
+ current_branch
+ }
+
if {[catch {set hd [exec git rev-parse --verify HEAD]}]} {
set hd {}
set ct initial
}
+# -- Branch Control
+#
+frame .branch \
+ -borderwidth 1 \
+ -relief sunken
+label .branch.l1 \
+ -text {Current Branch:} \
+ -anchor w \
+ -justify left \
+ -font font_ui
+label .branch.cb \
+ -textvariable current_branch \
+ -anchor w \
+ -justify left \
+ -font font_ui
+pack .branch.l1 -side left
+pack .branch.cb -side left -fill x
+pack .branch -side top -fill x
+
# -- Main Window Layout
#
panedwindow .vpane -orient vertical
set MERGE_HEAD [list]
set commit_type {}
set empty_tree {}
+set current_branch {}
set current_diff {}
set selected_commit_type new