Code

Merge git://repo.or.cz/git-gui
[git.git] / git-gui / lib / commit.tcl
index 947b201c328eef044cfe21b463e8228031f6f8cd..334514996a9e900d124b5fdc54f83dc9924517b5 100644 (file)
@@ -149,7 +149,9 @@ The rescan will be automatically started now.
                _? {continue}
                A? -
                D? -
+               T_ -
                M? {set files_ready 1}
+               _U -
                U? {
                        error_popup [mc "Unmerged files cannot be committed.
 
@@ -166,7 +168,7 @@ File %s cannot be committed by this program.
                }
                }
        }
-       if {!$files_ready && ![string match *merge $curType]} {
+       if {!$files_ready && ![string match *merge $curType] && ![is_enabled nocommit]} {
                info_popup [mc "No changes to commit.
 
 You must stage at least 1 file before you can commit.
@@ -175,6 +177,8 @@ You must stage at least 1 file before you can commit.
                return
        }
 
+       if {[is_enabled nocommitmsg]} { do_quit 0 }
+
        # -- A message is required.
        #
        set msg [string trim [$ui_comm get 1.0 end]]
@@ -210,6 +214,8 @@ A good commit message has the following format:
        puts $msg_wt $msg
        close $msg_wt
 
+       if {[is_enabled nocommit]} { do_quit 0 }
+
        # -- Run the pre-commit hook.
        #
        set fd_ph [githook_read pre-commit]
@@ -218,7 +224,7 @@ A good commit message has the following format:
                return
        }
 
-       ui_status {Calling pre-commit hook...}
+       ui_status [mc "Calling pre-commit hook..."]
        set pch_error {}
        fconfigure $fd_ph -blocking 0 -translation binary -eofchar {}
        fileevent $fd_ph readable \
@@ -233,7 +239,7 @@ proc commit_prehook_wait {fd_ph curHEAD msg_p} {
        if {[eof $fd_ph]} {
                if {[catch {close $fd_ph}]} {
                        catch {file delete $msg_p}
-                       ui_status {Commit declined by pre-commit hook.}
+                       ui_status [mc "Commit declined by pre-commit hook."]
                        hook_failed_popup pre-commit $pch_error
                        unlock_index
                } else {
@@ -256,7 +262,7 @@ proc commit_commitmsg {curHEAD msg_p} {
                return
        }
 
-       ui_status {Calling commit-msg hook...}
+       ui_status [mc "Calling commit-msg hook..."]
        set pch_error {}
        fconfigure $fd_ph -blocking 0 -translation binary -eofchar {}
        fileevent $fd_ph readable \
@@ -271,7 +277,7 @@ proc commit_commitmsg_wait {fd_ph curHEAD msg_p} {
        if {[eof $fd_ph]} {
                if {[catch {close $fd_ph}]} {
                        catch {file delete $msg_p}
-                       ui_status {Commit declined by commit-msg hook.}
+                       ui_status [mc "Commit declined by commit-msg hook."]
                        hook_failed_popup commit-msg $pch_error
                        unlock_index
                } else {
@@ -284,7 +290,7 @@ proc commit_commitmsg_wait {fd_ph curHEAD msg_p} {
 }
 
 proc commit_writetree {curHEAD msg_p} {
-       ui_status {Committing changes...}
+       ui_status [mc "Committing changes..."]
        set fd_wt [git_read write-tree]
        fileevent $fd_wt readable \
                [list commit_committree $fd_wt $curHEAD $msg_p]
@@ -301,7 +307,7 @@ proc commit_committree {fd_wt curHEAD msg_p} {
        if {[catch {close $fd_wt} err]} {
                catch {file delete $msg_p}
                error_popup [strcat [mc "write-tree failed:"] "\n\n$err"]
-               ui_status {Commit failed.}
+               ui_status [mc "Commit failed."]
                unlock_index
                return
        }
@@ -345,7 +351,7 @@ A rescan will be automatically started now.
        if {[catch {set cmt_id [eval git $cmd]} err]} {
                catch {file delete $msg_p}
                error_popup [strcat [mc "commit-tree failed:"] "\n\n$err"]
-               ui_status {Commit failed.}
+               ui_status [mc "Commit failed."]
                unlock_index
                return
        }
@@ -365,7 +371,7 @@ A rescan will be automatically started now.
                } err]} {
                catch {file delete $msg_p}
                error_popup [strcat [mc "update-ref failed:"] "\n\n$err"]
-               ui_status {Commit failed.}
+               ui_status [mc "Commit failed."]
                unlock_index
                return
        }
@@ -408,7 +414,7 @@ A rescan will be automatically started now.
                set ::GITGUI_BCK_exists 0
        }
 
-       if {[is_enabled singlecommit]} do_quit
+       if {[is_enabled singlecommit]} { do_quit 0 }
 
        # -- Update in memory status
        #
@@ -428,6 +434,7 @@ A rescan will be automatically started now.
                __ -
                A_ -
                M_ -
+               T_ -
                D_ {
                        unset file_states($path)
                        catch {unset selected_paths($path)}