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

Re: cat-file: dies with --batch if reflog entry is out of bounds

From
Jeff King <peff@peff.net>
Date
Feb 12, 2026, 04:07 UTC
Message-ID
<20260212040708.GA1894049@coredump.intra.peff.net>
In-Reply-To
<2b07489b-1689-4ecd-9cda-012540fe56e2@app.fastmail.com>
On Thu, Feb 12, 2026 at 12:13:36AM +0100, Kristoffer Haugsbakk wrote:
Show 8 quoted lines
>     $ git cat-file --batch
>     HEAD@{7}
>     <commit>
>     branch@{20}
>     fatal: log for 'branch' only has 5 entries
>     [died]
> 
> This is a known limitation.
I expect there are others. E.g.:
  $ git checkout --detach
  $ echo @{upstream} | git cat-file --batch
  fatal: HEAD does not point to a branch

So I'd guess that there is probably a lot more work to be done on top of 393bbb21 to make GET_OID_GENTLY work consistently. But doing that will incrementally take us in a good direction (for cat-file and for other callers).

-Peff
Previous: Junio C Hamano
Message 3 of 3 in “cat-file: dies with --batch if reflog entry is out of bounds”
  1. Kristoffer HaugsbakkFeb 11, 2026
  2. Junio C HamanoFeb 11, 2026
  3. Jeff KingFeb 12, 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.