git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
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, 5 Nov 2021 19:26:17 -0400	[thread overview]
Message-ID: <YYW9mfsyemUsBezG@coredump.intra.peff.net> (raw)
In-Reply-To: <xmqq7ddmxwtc.fsf@gitster.g>

On Fri, Nov 05, 2021 at 11:49:03AM -0700, Junio C Hamano wrote:

> 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 ;-)

I admit that I did not know if it would work either until I tried it
earlier today. ;)

-Peff

  reply	other threads:[~2021-11-05 23:26 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
2021-11-05 23:26     ` Jeff King [this message]
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=YYW9mfsyemUsBezG@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=kumar+git@onenetbeyond.org \
    /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).