You are not logged in.

#1 2011-06-19 16:32:51

graysky
Member
From: /run/user/1000
Registered: 2008-12-01
Posts: 8,520
Website

git for a newbie - task pull an old kernel26

I want to pull down an older version of the PKGBUILD, config files, etc. for kernel26 from git. How is this most efficiently (bandwidth wise) accomplished?

cd /home/facade/git/arch_packages
git clone git://projects.archlinux.org/svntogit/packages.git
# if this was done previously
# cd kernel26 && git pull origin

From here, how am I able to see the various version of for example PKGBUILD, select the one that corresponds to say 2.6.37.4-1 and pull it and the associated files?


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#2 2011-06-19 16:44:46

bangkok_manouel
Member
From: indicates a starting point
Registered: 2005-02-07
Posts: 1,554

Re: git for a newbie - task pull an old kernel26

there may be some more efficient way to do that but that should work anyway:

git log

then search for the kernel version you're interested in using "/"
see the commit related to the update and run:

git checkout <commit>

now your repo's state should be exactly the same as the time of this commit.

you could also check if the repo owner uses tags for each version:

git tag

if it's the case, then you could simply:

git checkout <tag>

I have an extremely limited usage of git so, again, there may be some better ways to do that.


All design goals must be phrased in such a way that it is hard to use them as slogans to justify stupidity.

Offline

#3 2011-06-19 17:18:46

graysky
Member
From: /run/user/1000
Registered: 2008-12-01
Posts: 8,520
Website

Re: git for a newbie - task pull an old kernel26

Thanks for the reply.  Your instructions worked perfectly (no tags btw).  I won't mark as solved yet in case others perhaps more savvy with git care to comment.

EDIT: question for someone: when I pulled down the commit, is there a way to preserve the original date/time stamps?  I didn't see anything in the man page but this seems like something people would want to see.

git checkout 1cb8b62df9e00edf475a47f118208327a76c898a

Last edited by graysky (2011-06-19 17:21:13)


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#4 2011-06-19 19:18:07

quigybo
Member
Registered: 2009-01-15
Posts: 220

Re: git for a newbie - task pull an old kernel26

If you know what the commit message looks like, then you can do something like this (maybe use show first to check that you have the correct commit):

git checkout ':/kernel26 2.6.37.4-1'

BTW the git-rev-parse manpage is full of goodness. wink

Offline

#5 2011-07-02 05:26:39

vadmium
Member
Registered: 2010-11-02
Posts: 63

Re: git for a newbie - task pull an old kernel26

graysky wrote:

When I pulled down the commit, is there a way to preserve the original date/time stamps?  I didn't see anything in the man page but this seems like something people would want to see.

Is it something you want to see? Usually if I care about the timestamps of files checcked out at all, it’s because I’d want a “make” command to notice the changed source files. I like to think of checking out a different version something with Git or Subversion as being like editing the files or applying a patch.

Having said that, a quick google brings up Git FAQ on preserving timestamps and git-set-file-times script.

Offline

Board footer

Powered by FluxBB