# Git showing tags in logs when it shouldn't

2 messages from 2014-05-19 to 2014-05-19. Participants: Robert Dailey, Jeff King.
Thread: https://gitlist.dev/t/36698

## Robert Dailey, 2014-05-19 13:17

Subject: Git showing tags in logs when it shouldn't
Message-ID: <CAHd499Dx8aZVm0yr7bSo2JTsmJt0p_b2H64pmjCCZFQCVWfZKA@mail.gmail.com>
URL: https://gitlist.dev/e/CAHd499Dx8aZVm0yr7bSo2JTsmJt0p_b2H64pmjCCZFQCVWfZKA%40mail.gmail.com

```
I have run the following command:

log --graph --abbrev-commit --decorate --date=relative
--format=format:'%C(bold blue)%h%C(reset)%x09%C(bold
green)(%ar)%C(reset)%C(bold yellow)%d%C(reset) %C(dim
white)%an%C(reset) - %C(white)%s%C(reset)'

After running this, I am seeing tag labels in the log graph. I believe
these shouldn't be showing because the docs for --decorate state that
refs/tags/ should not show. I'm also obviously not specifying --tags

Is this a bug? If not, what changes do I need to make? I only want to
see branch labels, nothing else.

```

## Jeff King, 2014-05-19 14:53

Subject: Re: Git showing tags in logs when it shouldn't
Message-ID: <20140519145333.GB20289@sigill.intra.peff.net>
URL: https://gitlist.dev/e/20140519145333.GB20289%40sigill.intra.peff.net
In-Reply-To: <CAHd499Dx8aZVm0yr7bSo2JTsmJt0p_b2H64pmjCCZFQCVWfZKA@mail.gmail.com>

```
On Mon, May 19, 2014 at 08:17:07AM -0500, Robert Dailey wrote:

> I have run the following command:
> 
> log --graph --abbrev-commit --decorate --date=relative
> --format=format:'%C(bold blue)%h%C(reset)%x09%C(bold
> green)(%ar)%C(reset)%C(bold yellow)%d%C(reset) %C(dim
> white)%an%C(reset) - %C(white)%s%C(reset)'
> 
> After running this, I am seeing tag labels in the log graph. I believe
> these shouldn't be showing because the docs for --decorate state that
> refs/tags/ should not show. I'm also obviously not specifying --tags
> 
> Is this a bug? If not, what changes do I need to make? I only want to
> see branch labels, nothing else.

I assume the docs you are referring to are (from "git help log"):

  --no-decorate, --decorate[=short|full|no]
    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. If full is specified, the full
    ref name (including prefix) will be printed. The default option is
    short.

The intent of that is to say that if we are in "short" mode, then for
any ref names we show, we will show them without their "refs/heads",
"refs/tags", or "refs/remotes" prefixes. Not that we will omit those
refs entirely (if you omitted those three, you would generally have
nothing left).

So no, it is not a bug, the code is working as intended. Patches welcome
for rewriting the documentation to make this more clear (I thought it
was pretty clear, but I believe you are the second person in the last
few weeks to misread it in exactly the same way, so it is not just you).

I don't think there is currently a way to specify exactly what you want.
Off the top of my head, it would be something like a
"--decorate-refs=<pattern>" option, which lets you specify which refs
are interesting (right now, we always decorate _all_ refs). But that
does not yet exist, and somebody would have to volunteer to implement
it.

-Peff

```
