From: Toon Claes <toon@iotcl.com>
To: Gusted <gusted@codeberg.org>,
git@vger.kernel.org, Jeff King <peff@peff.net>
Subject: Re: git-last-modified(1) slower than git-log(1)?
Date: Fri, 17 Jul 2026 21:12:00 +0200 [thread overview]
Message-ID: <87fr1h1ldr.fsf@emacs.iotcl.com> (raw)
In-Reply-To: <87v7afffpa.fsf@emacs.iotcl.com>
Toon Claes <toon@iotcl.com> writes:
> You're actually not the first to notice this, and I've been aware of
> this.
Hah, wait, ... the previous reporter was ... you[1].
> The thing is, you're testing the difference on a single file.
I was mixing up use-cases, and the problem you're stating here isn't
related to your previous report. Now while I did sent out patches for
the problem in this email, the issue in the other email isn't addressed
with it. Unfortunately.
(nerdsniping Peff :-))
Gusted <gusted@codeberg.org> writes:
> The current implementation of Forgejo (inherited from Gitea) works
> roughly like this:
> 1. Run `git log --name-status -c --format=commit%x00%H %P%x00" --parents
> --no-renames -t -z $OID -- :(literal)some/path`, the output of this is
> quite complex and possible outputs more information than necessary.
That's quite clever actually.
> 2. The output of this is piped to some code to a parser and reconstructs
> what commit ID last modified each file in the directory.
My only worry would be this could end up in a very long list of
(duplicate) commits. But you can probably filter out data as you read in
lines.
> 3. Via `git cat-file --batch` get each unique commits information.
Yes we use git-cat-file(1) in batch mode too.
But, and I learned this from blog post[2] from GitHub about Git v2.55,
git v2.55 now has git-format-rev(1)[3]. You can pipe the output of
git-last-modified(1) into that and get everything you want at once
(maybe).
I haven't tried yet to integrate that into GitLab to see if it would
bring any gains.
[1]: https://lore.kernel.org/git/03f96860-29fc-42a7-a220-c3ec65eb8516@codeberg.org/
[2]: https://github.blog/open-source/git/highlights-from-git-2-55/
[3]: https://git-scm.com/docs/git-format-rev
--
Cheers,
Toon
prev parent reply other threads:[~2026-07-17 19:12 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-14 18:33 git-last-modified(1) slower than git-log(1)? Gusted
2026-07-16 4:28 ` Jeff King
2026-07-16 11:42 ` Toon Claes
2026-07-17 8:09 ` Jeff King
2026-07-16 9:26 ` Toon Claes
2026-07-17 0:19 ` Gusted
2026-07-17 8:02 ` Jeff King
2026-07-17 19:12 ` Toon Claes [this message]
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=87fr1h1ldr.fsf@emacs.iotcl.com \
--to=toon@iotcl.com \
--cc=git@vger.kernel.org \
--cc=gusted@codeberg.org \
--cc=peff@peff.net \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox