Git log --decorate show prefetch objects
- From
- Alexandre Badez <alexandre@badez.eu>
- Date
- Apr 4, 2024, 10:16 UTC
- Message-ID
- <5a16d4e3-6fa4-45f3-ae79-576f3fa80d44@badez.eu>
# What did you do before the bug happened? (Steps to reproduce your issue)
<on a git repository not fetch from a "long" time so you have missing branches and/or objects>
git maintenance run --task=prefetch
git log --oneline --decorate --all --graph
NOTE: here: - xxxxxxx commits are local commits, - yyyyyyy commits are remote commits fetch previously, - zzzzzzz commits are remote commits prefetch.
* xxxxxxx (HEAD -> current-dev, origin/master, origin/HEAD) feat * xxxxxxx feat | * yyyyyyy (origin/feature) feat |/ * xxxxxxx feat | * yyyyyyy (origin/a-fix) fix |/ * xxxxxxx fix | * zzzzzzz feat | * zzzzzzz feat | * zzzzzzz feat |/ * xxxxxxx feat | * zzzzzzz feat |/ * xxxxxxx fix
According to the git-log documentation (cf: https://git-scm.com/docs/git-log#Documentation/git-log.txt---all ):
--all Pretend as if all the refs in refs/, along with HEAD, are listed on the command line as <commit>.
But the --decorate (cf: https://git-scm.com/docs/git-log#Documentation/git-log.txt---decorateshortfullautono ):
--decorate Print out the ref names of any commits that are shown. If short is specified, the ref name prefixes refs/heads/, refs/tags/ and refs/remotes/ will not be printed. [...] The option --decorate is short-hand for --decorate=short.
Documentation of maintenant prefetch (cf: https://git-scm.com/docs/git-maintenance#Documentation/git-maintenance.txt-prefetch ):
The prefetch task updates the object directory with the latest objects from all registered remotes. For each remote, a git fetch command is run. The configured refspec is modified to place all requested refs within refs/prefetch/. Also, tags are not updated.
# What did you expect to happen? (Expected behavior)
I would have prefer this output (prefetch not shown):
* xxxxxxx (HEAD -> current-dev, origin/master, origin/HEAD) feat * xxxxxxx feat | * yyyyyyy (origin/feature) feat |/ * xxxxxxx feat | * yyyyyyy (origin/a-fix) fix |/ * xxxxxxx fix * xxxxxxx feat * xxxxxxx fix
Or this output (prefetch properly decorated):
* xxxxxxx (HEAD -> current-dev, origin/master, origin/HEAD) feat * xxxxxxx feat | * yyyyyyy (origin/feature) feat |/ * xxxxxxx feat | * yyyyyyy (origin/a-fix) fix |/ * xxxxxxx fix | * zzzzzzz (refs/prefetch/remotes/origin/anotherfeat) feat | * zzzzzzz feat | * zzzzzzz feat |/ * xxxxxxx feat | * zzzzzzz (refs/prefetch/remotes/origin/anotherotherfeat) feat |/ * xxxxxxx fix
# What happened instead? (Actual behavior)
Prefetch object are return and not properly decorated.
# What's different between what you expected and what actually happened?
I would have preferd prefetched objects not displayed
# Information
[System Info] git version: git version 2.44.0 cpu: x86_64 no commit associated with this build sizeof-long: 8 sizeof-size_t: 8 shell-path: /bin/bash bash version: 5.2.26 uname: Linux 6.8.1 #1-NixOS SMP PREEMPT_DYNAMIC Fri Mar 15 18:19:29 UTC 2024 x86_64 compiler info: gnuc: 13.2 libc info: glibc: 2.39 $SHELL (typically, interactive shell): /bin/fish