Skip to content
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

Add scope completion #8

Closed
usrme opened this issue May 3, 2023 · 0 comments
Closed

Add scope completion #8

usrme opened this issue May 3, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@usrme
Copy link
Owner

usrme commented May 3, 2023

This would be nothing more than the ability to Tab-complete the scope value based on the staged changes. For example given the following changes:

$ git status
On branch main
Your branch is up to date with 'origin/main'.

Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
        deleted:    configs/files/nvchad/chadrc.lua
        modified:   configs/files/nvchad/custom/chadrc.lua
        deleted:    configs/files/nvchad/init.lua
        deleted:    configs/files/nvchad/plugins.lua

I would now be able to cycle through the unique path segments that have changed when presented with the scope option:

$ cometary
                                                                                     
  What are you committing? refactor: Changes that neither fix a bug nor add a feature
  What is the scope? (Enter to skip / Esc to cancel) [12/69]:                        
  > ...

For the above set of changes I'd choose configs/files/nvchad as the scope as that represents, to me, the most logical parent to group the changes by meaningfully, so I would just be able to get that filled with just by pressing Tab three times. Once for configs, once for configs/files, and once for configs/files/nvchad.

This also has the tangential benefit of always being able to validate what were the changed files as I sometimes forget to run git status.

@usrme usrme added the enhancement New feature or request label May 3, 2023
@usrme usrme self-assigned this May 3, 2023
@usrme usrme changed the title Add scope prediction Add scope completion May 4, 2023
@usrme usrme closed this as completed May 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant