There is definitely something fishy going on.
Here is a command to have git log display the timestamps (author date and committer date) of each commit translated in UTC :
log_with_dates () {
# - set env timezone to UTC
# - use --graph to have a clearer view of how commits relate to each other
# - translate timestamps in local timezone (the '-local' in 'format-local')
# and format them in ISO format
# - use a single line format:
# <hash> <decorations> (<author_date> <committer_date>) <first_message_line>
TZ=UTC git log --graph \
--date=format-local:"%FT%TZ" \
--format="%h%d (%ad %cd) %s" "$@"
}
Using the git repository https://github.com/git/git as a reference :
on a complete clone, here is what I see for log_with_dates --since="2022-08-29T00:00:00Z" origin/master (17 commits) :
# d42b38d is origin/master on 2022-08-31
$ log_with_dates --since="2022-08-29T00:00:00Z" d42b38d
* d42b38dfb5 (HEAD -> master, origin/master, origin/main, origin/HEAD) (2022-08-30T17:27:16Z 2022-08-30T17:27:16Z) Sync with Git 2.37.3
|\
| * ac8035a2af (tag: v2.37.3, origin/maint) (2022-08-30T17:22:10Z 2022-08-30T17:22:10Z) Git 2.37.3
* 6c8e4ee870 (2022-08-29T16:39:42Z 2022-08-29T21:55:15Z) The sixteenth batch
* 3658170b92 (2022-08-29T21:55:15Z 2022-08-29T21:55:15Z) Merge branch 'es/fix-chained-tests'
* 0d2cf16680 (2022-08-29T21:55:15Z 2022-08-29T21:55:15Z) Merge branch 'ds/github-actions-use-newer-ubuntu'
* f0deb3f2b5 (2022-08-29T21:55:15Z 2022-08-29T21:55:15Z) Merge branch 'ad/preload-plug-memleak'
* edc4f6d280 (2022-08-29T21:55:14Z 2022-08-29T21:55:14Z) Merge branch 'sg/xcalloc-cocci-fix'
* 56ba6245a4 (2022-08-29T21:55:14Z 2022-08-29T21:55:14Z) Merge branch 'en/ort-unused-code-removal'
* 10ccb50b16 (2022-08-29T21:55:13Z 2022-08-29T21:55:13Z) Merge branch 'tl/trace2-config-scope'
* 25402204fe (2022-08-29T21:55:13Z 2022-08-29T21:55:13Z) Merge branch 'vd/fix-perf-tests'
* b014a4416a (2022-08-29T21:55:13Z 2022-08-29T21:55:13Z) Merge branch 'mg/sequencer-untranslate-reflog'
* a0ab573bb1 (2022-08-29T21:55:12Z 2022-08-29T21:55:12Z) Merge branch 'jk/unused-fixes'
* a572a5d4c1 (2022-08-29T21:55:12Z 2022-08-29T21:55:12Z) Merge branch 'jd/prompt-show-conflict'
* bc820cf9e6 (2022-08-29T21:55:12Z 2022-08-29T21:55:12Z) Merge branch 'vd/scalar-enables-fsmonitor'
* 0b08ba7eb6 (2022-08-29T21:55:11Z 2022-08-29T21:55:11Z) Merge branch 'en/ancestry-path-in-a-range'
* 64cb4c34d1 (2022-08-29T21:55:11Z 2022-08-29T21:55:11Z) Merge branch 'mt/rot13-in-c'
* c068a3b8ee (2022-08-29T21:55:10Z 2022-08-29T21:55:11Z) Merge branch 'ds/decorate-filter-tweak'
Here is what I get when I start an empty repository and run
git fetch --shallow-since "2022-08-29T00:00:00Z" origin master (4 commits) :
$ log_with_dates origin/master
* d42b38d (HEAD, origin/master) (2022-08-30T17:27:16Z 2022-08-30T17:27:16Z) Sync with Git 2.37.3
|\
| * ac8035a (grafted) (2022-08-30T17:22:10Z 2022-08-30T17:22:10Z) Git 2.37.3
* 6c8e4ee (2022-08-29T16:39:42Z 2022-08-29T21:55:15Z) The sixteenth batch
* 3658170 (grafted) (2022-08-29T21:55:15Z 2022-08-29T21:55:15Z) Merge branch 'es/fix-chained-tests'
Deepening the shallow-since also yields an incomplete view.
I haven't debugged whether this comes from the list of commits returned by github's server or by some processing done on my side of git.
I'm running git version 2.35.0 on Ubuntu.
test script to reproduce locally :
#!/bin/bash
mkdir -p test_shallow_since
cd test_shallow_since
git init
git remote add origin git@github.com:git/git
# artificially set the "active commit" to that commit (was origin/master on 2022-08-31)
echo "d42b38dfb5edf1a7fddd9542d722f91038407819" > .git/HEAD
log_with_dates () {
TZ=UTC git log --graph \
--date=format-local:"%FT%TZ" \
--format="%h %d (%ad %cd) %s" \
"$@"
}
# test_since expects a date as argument, and will run :
# git fetch --shallow-since=<date> origin master
# git log ... --since=<date> d42b38d
test_since () {
local date=$1
echo "----- running: git fetch --shallow-since=\"$date\" origin master"
git fetch --shallow-since="$date" origin master
echo "----- list of commits --since=\"$date\" :"
log_with_dates --since="$date" d42b38d
}
test_since "2022-08-29T00:00:00Z"
test_since "2022-08-25T00:00:00Z"