-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Description
Rethink tag editor
I'm think there's room for improvement on the (just released) tagging workflow #1381
The view
The "tag editor" could have two pannel, for tag name and message, the second optional:
(similar to how the ": - execute custom command" is shown)
┌─ tag name ───────────────────────────────────────────────────┐
│ some-tag │
└──────────────────────────────────────────────────────────────┘
┌─ message (optional) ─────────────────────────────────────────┐
│ ... │
│ │
│ │
│ │
│ │
└──────────────────────────────────────────────────────────────┘
How it would behave
- pressing
Ton pannel (commit or branch as on support for creating tags on branches #2421), don't need the mid-step menu for selecting lightweight or annotated- typping on tag name box and pressing ⏎, creates a lightweight
- pressing tab on "tag name" box, move cursor to "message" box. Tag with message becomes annotated
- message box could handle multi-line message.
- For this ⏎ add lines, and ctrl+⏎ should be used to "submit"
- Or could have a "submit" button bellow. So you ⥂ from message, and ⏎ on button (not optimal)
Type evaluation flow
I'm not familiar with Go, but here's how i thinks the fields state translate to a "codable steps" on submitting:
Has message?
│ ╭────────────────────────────────────╮
├─ No ──┤ "git tag {{tag_name}} {{branch}}" │
│ ╰────────────────────────────────────╯
│
╰─ Yes ─╮
Is message single line?
│ ╭──────────────────────────────────────────────────────╮
├─ Yes ────┤ "git tag -a {{tag_name}} -m {{message}} {{branch}}" │
│ ╰──────────────────────────────────────────────────────╯
╰─ No ──╮
│ ╭───────────────────────────────────╮
╰──┤ for line in {{message}} : │
│ final_msg += "-m {{line}} " │
│ end │
╰───────────────────────────────────╯
↓ then
╭─────────────────────────────────────────────────────╮
│ `git tag -a {{tag_name}} {{final_msg}} {{branch}}` │
╰─────────────────────────────────────────────────────╯
Alternatives
For the case of those who prefer to open their editor to write (probably highly complex) multi-line tag messages, a cumbersome way that comes to my mind is, if focus on message box, and ctrl+⏎ without writing nothing, open the editor for message (aka: runs "git tag -a {{tag_name}} {{branch}}")
That would make the flow drawn above a bit more complex, and doesn't worth represent here
Wanna hear what you guys think.
offtopic
That's unrelated to editor itself, but i personally thing that tags should get the date of the commit pointing to, what can be achieved setting a VAR_ENV on run command, like so:
GIT_COMMITTER_DATE="$(git show $3 --format=%aD | head -1)"Whats do you guys thing about setting it by default on tagging over lazygit?
If it is not much of a thing for everybody, how am i suppose to enable it for my self only?