-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Allow creation of annotated tags #1469
Allow creation of annotated tags #1469
Conversation
@jesseduffield This PR still has some rough edges but let me know what you think of the general approach. Looks like most of tests related to tags broke since we would now have a menu before the creation so if we're going in this direction, I'll make sure to fix them :) |
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.
nice work! Couple small things
ce77fcb
to
208ed7b
Compare
Took the opportunity to give some updates to the docs on Integration Tests as the commands there were not working as expected. Not sure if what I did to fix the tests is the right thing but here's what I've done:
Although these tests are slow by their own nature, I've really liked the general approach! |
Also, not sure why the linting is failing on me 😅 |
208ed7b
to
c40093d
Compare
Linting problems were caused by Go 1.17, fixed at #1479. |
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.
Nice work, left a couple comments
pkg/gui/commits_panel.go
Outdated
func (gui *Gui) afterTagCreate(tagName string) error { | ||
return gui.refreshSidePanels(refreshOptions{mode: ASYNC, scope: []RefreshableView{COMMITS, TAGS}, then: func() { | ||
// find the index of the tag and set that as the currently selected line | ||
for i, tag := range gui.State.Tags { |
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.
now that we sort tags by date created, descending, we can just set the cursor to the top. We don't even need to do that in a then
callback: we can do it immediately
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.
Sure!
return gui.prompt(promptOpts{ | ||
title: gui.Tr.TagNameTitle, | ||
handleConfirm: func(tagName string) error { | ||
return gui.prompt(promptOpts{ |
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.
I wonder here whether a single-line editor is going to suffice. I assume that people typically use annotated tags for the sake of writing release notes for a release, and that will require more than one line. At any rate I'm happy to release this and see if anybody wants multi-line just so that this code doesn't get stale
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.
Good point. I agree, we can definitely extend this later on.
The |
The instructions provided were not working as expected.
We can do this since they are already sorted by date created.
6ff7ab3
to
a0614fb
Compare
Fixed the |
Just tested and it works fine. Nice work! |
What
Allow the creation of annotated tags.
This implementation only supports adding a message to the tag but it could be extended in the future.
Why
This was requested in #1381 as currently we only support creating the so called lightweight tags