From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: Vipul Kumar <kumar+git@onenetbeyond.org>, git@vger.kernel.org
Subject: Re: List all commits of a specified file in oldest to newest order
Date: Fri, 05 Nov 2021 11:49:03 -0700 [thread overview]
Message-ID: <xmqq7ddmxwtc.fsf@gitster.g> (raw)
In-Reply-To: <YYTorS1DiuTXv0/V@coredump.intra.peff.net> (Jeff King's message of "Fri, 5 Nov 2021 04:17:49 -0400")
Jeff King <peff@peff.net> writes:
> As a workaround, you can get what you want by two separate traversals:
> one to collect the commits via --follow, and then another to actually
> show them (but without doing any further walking). Like:
>
> git log --follow --format=%H -- $your_file |
> git log --stdin --no-walk --reverse [--oneline, -p, etc]
We learn new things every day.
Knowing the implementation, it is sort of obvious (we push the
objects into the pending list, populate the revs.commits in
prepare_revision_walk() from the pending list in order,
get_revision() first reverses the revs.commits and then gives out
the elements), but I didn't know the combination of "--no-walk" and
"--reverse" did something sensible ;-)
Thanks.
next prev parent reply other threads:[~2021-11-05 18:49 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-05 4:10 List all commits of a specified file in oldest to newest order Vipul Kumar
2021-11-05 8:13 ` Ævar Arnfjörð Bjarmason
2021-11-09 3:35 ` Vipul Kumar
2021-11-09 9:42 ` Ævar Arnfjörð Bjarmason
2021-12-14 3:58 ` Vipul Kumar
2021-11-05 8:17 ` Jeff King
2021-11-05 18:49 ` Junio C Hamano [this message]
2021-11-05 23:26 ` Jeff King
2021-11-09 5:24 ` Vipul Kumar
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqq7ddmxwtc.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=kumar+git@onenetbeyond.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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).