lazygit icon indicating copy to clipboard operation
lazygit copied to clipboard

Autocomplete/suggest git commit message based on commit history

Open pyrooka opened this issue 5 years ago • 12 comments

Is your feature request related to a problem? Please describe. Sometimes we (at least me) just copy messages from previous commits. For example: "Bump version...", Update X to version Y.

Describe the solution you'd like Suggest a message based on the history when we are typing, like in k9s: Screenshot 2020-08-19 at 12 32 17 I am not thinking about some highly intelligent, super fancy AI powered autocomplete engine, just a simple regex which matches from the start.

pyrooka avatar Aug 19 '20 10:08 pyrooka

image

What do you think about something like this?

pyrooka avatar Aug 25 '20 12:08 pyrooka

I would love to see that feature implemented.

Also, it would be nice to have autocompletion of Conventional Commits like feat, fix, refactor etc. as well as scope for them (based on file/directory names of staged files for example).

ecosse3 avatar Apr 21 '22 21:04 ecosse3

using the https://github.com/lintingzhen/commitizen-go wizard would be awesome here. Use lazygit and commitizen in split terminal right now.

jnmcfly avatar Dec 22 '22 22:12 jnmcfly

https://github.com/Nutlope/aicommits

Would be cool if we could use this

nahtnam avatar Feb 14 '23 20:02 nahtnam

Came here to ask for aicommits support, was sure that no one asked before, but searched anyway :) I would love this support also, but in the meantime i found a workaround:

  • go to your repo, do aic hook install
  • open lazygit and commit via C -> this will open the git commit editor, which is defined to fire up aic

vtmocanu avatar Apr 05 '23 12:04 vtmocanu

Just a bug related to my workaound, if you don't issue the lazygit from the root repo path, i get:

2023/04/05 15:30:32 An error occurred! Please create an issue at: https://github.com/jesseduffield/lazygit/issues

*errors.errorString repository does not exist
/private/tmp/lazygit-20230201-69813-1wzwylz/lazygit-0.37.0/pkg/app/app.go:54 (0x10084acf4)
/private/tmp/lazygit-20230201-69813-1wzwylz/lazygit-0.37.0/pkg/app/entry_point.go:146 (0x10084c6d0)
/private/tmp/lazygit-20230201-69813-1wzwylz/lazygit-0.37.0/main.go:23 (0x10084e628)
/opt/homebrew/Cellar/go/1.19.5/libexec/src/runtime/proc.go:250 (0x10029bcec)
/opt/homebrew/Cellar/go/1.19.5/libexec/src/runtime/asm_arm64.s:1172 (0x1002ca344)

vtmocanu avatar Apr 05 '23 12:04 vtmocanu

Just a bug related to my workaound, if you don't issue the lazygit from the root repo path, i get:

2023/04/05 15:30:32 An error occurred! Please create an issue at: https://github.com/jesseduffield/lazygit/issues

*errors.errorString repository does not exist
/private/tmp/lazygit-20230201-69813-1wzwylz/lazygit-0.37.0/pkg/app/app.go:54 (0x10084acf4)
/private/tmp/lazygit-20230201-69813-1wzwylz/lazygit-0.37.0/pkg/app/entry_point.go:146 (0x10084c6d0)
/private/tmp/lazygit-20230201-69813-1wzwylz/lazygit-0.37.0/main.go:23 (0x10084e628)
/opt/homebrew/Cellar/go/1.19.5/libexec/src/runtime/proc.go:250 (0x10029bcec)
/opt/homebrew/Cellar/go/1.19.5/libexec/src/runtime/asm_arm64.s:1172 (0x1002ca344)

Has this been solved?

pidgeon777 avatar May 30 '23 07:05 pidgeon777

It would be great if it was possible to get an AI commit preview for the title and the same for the description, after the title is written and the description field entered.

moritztim avatar Sep 04 '23 14:09 moritztim

Would also like to see this work in a zsh fashion for commit and branch names. ie pressing tab or -> to autofill up to a certain point in the message based on previous commits/branches

noahbald avatar Sep 26 '23 00:09 noahbald

++ Would love to see this feature, we can start with something as basic as auto suggest title based on the path of the file being changed.

DhruvaG2000 avatar Oct 16 '23 12:10 DhruvaG2000

@WladyX did you do anything else to get the hooks workings within lazygit?

I installed it, setup my API key, installed the hook within my repo and can see it within .git/hooks but when I stage a file and press c it doesn't trigger it, I can manually trigger it from the cli but not within lazygit

edit: lazygit it opened from the repo root

ALameLlama avatar Jul 24 '24 05:07 ALameLlama

nothing else, but it must be capital c, C, not c

vtmocanu avatar Aug 01 '24 06:08 vtmocanu