home | list info | list archive | date index | thread index

Re: [OCLUG-Tech] what does git not do *easily* you shouldn't be doing anyway?

  • Subject: Re: [OCLUG-Tech] what does git not do *easily* you shouldn't be doing anyway?
  • From: Alex Pilon <alp [ at ] alexpilon [ dot ] ca>
  • Date: Wed, 28 Sep 2016 07:28:48 -0400
On Wed, Sep 28, 2016 at 04:48:15AM -0400, Robert P. J. Day wrote:
>   perfect example: "how do i find the Nth last version of a file?"
> now, you can certainly do this in git, using "git log", then extract
> the commit ID from the appropriate line and so on. but (AFAIK), there
> is no single command to get that info.

Hehe.

    git rev-list --max-count=1 --skip=2 HEAD -- theFile

I'm sorry. Couldn't resist. rev-list and rev-parse are your friends for
these kind of more programmatic searches.