Skip to content

Commit dfb891e

Browse files
davedulsonpaulusmack
authored andcommitted
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 <[email protected]> Signed-off-by: Paul Mackerras <[email protected]>
1 parent be8e40d commit dfb891e

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

gitk

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8701,6 +8701,11 @@ proc mktag {} {
87018701
${NS}::label $top.tlab -text [mc "Tag name:"]
87028702
${NS}::entry $top.tag -width 60
87038703
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
87048709
${NS}::frame $top.buts
87058710
${NS}::button $top.buts.gen -text [mc "Create"] -command mktaggo
87068711
${NS}::button $top.buts.can -text [mc "Cancel"] -command mktagcan
@@ -8718,6 +8723,7 @@ proc domktag {} {
87188723

87198724
set id [$mktagtop.sha1 get]
87208725
set tag [$mktagtop.tag get]
8726+
set msg [$mktagtop.msg get]
87218727
if {$tag == {}} {
87228728
error_popup [mc "No tag name specified"] $mktagtop
87238729
return 0
@@ -8727,7 +8733,11 @@ proc domktag {} {
87278733
return 0
87288734
}
87298735
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+
}
87318741
} err]} {
87328742
error_popup "[mc "Error creating tag:"] $err" $mktagtop
87338743
return 0

0 commit comments

Comments
 (0)