Hullo,
Does anyone use GIT?
I want to know if one can use git-archive to retrieve a tarball snapshot of head revision at or before an instructed date. Google is not being my friend.
Thanks,
Jenny
NOt sure if I'm being helpful here, but certainly the way Ive used git (ie getting stuff off github) is by using gitg (gitg --all &) once Ive created a local repository. Picking the version I want based on tag/date etc and doing a git checkout <sha or tag>. Sorry havent used git-archive before
On Jun 20, 2010 2:45pm, Jenny Hopkins hopkins.jenny@gmail.com wrote:
Hullo,
Does anyone use GIT?
I want to know if one can use git-archive to retrieve a tarball
snapshot of head revision at or before an instructed date. Google is
not being my friend.
Thanks,
Jenny
main@lists.alug.org.uk
Unsubscribe? See message headers or the web site above!
Jenny Hopkins hopkins.jenny@gmail.com
Does anyone use GIT?
I want to know if one can use git-archive to retrieve a tarball snapshot of head revision at or before an instructed date. Google is not being my friend.
We use git extensively. I think if you use git-log -1 --until=DATE to get the commit number of the head revision at or before that date, then you could just give that as the main option to git-archive, but I've not tested that.
The man pages are pretty good. No need to Google. Google is no-one's friend but its own.
Regards,
On 21 June 2010 10:21, MJ Ray mjr@phonecoop.coop wrote:
Jenny Hopkins hopkins.jenny@gmail.com
Does anyone use GIT?
I want to know if one can use git-archive to retrieve a tarball snapshot of head revision at or before an instructed date. Google is not being my friend.
We use git extensively. I think if you use git-log -1 --until=DATE to get the commit number of the head revision at or before that date, then you could just give that as the main option to git-archive, but I've not tested that.
Thanks, Mark.
I'm boggling a bit from the man pages as to which commands have to be run from within a checked out git repository and which can allow a user to simply grab a tarballed snapshot as a one off. In my instance here. the gitweb page allows a user to see the revisions and click on a link to grab a tarball - no need to even have git installed: http://www.aleph1.co.uk/gitweb?p=yaffs2/.git;a=summary
This would translate in a script to: wget http://www.aleph1.co.uk/gitweb?p=yaffs2/.git;a=tree;h=5ea7d7c7d87b076ac17628...
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..
Thanks very much,
Jenny
Jenny Hopkins hopkins.jenny@gmail.com wrote:
wget http://www.aleph1.co.uk/gitweb?p=yaffs2/.git;a=tree;h=5ea7d7c7d87b076ac17628...
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..
It looks to me like the gitweb search should be able to find the right commit, but it just doesn't behave as I understand the help :-/
Sorry I'm stuck.
On 22 June 2010 11:30, MJ Ray mjr@phonecoop.coop wrote:
Jenny Hopkins hopkins.jenny@gmail.com wrote:
wget http://www.aleph1.co.uk/gitweb?p=yaffs2/.git;a=tree;h=5ea7d7c7d87b076ac17628...
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..
It looks to me like the gitweb search should be able to find the right commit, but it just doesn't behave as I understand the help :-/
Sorry I'm stuck.
Thanks for looking!
Jen
Hi,
On 22 June 2010 11:30, MJ Ray mjr@phonecoop.coop wrote:
Jenny Hopkins hopkins.jenny@gmail.com wrote:
wget http://www.aleph1.co.uk/gitweb?p=yaffs2/.git;a=tree;h=5ea7d7c7d87b076ac17628...
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..
It looks to me like the gitweb search should be able to find the right commit, but it just doesn't behave as I understand the help :-/
Surely you just use the commit ID as per the page?
commit 5ea7d7c7d87b076ac176282bff6eeddf329da2c4
no?
Srdjan
On 22 Jun 11:05, Jenny Hopkins wrote:
On 21 June 2010 10:21, MJ Ray mjr@phonecoop.coop wrote:
Jenny Hopkins hopkins.jenny@gmail.com
Does anyone use GIT?
I want to know if one can use git-archive to retrieve a tarball snapshot of head revision at or before an instructed date. Google is not being my friend.
We use git extensively. I think if you use git-log -1 --until=DATE to get the commit number of the head revision at or before that date, then you could just give that as the main option to git-archive, but I've not tested that.
Thanks, Mark.
I'm boggling a bit from the man pages as to which commands have to be run from within a checked out git repository and which can allow a user to simply grab a tarballed snapshot as a one off. In my instance here. the gitweb page allows a user to see the revisions and click on a link to grab a tarball - no need to even have git installed: http://www.aleph1.co.uk/gitweb?p=yaffs2/.git;a=summary
This would translate in a script to: wget http://www.aleph1.co.uk/gitweb?p=yaffs2/.git;a=tree;h=5ea7d7c7d87b076ac17628...
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,
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