summaryrefslogtreecommitdiff
path: root/git-gui
diff options
context:
space:
mode:
authorLibravatar Shawn O. Pearce <spearce@spearce.org>2006-11-11 20:44:03 -0500
committerLibravatar Shawn O. Pearce <spearce@spearce.org>2006-11-12 00:16:03 -0500
commit1daf1d0c81c7c2623867f7884c8cbc5ff0a10d30 (patch)
tree2d578b4e16912469a013b036ad1c3db58b6d9916 /git-gui
parentgit-gui: Fix mouse cursor behavior when in widgets. (diff)
downloadtgif-1daf1d0c81c7c2623867f7884c8cbc5ff0a10d30.tar.xz
git-gui: Teach sign off to be more intelligent.
When we sign off on a commit we want to add a blank line between whatever is in the commit buffer and the new Signed-off-by line, unless there already is a Signed-off-by (or Acked-by) tag at the end of the buffer already. This change makes us do the right thing more often. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'git-gui')
-rwxr-xr-xgit-gui11
1 files changed, 8 insertions, 3 deletions
diff --git a/git-gui b/git-gui
index 9a259c0dcb..8a42c97cb1 100755
--- a/git-gui
+++ b/git-gui
@@ -1510,10 +1510,15 @@ proc do_signoff {} {
}
}
- set str "Signed-off-by: $GIT_COMMITTER_IDENT"
- if {[$ui_comm get {end -1c linestart} {end -1c}] != $str} {
+ set sob "Signed-off-by: $GIT_COMMITTER_IDENT"
+ set last [$ui_comm get {end -1c linestart} {end -1c}]
+ if {$last != $sob} {
$ui_comm edit separator
- $ui_comm insert end "\n$str"
+ if {$last != {}
+ && ![regexp {^[A-Z][A-Za-z]*-[A-Za-z-]+: *} $last]} {
+ $ui_comm insert end "\n"
+ }
+ $ui_comm insert end "\n$sob"
$ui_comm edit separator
$ui_comm see end
}