You are not logged in.
Forgive me if I get any of this wrong as I am a bit of a git newbie, but how do you do development with git package? I've done some searching but haven't really been able to find any info.
Reading through makepkg it basically does this for git:
download
if name empty
git clone --mirror url name
else
cd name && git fetch --allextract
cd src
rm name
git clone ../name
set ref for branch/commit/tag
git checkout -b makepkg refSo it appears to me,
because it mirrors you cant use it for making changes because there is no working tree (is that what it's called?) and you can't use the clone in src because it just gets overwritten,
that the makepkg git is not designed for doing your own development but just for keeping a package up to date with git. Or have I missed something?
At the moment I edit the PKGBUILD to remove the source and then manually git clone in $srcdir but I feel there must be a more elegant way, is there?
I would've thought that just using ordinary git clone /git pull would be fine. No?
If the goal of the git packages is just to keep up to date wouldn't it be better to just to git clone --depth=1 or git archive directly from the remote? I found some stuff about this bug tracker and mailing lists but there didn't seem to be any solid conclusion.
Last edited by parchedas (2014-07-20 01:38:01)
Offline
Offline
What in particular? I know how to write a PKGBUILD using git just for installation, I'm asking how to do it so that I can work on the repo too, push upstream etc.
Offline
Well, makepkg is for installation... What exactly are you trying to achieve?
Offline
Well, makepkg is for installation... What exactly are you trying to achieve?
I was under the impression that it wasn't and that's why it fetches the whole repo. I have a git project that I am starting to contribute to and I want to be able to make a package and install it from a repo that I can work on too.
Offline
You need to clone the repo you wanna work on, and make your changes/branches/etc there outside of any makepkg considerations. If you want to be able to make a package from that repo, you can use your PKGBUILD and simply use a file:// URL as source, something like:
source=("git+file:///path/to/repo/.git")makepkg will create its own clone of the repo to be able to build, but you shouldn't do any work on that repo and have your own somewhere else.
Offline
... the makepkg git is not designed for doing your own development but just for keeping a package up to date with git. Or have I missed something?
Correct. You have missed nothing.
Makepkg is for making packages. PKGBUILDs are instructions for building packages.
I'm not sure what gave you other ideas. One *could* do some odd contortions to make modifications and push them from a repo checked out via makepkg. But I certainly never would. That is not the intent, and it will never make a productive work flow.
If you want to work on a project, simply `git clone <url>` it somewhere else. In my case I have a build directory with PKGBUILDs and assorted stuff, then I also have a ~/code directory with a subdirectory for each project I work on. New project: `cd ~/code && git clone <project-url>`.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Do the clone manually in $SRCDIR. makepkg will use a normal clone just fine.
Offline
Thanks guys, all useful answers. I think Scimmia's answer is the one I'm looking for (although I assume you mean $SRCDEST not $SRCDIR)
Side note: I was wondering why makepkg does a full clone rather than just a shallow clone and as far as I can tell it is so that you can git describe in pkgver(). I wonder though, if the fragment is a tag, and presumably you don't need git describe, if it would be better if makepkg did a shallow clone. This would be useful for projects that don't distribute source but only tag stable releases with git, although maybe these are few and far between, I only know of one.
Offline
Yep, I meant $SRCDEST, was just typing from memory and got it wrong.
Offline