public inbox for git@vger.kernel.org
 help / color / mirror / Atom feed
* --reset-author does not reset author date when used in post-commit hook
@ 2025-03-31 20:19 Devste Devste
  2025-04-01  0:43 ` brian m. carlson
  0 siblings, 1 reply; 5+ messages in thread
From: Devste Devste @ 2025-03-31 20:19 UTC (permalink / raw)
  To: git

device time zone is not UTC0

post-commit hook:
if [[ -n "${SKIP_POST_COMMIT+x}" ]] && [[ "$SKIP_POST_COMMIT" -eq 1 ]]
then
exit
fi

TZ=UTC0 SKIP_POST_COMMIT=1 git commit --amend --reset-author --no-edit
--no-verify --no-post-rewrite --allow-empty --quiet

---

Run:
git commit -m "foo"
git show -s --format="Commit: %h%nAuthor: %an%nAuthor Date:
%ad%nCommitter: %cn%nCommitter Date: %cd%nMessage: %s%n" HEAD

Expected that both Author Date: and Committer Date: show +0000 as
timezone. Only committer date shows +0000, while author date shows
time zone of device.

When manually running the post-commit code (TZ=UTC0 SKIP_POST_COMMIT=1
...) it correctly resets the author date to +0000 too

When manually setting the date using --date="$(date +%s) +0000"
instead of  --reset-author it also works correctly in post-commit
hook.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-04-02 10:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-31 20:19 --reset-author does not reset author date when used in post-commit hook Devste Devste
2025-04-01  0:43 ` brian m. carlson
2025-04-01  3:44   ` Devste Devste
2025-04-01 22:58     ` brian m. carlson
2025-04-02 10:06       ` Devste Devste

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox