diff options
author | Alexander Gavrilov <angavrilov@gmail.com> | 2008-09-12 22:43:49 +0400 |
---|---|---|
committer | Shawn O. Pearce <spearce@spearce.org> | 2008-09-24 09:53:01 -0700 |
commit | 1e65c6225dea2e15df81f6c91927cb0b8fab443c (patch) | |
tree | 548d2536dee1b9ab93c0ae63013c442b87945395 /lib/commit.tcl | |
parent | 146ed90f020bb19446020d9b858242f176777797 (diff) | |
download | git-1e65c6225dea2e15df81f6c91927cb0b8fab443c.tar.gz git-1e65c6225dea2e15df81f6c91927cb0b8fab443c.tar.xz |
git-gui: Add more integration options to citool.
- Make citool return nonzero exit code if it did not commit.
- Add a mode where it does not actually commit and simply
exits with zero code. Commit message is either disabled,
or simply dumped to GITGUI_EDITMSG before exiting.
- Add an option to immediately start it in amend mode.
Rationale:
1) Use 'git citool --nocommit' instead of mergetool in scripts.
2) Use 'git citool --amend' to edit commits while rebasing.
Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'lib/commit.tcl')
-rw-r--r-- | lib/commit.tcl | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/commit.tcl b/lib/commit.tcl index 297731562..334514996 100644 --- a/lib/commit.tcl +++ b/lib/commit.tcl @@ -168,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. @@ -177,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]] @@ -212,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] @@ -410,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 # |