All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick Steinhardt <ps@pks.im>
To: Gusted <gusted@codeberg.org>
Cc: git@vger.kernel.org, Toon Claes <toon@iotcl.com>
Subject: Re: git-last-modified on bare repository
Date: Mon, 5 Jan 2026 16:17:32 +0100	[thread overview]
Message-ID: <aVvWDDtBeJMIF3F0@pks.im> (raw)
In-Reply-To: <8e6dd4d7-6e0a-477a-b10c-8571d6b7da4c@codeberg.org>

On Mon, Jan 05, 2026 at 04:06:39PM +0100, Gusted wrote:
> On 1/5/26 4:03 PM, Patrick Steinhardt wrote:
> > 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.
> > 
> 
> Ah, sorry the typo is on me from copying the wrong command from the shell
> history. It produces the same output with using LICENSES as path.
> 
> $ git last-modified -- LICENSES
> fatal: ambiguous argument 'LICENSES': unknown revision or path not in the
> working tree.
> Use '--' to separate paths from revisions, like this:
> 'git <command> [<revision>...] -- [<file>...]'

Hm, interesting, this works for me in a bare repository. Has this
already been fixed...? Indeed, bisecting this points to 05491b90ce
(last-modified: support sparse checkouts, 2025-11-29). So you should
probably try with Git's "master" branch.

Patrick

  reply	other threads:[~2026-01-05 15:17 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-05 13:35 git-last-modified on bare repository Gusted
2026-01-05 15:03 ` Patrick Steinhardt
2026-01-05 15:06   ` Gusted
2026-01-05 15:17     ` Patrick Steinhardt [this message]
2026-01-06  9:42       ` Gusted
2026-01-06  9:58         ` Patrick Steinhardt
2026-01-06 10:54           ` Kristoffer Haugsbakk
2026-01-07  0:01             ` Junio C Hamano
2026-01-07 17:12               ` D. Ben Knoble
2026-01-05 15:17   ` Kristoffer Haugsbakk
2026-01-12 15:15   ` Toon Claes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aVvWDDtBeJMIF3F0@pks.im \
    --to=ps@pks.im \
    --cc=git@vger.kernel.org \
    --cc=gusted@codeberg.org \
    --cc=toon@iotcl.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.