On 22 June 2010 11:45, Brett Parker iDunno@sommitrealweird.co.uk wrote:
I was hoping I could pass a date to something git-like that does the same sort of thing, if that makes sense. Or use wget with a date as per above..
OK - here's what you can use to generate a tar of a specified date...
GIT_DIR=/path/to/the/.git git archive --format=tar $(git rev-list -n1 --before="YYYY-mm-dd 23:59:59" master) | gzip -9 > /path/to/where/you/want/the/tar/created.tar.gz
That would be the last commit before 23:59:59 on the date YYYY-mm-dd.
Basically, what you're going is getting the commit id using git rev-list and passing that to the git archive command. You probably also want to use a --prefix on the archive command so that the .tar.gz gets nice paths in it.
Hope that helps,
This is very close indeed...the flaw being that git-archive can be run remotely passing a repository URL, but it looks like git-rev-list has to be run from within a checked out git repository. Perhaps something cunning can be done.
Srdjan:
Surely you just use the commit ID as per the page?
That's what the git-rev-list part of Brett's command will get. The script that will run this only knows about a date, you see.
Thanks,
Jenny