Re: git and time
- From
Jan Harkes <jaharkes@cs.cmu.edu>
- Date
- Sep 29, 2006, 17:37 UTC
- Message-ID
- <20060929173736.GA13635@delft.aura.cs.cmu.edu>
- In-Reply-To
- <20060926224133.714337eb.seanlkml@sympatico.ca>
On Tue, Sep 26, 2006 at 10:41:33PM -0400, Sean wrote:
> It is interesting information for some people though. For instance > someone wondering how long ago Linus published a certain security fix. > To be able to say to easily query gitweb and be able to report, > "Linus published that security fix X day ago etc.."
I don't see the point in knowing how many days ago the security fix was published, since I'd really care if my machine is running a kernel that contains the fix.
So I can see how I might want to know which branches (and/or tags) in my repository contain the security fix. And this is pretty easy,
#!/bin/sh
fix="$(git-rev-parse --verify $1)"
git ls-remote . | while read sha ref ; do
[ "$fix" == "$(git-merge-base "$fix" "$sha")" ] && echo $ref
doneOf course this could be cleaned up and extended quite a bit, possibly allowing a user to specify if he cares about only branches, or tags or some specific branch.
Jan