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

Re: git-blame vs. abbrev

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 30, 2026, 19:49 UTC
Message-ID
<xmqqy0fvreps.fsf@gitster.g>
In-Reply-To
<b500479b-14c1-4fbb-a672-1d2cd4852601@posteo.net>
Laszlo Ersek <laszlo.ersek@posteo.net> writes:
Show 10 quoted lines
> Hi,
>
> when git-blame is passed the "-b" option ("Show blank SHA-1 for boundary 
> commits"), shouldn't git-blame *stop* reserving a commit hash nibble for 
> the caret that otherwise marks boundary commits?
>
> More directly, I find it inconvenient that git-blame shows commit hashes 
> that are one nibble longer (13) than my "core.abbrev" (12) setting; that 
> makes cutting and pasting commit hashes from the git-blame output into a 
> git-rebase TODO list cumbersome.

I never knew that the parser in rebase did not want to see a longer abbreviation; shouldn't it take 16 hexadecimal abbreviation from the result of letting the user edit the list, even if it initially gave 12 hexadecimal abbreviation, as long as these extra 4 hexdigits do not break the commit object name? That is a more serious usability bug that needs to be fixed, if it is the case, I would think.

FWIW, even if your core.abbrev says you want 12, if two objects share the same 12 hexdigits as the prefix, you do end up getting 13 or more, so a parser that insists on exact 12 hexdigits sounds like a bug.

Just for the sake of aesthetics, I agree that when we are not showing the boundary mark, it would make sense not to reserve one column that we know we will never use. But unless there is a mistaken parser that insists on 12 hexdigits when 13 hexdigits you give uniquely identify the same object, I suspect you wouldn't even notice that the hexadecimal digits you see on the screen have one digit longer than usual ;-).

Previous: Laszlo ErsekNext: Laszlo Ersek
Message 2 of 9 in “git-blame vs. abbrev”
  1. Laszlo ErsekJun 30, 2026
  2. Junio C HamanoJun 30, 2026
  3. Laszlo ErsekJun 30, 2026
  4. Junio C HamanoJun 30, 2026
  5. Laszlo ErsekJul 1, 2026
  6. René ScharfeJun 30, 2026
  7. Laszlo ErsekJul 1, 2026
  8. blame: reserve mark column only if necessaryRené Scharfe, Jul 6, 2026
  9. Junio C HamanoJul 6, 2026

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.