@matheusbsbs / matheus-bagliano / commits / dfb891e351
Fork 0

gitk: Enable gitk to create tags with messages

Currently, tags created using the "create tag" dialog in gitk are always lightweight tags, i.e., they don't have any annotation (message). This enables the user to specify a message; if they do, gitk will create an unsigned, annotated tag object. Signed-off-by: David Dulson <dave@dulson.com> Signed-off-by: Paul Mackerras <paulus@samba.org>

Dave Dulson committed Jan 3, 2010 at 14:55 UTC dfb891e35100cf78873c5cf81ffe778dbe235ef5
1 file changed +11 -1
gitk
+11 -1
@@ -8701,6 +8701,11 @@ proc mktag {} {
8701 ${NS}::label $top.tlab -text [mc "Tag name:"]
8702 ${NS}::entry $top.tag -width 60
8703 grid $top.tlab $top.tag -sticky w
8704 + ${NS}::label $top.op -text [mc "Tag message is optional"]
8705 + grid $top.op -columnspan 2 -sticky we
8706 + ${NS}::label $top.mlab -text [mc "Tag message:"]
8707 + ${NS}::entry $top.msg -width 60
8708 + grid $top.mlab $top.msg -sticky w
8709 ${NS}::frame $top.buts
8710 ${NS}::button $top.buts.gen -text [mc "Create"] -command mktaggo
8711 ${NS}::button $top.buts.can -text [mc "Cancel"] -command mktagcan
@@ -8718,6 +8723,7 @@ proc domktag {} {
8723
8724 set id [$mktagtop.sha1 get]
8725 set tag [$mktagtop.tag get]
8726 + set msg [$mktagtop.msg get]
8727 if {$tag == {}} {
8728 error_popup [mc "No tag name specified"] $mktagtop
8729 return 0
@@ -8727,7 +8733,11 @@ proc domktag {} {
8733 return 0
8734 }
8735 if {[catch {
8730 - exec git tag $tag $id
8736 + if {$msg != {}} {
8737 + exec git tag -a -m $msg $tag $id
8738 + } else {
8739 + exec git tag $tag $id
8740 + }
8741 } err]} {
8742 error_popup "[mc "Error creating tag:"] $err" $mktagtop
8743 return 0