git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Incorrect pipe for git log graph when using --name-status option

From
hIpPy <hippy2981@gmail.com>
Date
Feb 13, 2017, 02:49 UTC
Message-ID
<CAM_JFCwYAKCWrHqCtcwid27V1HvhuSmp4QpbNpgyMzrzWUNYog@mail.gmail.com>

The `git log` command with `graph` and pretty format works correctly as expected.

$ git log --graph --pretty=format:'%h' -2
* 714a14e
* 87dce5f

However, with `--name-status` option added, there is a pipe incorrectly placed after the commit hash (example below).

$ git log --graph --pretty=format:'%h' -2 --name-status
* 714a14e|
| M README.md
| A rm.Extensions/BitSet.cs
| M rm.Extensions/Properties/AssemblyInfo.cs
| M rm.Extensions/rm.Extensions.csproj
| A rm.ExtensionsTest/BitSetTest.cs
| M rm.ExtensionsTest/rm.ExtensionsTest.csproj
* 87dce5f|
| M rm.Extensions/GraphExtension.cs
| M rm.Extensions/Wrapped.cs
| M rm.Extensions/WrappedExtension.cs
| M rm.Extensions/rm.Extensions.csproj

IMHO, I think this is a bug. I think the correct output should be below.

$ git log --graph --pretty=format:'%h' -2 --name-status
* 714a14e
| M README.md
| A rm.Extensions/BitSet.cs
| M rm.Extensions/Properties/AssemblyInfo.cs
| M rm.Extensions/rm.Extensions.csproj
| A rm.ExtensionsTest/BitSetTest.cs
| M rm.ExtensionsTest/rm.ExtensionsTest.csproj
|
* 87dce5f
| M rm.Extensions/GraphExtension.cs
| M rm.Extensions/Wrapped.cs
| M rm.Extensions/WrappedExtension.cs
| M rm.Extensions/rm.Extensions.csproj
I'm using this:

git version 2.11.0.windows.1 GNU bash, version 4.3.46(2)-release (x86_64-pc-msys) Windows 8.1 64-bit

Thanks, RM

Next: Junio C Hamano
Message 1 of 8 in “Incorrect pipe for git log graph when using --name-status option”
  1. hIpPyFeb 13, 2017
  2. Junio C HamanoFeb 13, 2017
  3. hIpPyFeb 13, 2017
  4. Jeff KingFeb 13, 2017
  5. Junio C HamanoFeb 13, 2017
  6. Jeff KingFeb 13, 2017
  7. hIpPyFeb 13, 2017
  8. Jeff KingFeb 13, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.