git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Git log --decorate show prefetch objects
@ 2024-04-04 10:16 Alexandre Badez
  2024-04-04 16:56 ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Alexandre Badez @ 2024-04-04 10:16 UTC (permalink / raw)
  To: git

# 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


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

* Re: Git log --decorate show prefetch objects
  2024-04-04 10:16 Git log --decorate show prefetch objects Alexandre Badez
@ 2024-04-04 16:56 ` Junio C Hamano
  2024-04-04 21:37   ` Alexandre Badez
  0 siblings, 1 reply; 3+ messages in thread
From: Junio C Hamano @ 2024-04-04 16:56 UTC (permalink / raw)
  To: Alexandre Badez; +Cc: git, Derrick Stolee

Alexandre Badez <alexandre@badez.eu> writes:

> # 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

I do not use the prefetch stuff, but unfortunately the person who
was most familiar with "maintenance" are no longer active on this
list, so let me take a crack.

I think your complaint is that "--all" really means "all", not just
"heads" and "tags" but also includes "prefetch", while the prefetch
hierarchy is not included in the "--decorate" sources.

What does

    $ git log --oneline --branches --tags --decorate --graph

show, and is it closer to what you expected (note: this is not a
direct suggestion of a workaround---trying to gauge what the
direction is to move forward)?

Thanks.

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

* Re: Git log --decorate show prefetch objects
  2024-04-04 16:56 ` Junio C Hamano
@ 2024-04-04 21:37   ` Alexandre Badez
  0 siblings, 0 replies; 3+ messages in thread
From: Alexandre Badez @ 2024-04-04 21:37 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Derrick Stolee

On 04/04/2024 18:56, Junio C Hamano wrote:

> Alexandre Badez <alexandre@badez.eu> writes:
>
>> # 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
> I do not use the prefetch stuff, but unfortunately the person who
> was most familiar with "maintenance" are no longer active on this
> list, so let me take a crack.
>
> I think your complaint is that "--all" really means "all", not just
> "heads" and "tags" but also includes "prefetch", while the prefetch
> hierarchy is not included in the "--decorate" sources.
>
> What does
>
>      $ git log --oneline --branches --tags --decorate --graph
>
> show, and is it closer to what you expected (note: this is not a
> direct suggestion of a workaround---trying to gauge what the
> direction is to move forward)?
>
> Thanks.


Indeed, I missed the --branches (and --remotes) options; they do a 
better job in my case.

Maybe --all have a "legacy behaviour" so it's on me to move to new and 
better options.

Thanks.



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

end of thread, other threads:[~2024-04-04 21:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-04 10:16 Git log --decorate show prefetch objects Alexandre Badez
2024-04-04 16:56 ` Junio C Hamano
2024-04-04 21:37   ` Alexandre Badez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).