threads / bug / 62644

[Bug] --simplify-by-decoration prints undecorated commit

Subject: [Bug] --simplify-by-decoration prints undecorated commit

## tl;dr

3 messages between Dec 16, 2024 and Dec 20, 2024.

replies: 2people: 2as markdown or json

Aleksander Korzyński· Dec 16, 2024, 15:09 UTC · lore
Hello,

In the following scenario, --simplify-by-decoration prints an undecorated commit, which seems to be a bug.

> What did you do before the bug happened? (Steps to reproduce your issue)

# Clone this repo $ git clone https://github.com/bitnami/charts.git

# Test --simplify-by-decoration with -1, which should display the first decorated commit $ git log -1 --simplify-by-decoration --oneline f137d2178d f137d2178d (HEAD -> main, tag: gitea/3.1.2, origin/main, origin/HEAD) [bitnami/gitea] Release 3.1.2 (#31031) # The above output makes sense: the commit is decorated.

# Now, let's try --simplify-by-decoration on another commit $ git log -1 --simplify-by-decoration --oneline 1e3ef455cc 025a87d9db Merge branch 'master' into master # The above output seems incorrect, because the commit isn't decorated

# Let's confirm if the above commit is decorated $ git show-ref --tags --heads | grep 025a87d9db $ # No output, so the commit isn't decorated. That seems to confirm the bug.

> What did you expect to happen? (Expected behavior)
I expected --simplify-by-decoration to display decorated commits.
> What happened instead? (Actual behavior)
Git printed commit 025a87d9db, which isn't decorated.
> What's different between what you expected and what actually happened?

Commit 025a87d9db isn't decorated, but the --simplify-by-decoration command prints it.

> Anything else you want to add:
No

[System Info] git version: git version 2.47.0 cpu: x86_64 no commit associated with this build sizeof-long: 8 sizeof-size_t: 8 shell-path: /bin/sh feature: fsmonitor--daemon libcurl: 8.4.0 zlib: 1.2.12 uname: Darwin 23.6.0 Darwin Kernel Version 23.6.0: Mon Jul 29 21:13:00 PDT 2024; root:xnu-10063.141.2~1/RELEASE_X86_64 x86_64 compiler info: clang: 15.0.0 (clang-1500.3.9.4) libc info: no libc information available $SHELL (typically, interactive shell): /usr/local/bin/bash

[Enabled Hooks]

-- Best regards, Aleksander Korzynski

Jeff King· Dec 18, 2024, 12:08 UTC · re: Aleksander Korzyński · lore

Re: [Bug] --simplify-by-decoration prints undecorated commit

On Mon, Dec 16, 2024 at 04:09:07PM +0100, Aleksander Korzyński wrote:
> # Now, let's try --simplify-by-decoration on another commit
> $ git log -1 --simplify-by-decoration --oneline 1e3ef455cc
> 025a87d9db Merge branch 'master' into master
> # The above output seems incorrect, because the commit isn't decorated
Yes, but it's a merge commit. From "git help log":
  Note that extra commits can be shown to give a meaningful history.
Try:
  git log --simplify-by-decoration --oneline --graph 1e3ef455cc

and you'll see that there are commits along both parent branches, and thus we show the merge.

There are some other options listed after that for changing which commits are shown ("The following options affect the way the simplification is performed"). But I don't think there is one that will show only the decorated commits (however, I could be wrong; I've only ever used these options to show _more_ commits, not fewer).

-Peff
Aleksander Korzyński· Dec 20, 2024, 11:13 UTC · re: Jeff King · lore

Re: [Bug] --simplify-by-decoration prints undecorated commit

Hello Peff,
Thanks for the response.

-- Best regards, Aleksander Korzyński

On Wed, 18 Dec 2024 at 13:08, Jeff King <peff@peff.net> wrote:
Show 26 quoted lines
>
> On Mon, Dec 16, 2024 at 04:09:07PM +0100, Aleksander Korzyński wrote:
>
> > # Now, let's try --simplify-by-decoration on another commit
> > $ git log -1 --simplify-by-decoration --oneline 1e3ef455cc
> > 025a87d9db Merge branch 'master' into master
> > # The above output seems incorrect, because the commit isn't decorated
>
> Yes, but it's a merge commit. From "git help log":
>
>   Note that extra commits can be shown to give a meaningful history.
>
> Try:
>
>   git log --simplify-by-decoration --oneline --graph 1e3ef455cc
>
> and you'll see that there are commits along both parent branches, and
> thus we show the merge.
>
> There are some other options listed after that for changing which
> commits are shown ("The following options affect the way the
> simplification is performed"). But I don't think there is one that will
> show only the decorated commits (however, I could be wrong; I've only
> ever used these options to show _more_ commits, not fewer).
>
> -Peff

← back to recent threads