How do you suppress the --show-name (filename) option when git blame?

As Matt McHenry says, git annotate doesn't show the filenames.

The trick is that git blame takes a -c flag that forces the output to conform to the annotate sub-command, which results in no filenames.


git annotate does not include this information in its output. (It silently ignores the --show-name option if you try to activate it.)


This option was introduced in commit eb93b724 (git 1.4.4, Oct. 2006)

The new option makes the command's native output format show the filename even when there were no renames in its history, to make it simpler for Porcelains to parse its output.

That means:

  • not using this option is the way to have it "off"
  • when there is rename in history, the filename is always shown.

As mentioned in Edouard Poor's answer, you can use git blame -c, which forces the same output mode as git-annotate.

Tags:

Git