lazygit
lazygit copied to clipboard
Support for gitmoji
Is your feature request related to a problem? Please describe. Well, its a minor convenience right now, but feel that it would help a lot in standardizing commit messages. Would like to integrate gitmoji in the commit flow, based on a config flag.
Describe the solution you'd like Those who enable the feature can use the gitmoji cli within the commit window. Gitmoji-cli(https://github.com/carloscuesta/gitmoji-cli) already has a clear interactive flow. We can have a tab based form(like html) that can tab through gitmoji, scope, commit title, message
I understand this would be hard and time consuming to implement. Another way to do this is to use the git hooks feature of gitmoji. The hook is triggered on git commit. I believe this is something I myself can implement given some guidance.
Describe alternatives you've considered Currently, I am exiting lazygit and then committing in the shell before re-entering lazygit to push changes.
Additional context
How Gitmoji CLI looks
@edwinclement08 This sounds like a worthwhile feature. I don't think I'll be able to submit a PR for this anytime soon (others are welcome to though!) but you can access it from within lazygit via a customcommand which opens gitmoji in a subprocess. See the examples here: https://github.com/jesseduffield/lazygit/wiki/Custom-Commands-Compendium
Will check it out.
Hello any updates on this ? Would love to have this feature the least we can have is emoji displayed instead of just plain text
I'm a gitmoji user and in my case having the gitmoji hooks breaks the basic commit function. I enter my commit message and it just hangs and never completes.
the offending gitmoji hook is prepare-commit-msg
:
#!/bin/sh
# gitmoji as a commit hook
exec </dev/tty
gitmoji --hook $1 $2
It might be good to add general support for interactive prepare-commit-msg
hooks like this, but a simple gitmoji fix would be nice as well.
Work around for Mac Users:
I have Raycast installed, which has a plugin for gitmoji. I have a shortcut for opening the gitmoji plugin and can search and add the gitmoji into the commit message in Lazygit. You don't have to leave the keyboard to do this.
I managed to have something that I like with that, if that helps
customCommands:
- command: git commit -m '{{ .Form.emoji }} {{ .Form.message }}'
context: files
description: Commit changes using gitmojis
key: C
prompts:
- command: gitmoji -l
filter: ^(.*?) - (:.*?:) - (.*)$
key: emoji
labelFormat: '{{ .group_1 }} - {{ .group_3 }}'
title: 'Select a gitmoji:'
type: menuFromCommand
valueFormat: '{{ .group_2 }}'
- key: message
title: 'Enter a commit message:'
type: input
Hmmm, I don't know why (or if I am the only one with this issue) but somehow it selects the text instead of the emoji itself, is it normal?
I installed gitmoji-cli via npm (npm i -g gitmoji-cli
)
Hmmm, I don't know why (or if I am the only one with this issue) but somehow it selects the text instead of the emoji itself, is it normal?
I installed gitmoji-cli via npm (
npm i -g gitmoji-cli
)
yes that's normal, after on your repo you will see an emoji instead of the text, it's how gitmoji work behind the scene as well
Got it!! Appreciate it, I´ve never used gitmoji-cli actually, I've been pasting emojis manually ever since
If you want to do it like this it's still possible, you'll just have to change the {{ .group_2 }}
in {{ .group_1 }}
👍