-
Notifications
You must be signed in to change notification settings - Fork 502
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 option to show git diff before commit #4235
Comments
Thanks for your work. # ~/.config/chezmoi/chezmoi.toml.tmpl
[hooks.git-auto-commit.pre]
command = "git"
args = ["diff", "--cached", "--color=always"]
directory = {{.chezmoi.workingTree}}
[git]
autoCommit=true
autoPush=true chezmoi/internal/cmd/config.go Line 2560 in 500c677
|
You can use the |
Thanks for the reply again. I missed the Now, it's asking for a commit message before running the chezmoi/internal/cmd/config.go Lines 1582 to 1593 in 3fdaa59
|
I agree with this change, but this is better done by doing the following (well, in your
|
Thank you @halostatue . |
I thought I had not posted this, because I realized that it won't work because this is auto-commit (something I don't use). |
Never mind, I learned git usage tips |
Is your feature request related to a problem? Please describe.
I use
git.autoPush
to avoid forgetting to push configuration changes.I want to know what changes were made before writing the commit message.
Describe the solution you'd like
add new option
git.showDiff
(or else) to showgit diff --cached
before commitDescribe alternatives you've considered
chezmoi diff
shows changes in the opposite direction.chezmoi cd
requires temporarily disablinggit.autoCommit
andgit.autoPush
.commitMessageTemplate = "{{output \"git\" \"diff\" \"--color=always\" \"--cached\" | promptString }}"
git no option --cached
chezmoi: template: git.commitMessageTemplate:1:2: executing "git.commitMessageTemplate" at <output "git" "diff" "--color=always" "--cached">: error calling output: 'D:\\scoop\\local\\shims\\git.exe' diff --color=always --cached: exit status 129
Additional context
The text was updated successfully, but these errors were encountered: