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

Re: git-last-modified on bare repository

From
KHKristoffer Haugsbakk <kristofferhaugsbakk@fastmail.com>
Date
Jan 5, 2026, 15:17 UTC
Message-ID
<f9449d2c-cbfd-46b0-a961-5c668b895503@app.fastmail.com>
In-Reply-To
<aVvSwkK7RdpFDaVv@pks.im>
On Mon, Jan 5, 2026, at 16:03, Patrick Steinhardt wrote:
Show 28 quoted lines
> On Mon, Jan 05, 2026 at 02:35:56PM +0100, Gusted wrote:
>> Hi,
>>
>> Now trying to actually make Forgejo use git last-modified after being
>> pointed to the non-yet-documented options but I quickly noticed that it
>> looks like it does not work as intended on bare repositories when looking
>> specifying files.
>>
>> $ git clone https://codeberg.org/Gusted/math-accuracy
>> $ cd math-accuracy
>> $ git last-modified -- LICENSES
>> 768f05837e7db2832425bc3b65d0f524e81b2769        LICENSES
>>
>> And on a bare repository:
>>
>> $ git clone --bare https://codeberg.org/Gusted/math-accuracy
>> $ cd math-accuracy.git
>> $ git last-modified -- LICENSE
>> fatal: ambiguous argument 'LICENSE': unknown revision or path not in the
>> working tree.
>> Use '--' to separate paths from revisions, like this:
>> 'git <command> [<revision>...] -- [<file>...]'
>>
>> Is a worktree required for this to work?
>
> A worktree is not required for this to work. The problem is that you've
> got a typo in there: you say "LICENSE", but the actual file is called
> "LICENSES". If you spell it correctly it should work alright.

The error message is more generic than it needs to be though. It has seen a `--` but it falls back to “revision or path”. A more pointed error error message “unknown path” would make it harder to make the mistake of dismissing the error as a bogus one.

Of course, separate issue and all.
Previous: D. Ben KnobleNext: Toon Claes
Message 10 of 11 in “git-last-modified on bare repository”
  1. GustedJan 5, 2026
  2. Patrick SteinhardtJan 5, 2026
  3. GustedJan 5, 2026
  4. Patrick SteinhardtJan 5, 2026
  5. GustedJan 6, 2026
  6. Patrick SteinhardtJan 6, 2026
  7. Kristoffer HaugsbakkJan 6, 2026
  8. Junio C HamanoJan 7, 2026
  9. D. Ben KnobleJan 7, 2026
  10. Kristoffer HaugsbakkJan 5, 2026
  11. Toon ClaesJan 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.