{"thread":{"id":"32172","subject":"[PATCH] gitk tag delete/rename support","startedAt":"2012-11-23T05:51:39Z","lastAt":"2013-01-02T07:11:53Z","messageCount":7,"participants":["Leon KUKOVEC","Ramkumar Ramachandra","Junio C Hamano","Paul Mackerras"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"203685","messageId":"1353649899-15641-1-git-send-email-leon.kukovec@gmail.com","threadId":"32172","inReplyTo":null,"subject":"[PATCH] gitk tag delete/rename support","fromName":"Leon KUKOVEC","fromEmail":"leon.kukovec@gmail.com","sentAt":"2012-11-23T05:51:39Z","receivedAt":"2012-11-23T05:51:39Z","isPatch":true,"sender":{"key":"leon.kukovec@gmail.com","avatar":null},"body":"---\n gitk-git/gitk |  154 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n 1 file changed, 154 insertions(+)\n\ndiff --git a/gitk-git/gitk b/gitk-git/gitk\nindex 17ba10a..12a7139 100755\n--- a/gitk-git/gitk\n+++ b/gitk-git/gitk\n@@ -1981,6 +1981,7 @@ proc makewindow {} {\n     global have_tk85 use_ttk NS\n     global git_version\n     global worddiff\n+    global tagctxmenu\n \n     # The \"mc\" arguments here are purely so that xgettext\n     # sees the following string as needing to be translated\n@@ -2526,6 +2527,13 @@ proc makewindow {} {\n \t{mc \"Run git gui blame on this line\" command {external_blame_diff}}\n     }\n     $diff_menu configure -tearoff 0\n+\n+    set tagctxmenu .tagctxmenu\n+    makemenu $tagctxmenu {\n+\t{mc \"Rename this tag\" command mvtag}\n+\t{mc \"Delete this tag\" command rmtag}\n+    }\n+    $tagctxmenu configure -tearoff 0\n }\n \n # Windows sends all mouse wheel events to the current focused window, not\n@@ -6345,6 +6353,7 @@ proc drawtags {id x xt y1} {\n \t\t   -font $font -tags [list tag.$id text]]\n \tif {$ntags >= 0} {\n \t    $canv bind $t <1> [list showtag $tag_quoted 1]\n+\t    $canv bind $t $ctxbut [list showtagmenu %X %Y $id $tag_quoted]\n \t} elseif {$nheads >= 0} {\n \t    $canv bind $t $ctxbut [list headmenu %X %Y $id $tag_quoted]\n \t}\n@@ -8857,6 +8866,113 @@ proc domktag {} {\n     return 1\n }\n \n+proc mvtag {} {\n+    global mvtagtop\n+    global tagmenuid tagmenutag tagctxmenu maintag NS\n+    global mvtagtag\n+\n+    set mvtagtag $tagmenutag\n+    set top .movetag\n+    set mvtagtop $top\n+    catch {destroy $top}\n+    ttk_toplevel $top\n+    make_transient $top .\n+\n+    ${NS}::label $top.msg -text [mc \"Enter a new tag name:\"]\n+    ${NS}::entry $top.tag -width 60 -textvariable mvtagtag\n+\n+    grid $top.msg -sticky w -row 0 -column 0\n+    grid $top.tag -sticky w -row 0 -column 1\n+\n+    ${NS}::frame $top.buts\n+    ${NS}::button $top.buts.gen -text [mc \"Rename\"] -command mvtaggo\n+    ${NS}::button $top.buts.can -text [mc \"Cancel\"] -command mvtagcan\n+    bind $top <Key-Return> mvtaggo\n+    bind $top <Key-Escape> mvtagcan\n+    grid $top.buts.gen $top.buts.can\n+    grid columnconfigure $top.buts 0 -weight 1 -uniform a\n+    grid columnconfigure $top.buts 1 -weight 1 -uniform a\n+    grid $top.buts - -pady 10 -sticky ew\n+}\n+\n+proc domvtag {} {\n+    global mvtagtop env tagids idtags tagmenutag tagmenuid mvtagtag\n+\n+    set tag $mvtagtag\n+    set id $tagmenuid\n+\n+    # add tag\n+    # XXX: reuse domktag including keeping comment from the original tag.\n+    if {[catch {\n+        exec git tag $tag $id\n+    } err]} {\n+        error_popup \"[mc \"Error renaming tag:\"] $err\" $mvtagtop\n+        return 0\n+    }\n+\n+    # delete old tag, content stored in $tagmenutag and $tagmenuid\n+    dormtag\n+\n+    set tagids($tag) $id\n+    lappend idtags($id) $tag\n+    redrawtags $id\n+    addedtag $id\n+    dispneartags 0\n+    run refill_reflist\n+    return 1\n+}\n+\n+proc rmtag {} {\n+    global rmtagtop\n+    global tagmenuid tagmenutag tagctxmenu maintag NS\n+\n+    set top .maketag\n+    set rmtagtop $top\n+    catch {destroy $top}\n+    ttk_toplevel $top\n+    make_transient $top .\n+    ${NS}::label $top.title -text [mc \"Delete tag\"]\n+    grid $top.title - -pady 10\n+\n+    ${NS}::label $top.msg -text [mc \"You are about to delete a tag\"]\n+    ${NS}::label $top.tagname -foreground Red -text [mc \"$tagmenutag\"]\n+    grid $top.msg -sticky w -row 0 -column 0\n+    grid $top.tagname -sticky w -row 0 -column 1\n+\n+    ${NS}::frame $top.buts\n+    ${NS}::button $top.buts.gen -text [mc \"Delete\"] -command rmtaggo\n+    ${NS}::button $top.buts.can -text [mc \"Cancel\"] -command rmtagcan\n+    bind $top <Key-Return> rmtaggo\n+    bind $top <Key-Escape> rmtagcan\n+    grid $top.buts.gen $top.buts.can\n+    grid columnconfigure $top.buts 0 -weight 1 -uniform a\n+    grid columnconfigure $top.buts 1 -weight 1 -uniform a\n+    grid $top.buts - -pady 10 -sticky ew\n+}\n+\n+proc dormtag {} {\n+    global rmtagtop env tagids idtags tagmenutag tagmenuid\n+\n+    set tag $tagmenutag\n+    set id $tagmenuid\n+\n+    if {[catch {\n+        exec git tag -d $tag\n+    } err]} {\n+        error_popup \"[mc \"Error deleting tag:\"] $err\" $rmtagtop\n+        return 0\n+    }\n+\n+    unset tagids($tag)\n+    set idx [lsearch $idtags($id) $tag]\n+    set idtags($id) [lreplace $idtags($id) $idx $idx]\n+\n+    redrawtags $id\n+    dispneartags 0\n+    run refill_reflist\n+    return 1\n+}\n+\n proc redrawtags {id} {\n     global canv linehtag idpos currentid curview cmitlisted markedid\n     global canvxmax iddrawn circleitem mainheadid circlecolors\n@@ -8900,6 +9016,30 @@ proc mktaggo {} {\n     mktagcan\n }\n \n+proc rmtagcan {} {\n+    global rmtagtop\n+\n+    catch {destroy $rmtagtop}\n+    unset rmtagtop\n+}\n+\n+proc rmtaggo {} {\n+    if {![dormtag]} return\n+    rmtagcan\n+}\n+\n+proc mvtagcan {} {\n+    global mvtagtop\n+\n+    catch {destroy $mvtagtop}\n+    unset mvtagtop\n+}\n+\n+proc mvtaggo {} {\n+    if {![domvtag]} return\n+    mvtagcan\n+}\n+\n proc writecommit {} {\n     global rowmenuid wrcomtop commitinfo wrcomcmd NS\n \n@@ -9214,6 +9354,20 @@ proc headmenu {x y id head} {\n     tk_popup $headctxmenu $x $y\n }\n \n+# context menu for a tag\n+proc showtagmenu {x y id tag} {\n+    global tagmenuid tagmenutag tagctxmenu maintag\n+\n+    stopfinding\n+    set tagmenuid $id\n+    set tagmenutag $tag\n+    set state normal\n+\n+    $tagctxmenu entryconfigure 0 -state normal\n+    $tagctxmenu entryconfigure 1 -state normal\n+    tk_popup $tagctxmenu $x $y\n+}\n+\n proc cobranch {} {\n     global headmenuid headmenuhead headids\n     global showlocalchanges\n-- \n1.7.9.5\n"},{"id":"203700","messageId":"CALkWK0mZrqQAg=dKGeFA_Lg9fnApBW84=KQ-XPDCLZV7ev_S=A@mail.gmail.com","threadId":"32172","inReplyTo":"1353649899-15641-1-git-send-email-leon.kukovec@gmail.com","subject":"Re: [PATCH] gitk tag delete/rename support","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2012-11-23T12:38:12Z","receivedAt":"2012-11-23T12:38:12Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Leon KUKOVEC wrote:\n> ---\n> [...]\n\nCommit message and signoff?\n\nRam\n"},{"id":"203711","messageId":"1353688894-2526-1-git-send-email-leon.kukovec@gmail.com","threadId":"32172","inReplyTo":"1353649899-15641-1-git-send-email-leon.kukovec@gmail.com","subject":"[PATCH] gitk tag delete/rename support","fromName":"Leon KUKOVEC","fromEmail":"leon.kukovec@gmail.com","sentAt":"2012-11-23T16:41:34Z","receivedAt":"2012-11-23T16:41:34Z","isPatch":true,"sender":{"key":"leon.kukovec@gmail.com","avatar":null},"body":"Right clicking on a tag pops up a menu, which allows\ntag to be renamed or deleted.\n\nSigned-off-by: Leon KUKOVEC <leon.kukovec@gmail.com>\n---\n gitk-git/gitk |  154 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n 1 file changed, 154 insertions(+)\n\ndiff --git a/gitk-git/gitk b/gitk-git/gitk\nindex d93bd99..38cc233 100755\n--- a/gitk-git/gitk\n+++ b/gitk-git/gitk\n@@ -2032,6 +2032,7 @@ proc makewindow {} {\n     global have_tk85 use_ttk NS\n     global git_version\n     global worddiff\n+    global tagctxmenu\n \n     # The \"mc\" arguments here are purely so that xgettext\n     # sees the following string as needing to be translated\n@@ -2581,6 +2582,13 @@ proc makewindow {} {\n \t{mc \"Run git gui blame on this line\" command {external_blame_diff}}\n     }\n     $diff_menu configure -tearoff 0\n+\n+    set tagctxmenu .tagctxmenu\n+    makemenu $tagctxmenu {\n+\t{mc \"Rename this tag\" command mvtag}\n+\t{mc \"Delete this tag\" command rmtag}\n+    }\n+    $tagctxmenu configure -tearoff 0\n }\n \n # Windows sends all mouse wheel events to the current focused window, not\n@@ -6400,6 +6408,7 @@ proc drawtags {id x xt y1} {\n \t\t   -font $font -tags [list tag.$id text]]\n \tif {$ntags >= 0} {\n \t    $canv bind $t <1> [list showtag $tag_quoted 1]\n+\t    $canv bind $t $ctxbut [list showtagmenu %X %Y $id $tag_quoted]\n \t} elseif {$nheads >= 0} {\n \t    $canv bind $t $ctxbut [list headmenu %X %Y $id $tag_quoted]\n \t}\n@@ -8931,6 +8940,113 @@ proc domktag {} {\n     return 1\n }\n \n+proc mvtag {} {\n+    global mvtagtop\n+    global tagmenuid tagmenutag tagctxmenu maintag NS\n+    global mvtagtag\n+\n+    set mvtagtag $tagmenutag\n+    set top .movetag\n+    set mvtagtop $top\n+    catch {destroy $top}\n+    ttk_toplevel $top\n+    make_transient $top .\n+\n+    ${NS}::label $top.msg -text [mc \"Enter a new tag name:\"]\n+    ${NS}::entry $top.tag -width 60 -textvariable mvtagtag\n+\n+    grid $top.msg -sticky w -row 0 -column 0\n+    grid $top.tag -sticky w -row 0 -column 1\n+\n+    ${NS}::frame $top.buts\n+    ${NS}::button $top.buts.gen -text [mc \"Rename\"] -command mvtaggo\n+    ${NS}::button $top.buts.can -text [mc \"Cancel\"] -command mvtagcan\n+    bind $top <Key-Return> mvtaggo\n+    bind $top <Key-Escape> mvtagcan\n+    grid $top.buts.gen $top.buts.can\n+    grid columnconfigure $top.buts 0 -weight 1 -uniform a\n+    grid columnconfigure $top.buts 1 -weight 1 -uniform a\n+    grid $top.buts - -pady 10 -sticky ew\n+}\n+\n+proc domvtag {} {\n+    global mvtagtop env tagids idtags tagmenutag tagmenuid mvtagtag\n+\n+    set tag $mvtagtag\n+    set id $tagmenuid\n+\n+    # add tag\n+    # XXX: reuse domktag including keeping comment from the original tag.\n+    if {[catch {\n+        exec git tag $tag $id\n+    } err]} {\n+        error_popup \"[mc \"Error renaming tag:\"] $err\" $mvtagtop\n+        return 0\n+    }\n+\n+    # delete old tag, content stored in $tagmenutag and $tagmenuid\n+    dormtag\n+\n+    set tagids($tag) $id\n+    lappend idtags($id) $tag\n+    redrawtags $id\n+    addedtag $id\n+    dispneartags 0\n+    run refill_reflist\n+    return 1\n+}\n+\n+proc rmtag {} {\n+    global rmtagtop\n+    global tagmenuid tagmenutag tagctxmenu maintag NS\n+\n+    set top .maketag\n+    set rmtagtop $top\n+    catch {destroy $top}\n+    ttk_toplevel $top\n+    make_transient $top .\n+    ${NS}::label $top.title -text [mc \"Delete tag\"]\n+    grid $top.title - -pady 10\n+\n+    ${NS}::label $top.msg -text [mc \"You are about to delete a tag\"]\n+    ${NS}::label $top.tagname -foreground Red -text [mc \"$tagmenutag\"]\n+    grid $top.msg -sticky w -row 0 -column 0\n+    grid $top.tagname -sticky w -row 0 -column 1\n+\n+    ${NS}::frame $top.buts\n+    ${NS}::button $top.buts.gen -text [mc \"Delete\"] -command rmtaggo\n+    ${NS}::button $top.buts.can -text [mc \"Cancel\"] -command rmtagcan\n+    bind $top <Key-Return> rmtaggo\n+    bind $top <Key-Escape> rmtagcan\n+    grid $top.buts.gen $top.buts.can\n+    grid columnconfigure $top.buts 0 -weight 1 -uniform a\n+    grid columnconfigure $top.buts 1 -weight 1 -uniform a\n+    grid $top.buts - -pady 10 -sticky ew\n+}\n+\n+proc dormtag {} {\n+    global rmtagtop env tagids idtags tagmenutag tagmenuid\n+\n+    set tag $tagmenutag\n+    set id $tagmenuid\n+\n+    if {[catch {\n+        exec git tag -d $tag\n+    } err]} {\n+        error_popup \"[mc \"Error deleting tag:\"] $err\" $rmtagtop\n+        return 0\n+    }\n+\n+    unset tagids($tag)\n+    set idx [lsearch $idtags($id) $tag]\n+    set idtags($id) [lreplace $idtags($id) $idx $idx]\n+\n+    redrawtags $id\n+    dispneartags 0\n+    run refill_reflist\n+    return 1\n+}\n+\n proc redrawtags {id} {\n     global canv linehtag idpos currentid curview cmitlisted markedid\n     global canvxmax iddrawn circleitem mainheadid circlecolors\n@@ -8974,6 +9090,30 @@ proc mktaggo {} {\n     mktagcan\n }\n \n+proc rmtagcan {} {\n+    global rmtagtop\n+\n+    catch {destroy $rmtagtop}\n+    unset rmtagtop\n+}\n+\n+proc rmtaggo {} {\n+    if {![dormtag]} return\n+    rmtagcan\n+}\n+\n+proc mvtagcan {} {\n+    global mvtagtop\n+\n+    catch {destroy $mvtagtop}\n+    unset mvtagtop\n+}\n+\n+proc mvtaggo {} {\n+    if {![domvtag]} return\n+    mvtagcan\n+}\n+\n proc writecommit {} {\n     global rowmenuid wrcomtop commitinfo wrcomcmd NS\n \n@@ -9288,6 +9428,20 @@ proc headmenu {x y id head} {\n     tk_popup $headctxmenu $x $y\n }\n \n+# context menu for a tag\n+proc showtagmenu {x y id tag} {\n+    global tagmenuid tagmenutag tagctxmenu maintag\n+\n+    stopfinding\n+    set tagmenuid $id\n+    set tagmenutag $tag\n+    set state normal\n+\n+    $tagctxmenu entryconfigure 0 -state normal\n+    $tagctxmenu entryconfigure 1 -state normal\n+    tk_popup $tagctxmenu $x $y\n+}\n+\n proc cobranch {} {\n     global headmenuid headmenuhead headids\n     global showlocalchanges\n-- \n1.7.9.5\n"},{"id":"203776","messageId":"7vzk26xkou.fsf@alter.siamese.dyndns.org","threadId":"32172","inReplyTo":"1353688894-2526-1-git-send-email-leon.kukovec@gmail.com","subject":"Re: [PATCH] gitk tag delete/rename support","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-11-25T06:26:09Z","receivedAt":"2012-11-25T06:26:09Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Leon KUKOVEC <leon.kukovec@gmail.com> writes:\n\n> Right clicking on a tag pops up a menu, which allows\n> tag to be renamed or deleted.\n>\n> Signed-off-by: Leon KUKOVEC <leon.kukovec@gmail.com>\n> ---\n\nThanks, but I prefer not to take patches to gitk-git/ directly;\ncould you prepare a patch against Paul's tree at\n\n\n    git://ozlabs.org/~paulus/gitk\n\nand send it in that direction (paulus@) instead?\n\n>  gitk-git/gitk |  154 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n>  1 file changed, 154 insertions(+)\n>\n> diff --git a/gitk-git/gitk b/gitk-git/gitk\n> index d93bd99..38cc233 100755\n> --- a/gitk-git/gitk\n> +++ b/gitk-git/gitk\n> @@ -2032,6 +2032,7 @@ proc makewindow {} {\n>      global have_tk85 use_ttk NS\n>      global git_version\n>      global worddiff\n> +    global tagctxmenu\n>  \n>      # The \"mc\" arguments here are purely so that xgettext\n>      # sees the following string as needing to be translated\n> @@ -2581,6 +2582,13 @@ proc makewindow {} {\n>  \t{mc \"Run git gui blame on this line\" command {external_blame_diff}}\n>      }\n>      $diff_menu configure -tearoff 0\n> +\n> +    set tagctxmenu .tagctxmenu\n> +    makemenu $tagctxmenu {\n> +\t{mc \"Rename this tag\" command mvtag}\n> +\t{mc \"Delete this tag\" command rmtag}\n> +    }\n> +    $tagctxmenu configure -tearoff 0\n>  }\n>  \n>  # Windows sends all mouse wheel events to the current focused window, not\n> @@ -6400,6 +6408,7 @@ proc drawtags {id x xt y1} {\n>  \t\t   -font $font -tags [list tag.$id text]]\n>  \tif {$ntags >= 0} {\n>  \t    $canv bind $t <1> [list showtag $tag_quoted 1]\n> +\t    $canv bind $t $ctxbut [list showtagmenu %X %Y $id $tag_quoted]\n>  \t} elseif {$nheads >= 0} {\n>  \t    $canv bind $t $ctxbut [list headmenu %X %Y $id $tag_quoted]\n>  \t}\n> @@ -8931,6 +8940,113 @@ proc domktag {} {\n>      return 1\n>  }\n>  \n> +proc mvtag {} {\n> +    global mvtagtop\n> +    global tagmenuid tagmenutag tagctxmenu maintag NS\n> +    global mvtagtag\n> +\n> +    set mvtagtag $tagmenutag\n> +    set top .movetag\n> +    set mvtagtop $top\n> +    catch {destroy $top}\n> +    ttk_toplevel $top\n> +    make_transient $top .\n> +\n> +    ${NS}::label $top.msg -text [mc \"Enter a new tag name:\"]\n> +    ${NS}::entry $top.tag -width 60 -textvariable mvtagtag\n> +\n> +    grid $top.msg -sticky w -row 0 -column 0\n> +    grid $top.tag -sticky w -row 0 -column 1\n> +\n> +    ${NS}::frame $top.buts\n> +    ${NS}::button $top.buts.gen -text [mc \"Rename\"] -command mvtaggo\n> +    ${NS}::button $top.buts.can -text [mc \"Cancel\"] -command mvtagcan\n> +    bind $top <Key-Return> mvtaggo\n> +    bind $top <Key-Escape> mvtagcan\n> +    grid $top.buts.gen $top.buts.can\n> +    grid columnconfigure $top.buts 0 -weight 1 -uniform a\n> +    grid columnconfigure $top.buts 1 -weight 1 -uniform a\n> +    grid $top.buts - -pady 10 -sticky ew\n> +}\n> +\n> +proc domvtag {} {\n> +    global mvtagtop env tagids idtags tagmenutag tagmenuid mvtagtag\n> +\n> +    set tag $mvtagtag\n> +    set id $tagmenuid\n> +\n> +    # add tag\n> +    # XXX: reuse domktag including keeping comment from the original tag.\n> +    if {[catch {\n> +        exec git tag $tag $id\n> +    } err]} {\n> +        error_popup \"[mc \"Error renaming tag:\"] $err\" $mvtagtop\n> +        return 0\n> +    }\n> +\n> +    # delete old tag, content stored in $tagmenutag and $tagmenuid\n> +    dormtag\n> +\n> +    set tagids($tag) $id\n> +    lappend idtags($id) $tag\n> +    redrawtags $id\n> +    addedtag $id\n> +    dispneartags 0\n> +    run refill_reflist\n> +    return 1\n> +}\n> +\n> +proc rmtag {} {\n> +    global rmtagtop\n> +    global tagmenuid tagmenutag tagctxmenu maintag NS\n> +\n> +    set top .maketag\n> +    set rmtagtop $top\n> +    catch {destroy $top}\n> +    ttk_toplevel $top\n> +    make_transient $top .\n> +    ${NS}::label $top.title -text [mc \"Delete tag\"]\n> +    grid $top.title - -pady 10\n> +\n> +    ${NS}::label $top.msg -text [mc \"You are about to delete a tag\"]\n> +    ${NS}::label $top.tagname -foreground Red -text [mc \"$tagmenutag\"]\n> +    grid $top.msg -sticky w -row 0 -column 0\n> +    grid $top.tagname -sticky w -row 0 -column 1\n> +\n> +    ${NS}::frame $top.buts\n> +    ${NS}::button $top.buts.gen -text [mc \"Delete\"] -command rmtaggo\n> +    ${NS}::button $top.buts.can -text [mc \"Cancel\"] -command rmtagcan\n> +    bind $top <Key-Return> rmtaggo\n> +    bind $top <Key-Escape> rmtagcan\n> +    grid $top.buts.gen $top.buts.can\n> +    grid columnconfigure $top.buts 0 -weight 1 -uniform a\n> +    grid columnconfigure $top.buts 1 -weight 1 -uniform a\n> +    grid $top.buts - -pady 10 -sticky ew\n> +}\n> +\n> +proc dormtag {} {\n> +    global rmtagtop env tagids idtags tagmenutag tagmenuid\n> +\n> +    set tag $tagmenutag\n> +    set id $tagmenuid\n> +\n> +    if {[catch {\n> +        exec git tag -d $tag\n> +    } err]} {\n> +        error_popup \"[mc \"Error deleting tag:\"] $err\" $rmtagtop\n> +        return 0\n> +    }\n> +\n> +    unset tagids($tag)\n> +    set idx [lsearch $idtags($id) $tag]\n> +    set idtags($id) [lreplace $idtags($id) $idx $idx]\n> +\n> +    redrawtags $id\n> +    dispneartags 0\n> +    run refill_reflist\n> +    return 1\n> +}\n> +\n>  proc redrawtags {id} {\n>      global canv linehtag idpos currentid curview cmitlisted markedid\n>      global canvxmax iddrawn circleitem mainheadid circlecolors\n> @@ -8974,6 +9090,30 @@ proc mktaggo {} {\n>      mktagcan\n>  }\n>  \n> +proc rmtagcan {} {\n> +    global rmtagtop\n> +\n> +    catch {destroy $rmtagtop}\n> +    unset rmtagtop\n> +}\n> +\n> +proc rmtaggo {} {\n> +    if {![dormtag]} return\n> +    rmtagcan\n> +}\n> +\n> +proc mvtagcan {} {\n> +    global mvtagtop\n> +\n> +    catch {destroy $mvtagtop}\n> +    unset mvtagtop\n> +}\n> +\n> +proc mvtaggo {} {\n> +    if {![domvtag]} return\n> +    mvtagcan\n> +}\n> +\n>  proc writecommit {} {\n>      global rowmenuid wrcomtop commitinfo wrcomcmd NS\n>  \n> @@ -9288,6 +9428,20 @@ proc headmenu {x y id head} {\n>      tk_popup $headctxmenu $x $y\n>  }\n>  \n> +# context menu for a tag\n> +proc showtagmenu {x y id tag} {\n> +    global tagmenuid tagmenutag tagctxmenu maintag\n> +\n> +    stopfinding\n> +    set tagmenuid $id\n> +    set tagmenutag $tag\n> +    set state normal\n> +\n> +    $tagctxmenu entryconfigure 0 -state normal\n> +    $tagctxmenu entryconfigure 1 -state normal\n> +    tk_popup $tagctxmenu $x $y\n> +}\n> +\n>  proc cobranch {} {\n>      global headmenuid headmenuhead headids\n>      global showlocalchanges\n"},{"id":"203814","messageId":"CAOrOd9woDs16as+t-EReQ8NtXfYm9mpd0XaFFs-XL=pg+JK1Lw@mail.gmail.com","threadId":"32172","inReplyTo":"7vzk26xkou.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] gitk tag delete/rename support","fromName":"Leon KUKOVEC","fromEmail":"leon.kukovec@gmail.com","sentAt":"2012-11-25T16:02:40Z","receivedAt":"2012-11-25T16:02:40Z","isPatch":true,"sender":{"key":"leon.kukovec@gmail.com","avatar":null},"body":"Hi,\n\nOn Sun, Nov 25, 2012 at 7:26 AM, Junio C Hamano <gitster@pobox.com> wrote:\n>\n> Thanks, but I prefer not to take patches to gitk-git/ directly;\n> could you prepare a patch against Paul's tree at\n>\n>\n>     git://ozlabs.org/~paulus/gitk\n>\n> and send it in that direction (paulus@) instead?\n\nNo problem. Will do that.\n\n--\nBest Regards,\n        Leon\n"},{"id":"203821","messageId":"1353870345-3054-1-git-send-email-leon.kukovec@gmail.com","threadId":"32172","inReplyTo":"CAOrOd9woDs16as+t-EReQ8NtXfYm9mpd0XaFFs-XL=pg+JK1Lw@mail.gmail.com","subject":"[PATCH] gitk tag delete/rename support","fromName":"Leon KUKOVEC","fromEmail":"leon.kukovec@gmail.com","sentAt":"2012-11-25T19:05:45Z","receivedAt":"2012-11-25T19:05:45Z","isPatch":true,"sender":{"key":"leon.kukovec@gmail.com","avatar":null},"body":"Right clicking on a tag pops up a menu, which allows\ntag to be renamed or deleted.\n\nSigned-off-by: Leon KUKOVEC <leon.kukovec@gmail.com>\n---\n gitk-git/gitk |  154 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n 1 file changed, 154 insertions(+)\n\ndiff --git a/gitk-git/gitk b/gitk-git/gitk\nindex d93bd99..38cc233 100755\n--- a/gitk-git/gitk\n+++ b/gitk-git/gitk\n@@ -2032,6 +2032,7 @@ proc makewindow {} {\n     global have_tk85 use_ttk NS\n     global git_version\n     global worddiff\n+    global tagctxmenu\n \n     # The \"mc\" arguments here are purely so that xgettext\n     # sees the following string as needing to be translated\n@@ -2581,6 +2582,13 @@ proc makewindow {} {\n \t{mc \"Run git gui blame on this line\" command {external_blame_diff}}\n     }\n     $diff_menu configure -tearoff 0\n+\n+    set tagctxmenu .tagctxmenu\n+    makemenu $tagctxmenu {\n+\t{mc \"Rename this tag\" command mvtag}\n+\t{mc \"Delete this tag\" command rmtag}\n+    }\n+    $tagctxmenu configure -tearoff 0\n }\n \n # Windows sends all mouse wheel events to the current focused window, not\n@@ -6400,6 +6408,7 @@ proc drawtags {id x xt y1} {\n \t\t   -font $font -tags [list tag.$id text]]\n \tif {$ntags >= 0} {\n \t    $canv bind $t <1> [list showtag $tag_quoted 1]\n+\t    $canv bind $t $ctxbut [list showtagmenu %X %Y $id $tag_quoted]\n \t} elseif {$nheads >= 0} {\n \t    $canv bind $t $ctxbut [list headmenu %X %Y $id $tag_quoted]\n \t}\n@@ -8931,6 +8940,113 @@ proc domktag {} {\n     return 1\n }\n \n+proc mvtag {} {\n+    global mvtagtop\n+    global tagmenuid tagmenutag tagctxmenu maintag NS\n+    global mvtagtag\n+\n+    set mvtagtag $tagmenutag\n+    set top .movetag\n+    set mvtagtop $top\n+    catch {destroy $top}\n+    ttk_toplevel $top\n+    make_transient $top .\n+\n+    ${NS}::label $top.msg -text [mc \"Enter a new tag name:\"]\n+    ${NS}::entry $top.tag -width 60 -textvariable mvtagtag\n+\n+    grid $top.msg -sticky w -row 0 -column 0\n+    grid $top.tag -sticky w -row 0 -column 1\n+\n+    ${NS}::frame $top.buts\n+    ${NS}::button $top.buts.gen -text [mc \"Rename\"] -command mvtaggo\n+    ${NS}::button $top.buts.can -text [mc \"Cancel\"] -command mvtagcan\n+    bind $top <Key-Return> mvtaggo\n+    bind $top <Key-Escape> mvtagcan\n+    grid $top.buts.gen $top.buts.can\n+    grid columnconfigure $top.buts 0 -weight 1 -uniform a\n+    grid columnconfigure $top.buts 1 -weight 1 -uniform a\n+    grid $top.buts - -pady 10 -sticky ew\n+}\n+\n+proc domvtag {} {\n+    global mvtagtop env tagids idtags tagmenutag tagmenuid mvtagtag\n+\n+    set tag $mvtagtag\n+    set id $tagmenuid\n+\n+    # add tag\n+    # XXX: reuse domktag including keeping comment from the original tag.\n+    if {[catch {\n+        exec git tag $tag $id\n+    } err]} {\n+        error_popup \"[mc \"Error renaming tag:\"] $err\" $mvtagtop\n+        return 0\n+    }\n+\n+    # delete old tag, content stored in $tagmenutag and $tagmenuid\n+    dormtag\n+\n+    set tagids($tag) $id\n+    lappend idtags($id) $tag\n+    redrawtags $id\n+    addedtag $id\n+    dispneartags 0\n+    run refill_reflist\n+    return 1\n+}\n+\n+proc rmtag {} {\n+    global rmtagtop\n+    global tagmenuid tagmenutag tagctxmenu maintag NS\n+\n+    set top .maketag\n+    set rmtagtop $top\n+    catch {destroy $top}\n+    ttk_toplevel $top\n+    make_transient $top .\n+    ${NS}::label $top.title -text [mc \"Delete tag\"]\n+    grid $top.title - -pady 10\n+\n+    ${NS}::label $top.msg -text [mc \"You are about to delete a tag\"]\n+    ${NS}::label $top.tagname -foreground Red -text [mc \"$tagmenutag\"]\n+    grid $top.msg -sticky w -row 0 -column 0\n+    grid $top.tagname -sticky w -row 0 -column 1\n+\n+    ${NS}::frame $top.buts\n+    ${NS}::button $top.buts.gen -text [mc \"Delete\"] -command rmtaggo\n+    ${NS}::button $top.buts.can -text [mc \"Cancel\"] -command rmtagcan\n+    bind $top <Key-Return> rmtaggo\n+    bind $top <Key-Escape> rmtagcan\n+    grid $top.buts.gen $top.buts.can\n+    grid columnconfigure $top.buts 0 -weight 1 -uniform a\n+    grid columnconfigure $top.buts 1 -weight 1 -uniform a\n+    grid $top.buts - -pady 10 -sticky ew\n+}\n+\n+proc dormtag {} {\n+    global rmtagtop env tagids idtags tagmenutag tagmenuid\n+\n+    set tag $tagmenutag\n+    set id $tagmenuid\n+\n+    if {[catch {\n+        exec git tag -d $tag\n+    } err]} {\n+        error_popup \"[mc \"Error deleting tag:\"] $err\" $rmtagtop\n+        return 0\n+    }\n+\n+    unset tagids($tag)\n+    set idx [lsearch $idtags($id) $tag]\n+    set idtags($id) [lreplace $idtags($id) $idx $idx]\n+\n+    redrawtags $id\n+    dispneartags 0\n+    run refill_reflist\n+    return 1\n+}\n+\n proc redrawtags {id} {\n     global canv linehtag idpos currentid curview cmitlisted markedid\n     global canvxmax iddrawn circleitem mainheadid circlecolors\n@@ -8974,6 +9090,30 @@ proc mktaggo {} {\n     mktagcan\n }\n \n+proc rmtagcan {} {\n+    global rmtagtop\n+\n+    catch {destroy $rmtagtop}\n+    unset rmtagtop\n+}\n+\n+proc rmtaggo {} {\n+    if {![dormtag]} return\n+    rmtagcan\n+}\n+\n+proc mvtagcan {} {\n+    global mvtagtop\n+\n+    catch {destroy $mvtagtop}\n+    unset mvtagtop\n+}\n+\n+proc mvtaggo {} {\n+    if {![domvtag]} return\n+    mvtagcan\n+}\n+\n proc writecommit {} {\n     global rowmenuid wrcomtop commitinfo wrcomcmd NS\n \n@@ -9288,6 +9428,20 @@ proc headmenu {x y id head} {\n     tk_popup $headctxmenu $x $y\n }\n \n+# context menu for a tag\n+proc showtagmenu {x y id tag} {\n+    global tagmenuid tagmenutag tagctxmenu maintag\n+\n+    stopfinding\n+    set tagmenuid $id\n+    set tagmenutag $tag\n+    set state normal\n+\n+    $tagctxmenu entryconfigure 0 -state normal\n+    $tagctxmenu entryconfigure 1 -state normal\n+    tk_popup $tagctxmenu $x $y\n+}\n+\n proc cobranch {} {\n     global headmenuid headmenuhead headids\n     global showlocalchanges\n-- \n1.7.9.5\n"},{"id":"205835","messageId":"20130102071153.GF20724@iris.ozlabs.ibm.com","threadId":"32172","inReplyTo":"1353870345-3054-1-git-send-email-leon.kukovec@gmail.com","subject":"Re: [PATCH] gitk tag delete/rename support","fromName":"Paul Mackerras","fromEmail":"paulus@samba.org","sentAt":"2013-01-02T07:11:53Z","receivedAt":"2013-01-02T07:11:53Z","isPatch":true,"sender":{"key":"paulus@samba.org","avatar":"https://avatars.githubusercontent.com/u/1606439?v=4"},"body":"On Sun, Nov 25, 2012 at 08:05:45PM +0100, Leon KUKOVEC wrote:\n\n> Right clicking on a tag pops up a menu, which allows\n> tag to be renamed or deleted.\n\nNice idea, but I am concerned that renaming a tag that refers to a tag\nobject will turn it into a lightweight tag, which would be surprising\nfor users.  I think that needs to be fixed before I apply the patch.\nAlso, when renaming a tag it would be good to check for the cases\nwhere the new name is the same as the old (in which case nothing needs\nto be done) and where the new name already exists.\n\nThanks,\nPaul.\n"}]}