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 branchSo 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