luapower-gitgit workflow for luapower |
|
Downloading and managing luapower packages with git, using a simple git wrapper.
Because luapower packages need to be overlaid over the same directory, and there's just no git-clone option to do that - you need to type in a few more git commands, that's all.
First, let's git it:
> git clone https://github.com/luapower/luapower-git luapower
> cd luapower
The ssh url is
ssh://git@github.com/luapower/luapower-git
This brings in the clone
and remove
commands:
> clone
USAGE:
clone <package> [origin | url] clone a package
clone --list list uncloned packages
clone --all clone all packages
NOTE: In Linux, the command is
./clone.sh
. They're all like that.
Tip: To clone packages via ssh instead, you can either, a) edit
_git/luapower.baseurl
and replace the url there withssh://git@github.com/luapower/
, or b) configure git to replace urls on-the-fly withgit config --global url."ssh://git@github.com/luapower/".insteadOf https://github.com/luapower/
Tip: You can clone luapower packages from any location, not just github, as long as they have the proper directory layout. These locations can even be labeled to avoid typing the full url every time when cloning. Create a file named
_git/xyz.baseurl
, write the base url (with traling slash) in it, and then clone it by typingclone <package> xyz
.
> remove
USAGE:
remove <package> remove a cloned package completely from the disk
remove --list list cloned packages
The rest is done via git, using the proj
command to set the context (repo) in which git should operate.
> proj foo
[foo] > git ls-files
foo.lua
foo.md
[foo] > proj bar
[bar] > git pull
...
[bar] > proj baz
[baz] > git pull
...
proj
is just a glorified wrapper for setting the env varGIT_DIR=_git/<package>/.git
, which allows us to use git (for a specific package) without leaving the (shared) work-tree.
> cd csrc
> build --all
This builds all the packages that have a build script for the current platform, in the right order (pretty fast too). You need to set up a building environment for this to work.
> on-all git pull
_git/<package.origin>
and write in it the git url where you plan to upload your package.clone <package>
. It will fail since there's no repo at that url, but it will create your local repository.proj <package>
and then add/commit/push with the usual git add
, git commit
and git push
commands. To avoid seeing other modules' files as untracked, create a file named <package>.exclude
, which is the .gitignore file for your package.Here's a few handy git wrappers for tracking changes across the entire repo collection:
> modified ; list modified files across all repos
> unpushed ; list unpushed repos
> untracked ; list untracked files (takes a while)
Refer to get-involved.