提交 1daf1d0c 编写于 作者: S Shawn O. Pearce

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: NShawn O. Pearce <spearce@spearce.org>
上级 6c6dd01a
......@@ -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
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册