I am aware of Git picking up the GIT_COMMITTER_DATE
environment variable, but for every amending commit, I have to manually prepend GIT_COMMITTER_DATE="$(git log -1 --pretty=tformat:%cD HEAD)"
to the command line. Is there a config option to make this behavior the default? Or can a wrapper script modify the behavior for git-commit
? (I am not interested in creating a custom subcommand for Git, like git amend
.)
Asked
Active
Viewed 33 times
0

iBug
- 35,554
- 7
- 89
- 134
-
1I'm curious what the use case is for this. In my experience having a different committer date rarely ever matters, but every once in a while the extra information contained in the new committer date is helpful. I've never once wished the extra information wasn't there though... – TTT Jul 31 '23 at 19:15
-
@TTT Just personal aesthetic preference. – iBug Jul 31 '23 at 19:26
-
Note if you can change the behavior of `git-commit`, unless you are inspecting the command line options to isolate "amend", then the committer date will also be faked for `cherry-pick` and `rebase`, and not just `amend`. Not sure if you want that or not? – TTT Jul 31 '23 at 19:46
-
1@TTT I need it to work for the `commit --amend` command-and-argument combination. Other commands may be affected or not - I don't care. – iBug Jul 31 '23 at 19:48