summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4658b56)
raw | patch | inline | side by side (parent: 4658b56)
author | Shawn O. Pearce <spearce@spearce.org> | |
Sun, 12 Nov 2006 23:03:19 +0000 (18:03 -0500) | ||
committer | Shawn O. Pearce <spearce@spearce.org> | |
Mon, 13 Nov 2006 05:10:38 +0000 (00:10 -0500) |
We were originally trying to use $commit_active to tell us if there was
a commit currently in progress, just so we didn't attempt to start a
second (parallel) one by mistake. But really the index lock handles
this for us as it won't let us lock the index if it is already locked
for update. So this can't happen.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
a commit currently in progress, just so we didn't attempt to start a
second (parallel) one by mistake. But really the index lock handles
this for us as it won't let us lock the index if it is already locked
for update. So this can't happen.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
git-gui | patch | blob | history |
index bee17de4ddccb8abd99773dd538cad90d26e54bb..3ccf0a41deb7e60b7294b3879db71e796264b8f6 100755 (executable)
--- a/git-gui
+++ b/git-gui
set status_active 0
set diff_active 0
-set commit_active 0
set disable_on_lock [list]
set index_lock_type none
proc commit_tree {} {
global tcl_platform HEAD gitdir commit_type file_states
- global commit_active pch_error
+ global pch_error
global ui_status_value ui_comm
- if {$commit_active || ![lock_index update]} return
+ if {![lock_index update]} return
# -- Our in memory state should match the repository.
#
return
}
- set commit_active 1
-
# -- Ask the pre-commit hook for the go-ahead.
#
set pchook [file join $gitdir hooks pre-commit]
}
proc commit_stage1 {fd_ph curHEAD msg} {
- global commit_active pch_error ui_status_value
+ global pch_error ui_status_value
append pch_error [read $fd_ph]
fconfigure $fd_ph -blocking 1
set ui_status_value {Commit declined by pre-commit hook.}
hook_failed_popup pre-commit $pch_error
unlock_index
- set commit_active 0
- set pch_error {}
- return
+ } else {
+ commit_stage2 $curHEAD $msg
}
- commit_stage2 $curHEAD $msg
- return
+ set pch_error {}
+ } else {
+ fconfigure $fd_ph -blocking 0
}
- fconfigure $fd_ph -blocking 0
}
proc commit_stage2 {curHEAD msg} {
proc commit_stage3 {fd_wt curHEAD msg} {
global single_commit gitdir HEAD PARENT commit_type
- global commit_active ui_status_value ui_comm
+ global ui_status_value ui_comm
global file_states
gets $fd_wt tree_id
if {$tree_id == {} || [catch {close $fd_wt} err]} {
error_popup "write-tree failed:\n\n$err"
- set commit_active 0
set ui_status_value {Commit failed.}
unlock_index
return
close $fd_mh
} err]} {
error_popup "Loading MERGE_HEAD failed:\n\n$err"
- set commit_active 0
set ui_status_value {Commit failed.}
unlock_index
return
lappend cmd << $msg
if {[catch {set cmt_id [eval exec $cmd]} err]} {
error_popup "commit-tree failed:\n\n$err"
- set commit_active 0
set ui_status_value {Commit failed.}
unlock_index
return
set cmd [list git update-ref -m $reflogm HEAD $cmt_id $curHEAD]
if {[catch {eval exec $cmd} err]} {
error_popup "update-ref failed:\n\n$err"
- set commit_active 0
set ui_status_value {Commit failed.}
unlock_index
return
# -- Update status without invoking any git commands.
#
- set commit_active 0
set commit_type normal
set HEAD $cmt_id
set PARENT $cmt_id