-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gitk: add right-click context menu for tags #866
base: master
Are you sure you want to change the base?
Conversation
/submit |
Submitted as [email protected] To fetch this version into
To fetch this version to local tag
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for implementing. I suggest these changes below to get a correct view refresh. Works for me so far:
--- gitk
+++ gitk
@@ -1894,14 +1894,6 @@
unset headids($name)
}
-proc movetag {id name} {
- global tagids idtags
-
- removetag $tagids($name) $name
- set tagids($name) $id
- lappend idtags($id) $name
-}
-
proc removetag {id name} {
global tagids idtags
@@ -9601,7 +9593,7 @@
set val(name) $tagmenutag
set val(id) $tagmenuid
- set val(command) [list mvtago $top $tagmenutag]
+ set val(command) [list mvtaggo $top $tagmenutag]
set ui(title) [mc "Rename tag %s" $tagmenutag]
set ui(accept) [mc "Rename"]
@@ -9695,8 +9687,8 @@
focus $top.name
}
-proc mvtago {top prevname} {
- global tagids idheads mainhead mainheadid
+proc mvtaggo {top prevname} {
+ global tagids idtags idheads mainhead mainheadid
set name [$top.name get]
set id [$top.sha1 get]
@@ -9712,6 +9704,8 @@
nowbusy renametag
update
if {[catch {
+ # NOTE: for an annotated tag, the new tag points to the old tag object
+ # where the old primary tag name is still recorded inside. Acceptable.
eval exec "git tag $name $prevname"
eval exec "git tag -d $prevname"
} err]} {
@@ -9722,6 +9716,9 @@
removetag $id $prevname
set tagids($name) $id
lappend idtags($id) $name
+ redrawtags $id
+ addedtag $id
+ dispneartags 0
run refill_reflist
}
@@ -10190,6 +10187,7 @@
return
}
removetag $id $tag
+ redrawtags $id
notbusy rmtag
run refill_reflist
}
Thanks for the patch! |
b246cdf
to
f3a5d7d
Compare
/submit |
Submitted as [email protected] To fetch this version into
To fetch this version to local tag
|
Noticed another issue: After tag remove, errors when clicking elsewhere. This requires some cache clearing (new proc removedtag). Also inserted a confirm dialog for tag remove. and dots in names for commands with dialog. Patch:
|
Thanks for pointing me out the error, I really hope that some of these small problems can be avoided. |
f3a5d7d
to
52ca9bc
Compare
/submit |
Submitted as [email protected] To fetch this version into
To fetch this version to local tag
|
@kxrob Hi, I don't know if my patch is good? For the time being, I didn't see any reply in the mailing list. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be necessary to get the the menu for up to maxtags (=3) tags including:
gitk-git/gitk
Outdated
@@ -6678,6 +6703,9 @@ proc drawtags {id x xt y1} { | |||
-font $font -tags [list tag.$id text]] | |||
if {$ntags >= 0} { | |||
$canv bind $t <1> $tagclick | |||
if {$ntags_copy < $maxtags} { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be necessary to get the the menu for up to maxtags
(=3) tags including:
--- gitk
+++ gitk
@@ -6728,7 +6728,7 @@
-font $font -tags [list tag.$id text]]
if {$ntags >= 0} {
$canv bind $t <1> $tagclick
- if {$ntags_copy < $maxtags} {
+ if {$ntags_copy <= $maxtags} {
$canv bind $t $ctxbut [list tagmenu %X %Y $id $tag_quoted]
}
} elseif {$nheads >= 0} {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this function is indeed applicable to <=3 tags, instead of <3 tags.
@kxrob, So The solution is :
|
52ca9bc
to
c8b0dfa
Compare
/submit |
Submitted as [email protected] To fetch this version into
To fetch this version to local tag
|
Here another bug fix :) , error after rename.
I think it is rather stable then. Maybe the commit msg could be condensed somewhat, perhaps like
, and also cc it to the main author @paulusmack . I can add a review-approved in github before next submit. |
c8b0dfa
to
19fd0ef
Compare
There is an issue in commit 19fd0ef: |
Adds a context menu for tag icons with commands similar to what exits for branches: "Rename this tag", "Remove this tag", "Copy tag name". Signed-off-by: ZheNing Hu <[email protected]>
19fd0ef
to
e7cdb01
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works here. (Co-edited and made original feature request.)
|
@adlternative I think thats not necessary - just small edits. Lets see when and if they find time and maybe have other requests. Seems, only few, mainly the main author, are involved in gitk / TCL. Maybe also write in the top post (for the letter), that its similar to what exists for branches. And that it is now likely consolidated. (The limit to 3 tags / out of bounds is obvious due to the preexisting logic.) |
Okay, thanks for your help. I will send this patch. |
/submit |
Submitted as [email protected] To fetch this version into
To fetch this version to local tag
|
This patch want to fix:
#855
We can provide for right-clicking the tag icon in gitk
Rename this tag", "Remove this tag", "Copy tag name" function.
For convenience, only the tags on the branch with the number of
tags <=3 are processed temporarily.
Thanks!
cc: Paul Mackerras [email protected]
cc: Anders Kaseorg [email protected]
cc: Junio C Hamano [email protected]