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

3 messages from 2024-12-16 to 2024-12-20. Participants: Aleksander Korzyński, Jeff King.
Thread: https://gitlist.dev/t/62644

## Aleksander Korzyński, 2024-12-16 15:09

Subject: [Bug] --simplify-by-decoration prints undecorated commit
Message-ID: <CAEtHj8AXKrQfyAW9FSv6yC-8GF1AkPixMFjSye+B51pJ4fOtWA@mail.gmail.com>
URL: https://gitlist.dev/e/CAEtHj8AXKrQfyAW9FSv6yC-8GF1AkPixMFjSye%2BB51pJ4fOtWA%40mail.gmail.com

```
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, 2024-12-18 12:08

Subject: Re: [Bug] --simplify-by-decoration prints undecorated commit
Message-ID: <20241218120831.GA695807@coredump.intra.peff.net>
URL: https://gitlist.dev/e/20241218120831.GA695807%40coredump.intra.peff.net
In-Reply-To: <CAEtHj8AXKrQfyAW9FSv6yC-8GF1AkPixMFjSye+B51pJ4fOtWA@mail.gmail.com>

```
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, 2024-12-20 11:13

Subject: Re: [Bug] --simplify-by-decoration prints undecorated commit
Message-ID: <CAEtHj8DUaDm7Hr+Dzc+K=F1MONj8u=GmuB1ju5kMU-swPa6Whw@mail.gmail.com>
URL: https://gitlist.dev/e/CAEtHj8DUaDm7Hr%2BDzc%2BK%3DF1MONj8u%3DGmuB1ju5kMU-swPa6Whw%40mail.gmail.com
In-Reply-To: <20241218120831.GA695807@coredump.intra.peff.net>

```
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:
>
> 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

```
