-
-
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
Predefined commit messages #760
Comments
though I don't personally do this, there are people at my work who do and it's quite possible I'll have to start doing it as well so I'm very open to this :) I think the solution is for the user to specify on a per-repo basis a regex replace, so something like:
and if the pattern doesn't match the user can specify fallback patterns as well. As for where to put it, I think it's find to just put it in the config.yml file we already have. What are your thoughts? |
Yeah, that looks good. I totally forgot about regex placeholders :-) |
According to docs:
How do we specify regex for project name? Otherwise we need to repeat for every repo? Or does it look at full path of folder; in that case I could use path till root repos folder? But would prefer to use regex for project folder names so something like this would be cool.
Should I create a new issues if this isn't supported, otherwise can we please update config.md? |
@lordlycastle please raise a separate issue for this. If you're interested, the current code is in |
Is your feature request related to a problem? Please describe.
It would be good to have an option to set predefined commit messages per repository. For example, at work, we use Jira, and we prefix all the commits with ticket number, and also all branch names contains the ticket number, for example:
Sometime it happens that i mistype the ticket number in the commit. It can be fixed of course, but why not fix the cause if possible :)
Describe the solution you'd like
I assume this could be part of the global configuration, or maybe to introduce project local configuration (.lazygitrc maybe?) If there's better idea, let me know.
For example, configuration could have something like a defined parser that would know how to extract
AB-123
and set it as default value for commit message when opened. This is a bit tricky because parsing needs to be done using some language.Describe alternatives you've considered
Since i'm a vim user, I set up an VimEnter autocommand that checks if i'm editing a commit message, and then parse the value from the branch and append it. It works fairly well, but i mostly use lazygit commit messages.
Here's link to vim code if you are interested: https://github.com/kristijanhusak/neovim-config/blob/master/nvim/partials/filetype/gitcommit.vim
This is maybe too big of a hassle for such a small feature, but i'm open for suggestions.
The text was updated successfully, but these errors were encountered: