summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e57ca85)
raw | patch | inline | side by side (parent: e57ca85)
author | Shawn O. Pearce <spearce@spearce.org> | |
Tue, 7 Nov 2006 03:03:05 +0000 (22:03 -0500) | ||
committer | Shawn O. Pearce <spearce@spearce.org> | |
Tue, 7 Nov 2006 08:05:17 +0000 (03:05 -0500) |
* Make sure we are in the top level working directory. This
way we can access files using their repository path.
* Reload the diff viewer if the current file's status has changed;
as the diff may now be different.
* Correctly handle the 'AD' file state: added but now gone from
the working directory.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
way we can access files using their repository path.
* Reload the diff viewer if the current file's status has changed;
as the diff may now be different.
* Correctly handle the 'AD' file state: added but now gone from
the working directory.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
git-gui | patch | blob | history |
index bb89da43320ed53b819fa9f973c6cdaaf8783128..8ad3f2d033d29b47471c89f28dc44b8e912e8805 100755 (executable)
--- a/git-gui
+++ b/git-gui
$ui_diff conf -state normal
$ui_diff insert end $content
$ui_diff conf -state disabled
+ set diff_active 0
+ unlock_index
+ set ui_status_value {Ready.}
return
}
}
set ui_status_value {Committing changes...}
set fd_wt [open "| git write-tree" r]
- fileevent $fd_wt readable \
- [list commit_stage2 $fd_wt $curHEAD $msg]
+ fileevent $fd_wt readable [list commit_stage2 $fd_wt $curHEAD $msg]
}
proc commit_stage2 {fd_wt curHEAD msg} {
if {$commit_type == {merge}} {
if {[catch {
set fd_mh [open [file join $gitdir MERGE_HEAD] r]
- while {[gets $fd_mh merge_head] > 0} {
- lappend -p $merge_head
+ while {[gets $fd_mh merge_head] >= 0} {
+ lappend cmd -p $merge_head
}
close $fd_mh
} err]} {
set commit_type {}
set commit_active 0
+ set HEAD $cmt_id
+ set PARENT $cmt_id
unlock_index
update_status "Changes committed as $cmt_id."
}
}
proc toggle_mode {path} {
- global file_states
+ global file_states ui_fname_value
set s $file_states($path)
set m [lindex $s 0]
_O {set new A*}
_M -
MM {set new M*}
+ AD -
_D {set new D*}
default {return}
}
with_update_index {update_index $path}
display_file $path $new
+ if {$ui_fname_value == $path} {
+ show_diff $path
+ }
}
######################################################################
{_O o plain "Untracked"}
{A_ o fulltick "Added"}
{AM o parttick "Partially added"}
+ {AD o question "Added (but now gone)"}
{_D i question "Missing"}
{D_ i removed "Removed"}
# -- Commit Message Buffer
frame .vpane.commarea.buffer
set ui_comm .vpane.commarea.buffer.t
-label .vpane.commarea.buffer.l -text {Commit Message:} \
+set ui_coml .vpane.commarea.buffer.l
+label $ui_coml -text {Commit Message:} \
-anchor w \
-justify left \
-font $mainfont
+trace add variable commit_type write {uplevel #0 {
+ switch -glob $commit_type \
+ initial {$ui_coml conf -text {Initial Commit Message:}} \
+ amend {$ui_coml conf -text {Amended Commit Message:}} \
+ merge {$ui_coml conf -text {Merge Commit Message:}} \
+ * {$ui_coml conf -text {Commit Message:}}
+}}
text $ui_comm -background white -borderwidth 1 \
-relief sunken \
-width 75 -height 10 -wrap none \
-yscrollcommand {.vpane.commarea.buffer.sby set} \
-cursor $maincursor
scrollbar .vpane.commarea.buffer.sby -command [list $ui_comm yview]
-pack .vpane.commarea.buffer.l -side top -fill x
+pack $ui_coml -side top -fill x
pack .vpane.commarea.buffer.sby -side right -fill y
pack $ui_comm -side left -fill y
pack .vpane.commarea.buffer -side left -fill y
show_msg {} . "Cannot find the git directory: $err"
exit 1
}
+set cdup [exec git rev-parse --show-cdup]
+if {$cdup != ""} {
+ cd $cdup
+}
+unset cdup
set appname [lindex [file split $argv0] end]
if {$appname == {git-citool}} {