-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathluapower-git.html
170 lines (159 loc) · 7.73 KB
/
luapower-git.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<title> luapower-git - git workflow for luapower </title>
<script src="jquery.js"></script>
<script src="jquery-cookie.js"></script>
<script src="jquery-tablesorter.js"></script>
<script src="strftime.js"></script>
<script src="mustache.js"></script>
<script src="config.js"></script>
<script src="main.js"></script>
<link rel="stylesheet" type="text/css" href="templates/reset.css" />
<link rel="stylesheet" type="text/css" href="templates/hack.css" />
<link rel="stylesheet" type="text/css" id="lights_css" />
<script>
var DOCNAME = 'luapower-git'
var PROJECT = 'luapower-git'
//set the lights before rendering starts
set_lights()
</script>
</head>
<body>
<header>
<div class="container">
<div class="btn-container btn-lights-container">
<a href="#" class="btn btn-lights" id="lights">lights</a>
</div>
<div class="btn-container btn-home-container">
<a href="/" class="btn btn-home">luapower</a>
</div>
<table id="header_table">
<tr>
<td style="vertical-align: middle;" width="100%">
<h1> luapower-git </h1>
<h2> git workflow for luapower </h2>
</td>
<td style="vertical-align: middle;" align="right" style="height: 150px">
<table><tr><td>
<div class="doc" id="package_info_container">
<div id="package_info"> </div>
<div id="commit_log"> </div>
</div>
<a href="https://github.com/luapower/luapower-git" class="btn btn-rightside btn-github"><span class="icon"></span>View on GitHub</a>
</td></tr><tr><td>
<a href="https://github.com/luapower/luapower-git/tarball/master" class="btn btn-rightside">Download as .tar.gz</a>
</td></tr><tr><td>
<a href="https://github.com/luapower/luapower-git/zipball/master" class="btn btn-rightside">Download as .zip</a>
</td></tr></table>
</td>
</tr>
</table>
<div class="btn-container btn-discuss-container">
<a href="https://github.com/luapower/luapower-git/issues/new" target="_blank"
class="btn btn-rightside btn-discuss"><span class="icon"></span>Discuss</a>
</div>
</div>
</header>
<div class="bg-container">
<div class="bg-center-container">
<div class="bg bg-luapower-git" style="background-image: url('bg/luapower-git.png');"></div>
</div>
</div>
<div class="under-header">
<div class="container">
<div id="toc_container" class="toc_container doc"></div>
<button id=tab1_button class="tab_button hidden">Documentation</button>
<button id=tab2_button class="tab_button hidden">Package Info</button>
<div id="tabs_cointainer">
<div id="tab1_container">
<section class="doc">
<span id="module_info"></span>
<h2 id="what">What</h2>
<p>Downloading and managing luapower packages with git, using a simple git wrapper.</p>
<h2 id="why-a-git-wrapper">Why a git wrapper?</h2>
<p>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 <a href="http://github.com/luapower/luapower-git/blob/master/clone.sh">few more git commands</a>, that's all.</p>
<h2 id="how">How</h2>
<p>First, let's git it:</p>
<pre><code>> git clone https://github.com/luapower/luapower-git luapower
> cd luapower</code></pre>
<blockquote>
<p>The ssh url is <code>ssh://[email protected]/luapower/luapower-git</code></p>
</blockquote>
<p>This brings in the <code>clone</code> and <code>remove</code> commands:</p>
<pre><code>> clone
USAGE:
clone <package> [origin | url] clone a package
clone --list list uncloned packages
clone --all clone all packages</code></pre>
<blockquote>
<p><strong>NOTE:</strong> In Linux, the command is <code>./clone.sh</code>. They're all like that.</p>
</blockquote>
<blockquote>
<p><strong>Tip:</strong> To clone packages via ssh instead, you can either, a) edit <code>_git/luapower.baseurl</code> and replace the url there with <code>ssh://[email protected]/luapower/</code>, or b) configure git to replace urls on-the-fly with <code>git config --global url."ssh://[email protected]/luapower/".insteadOf https://github.com/luapower/</code></p>
</blockquote>
<blockquote>
<p><strong>Tip:</strong> You can clone luapower packages from any location, not just github, as long as they have the proper <a href="get-involved.html">directory layout</a>. These locations can even be labeled to avoid typing the full url every time when cloning. Create a file named <code>_git/xyz.baseurl</code>, write the base url (with traling slash) in it, and then clone it by typing <code>clone <package> xyz</code>.</p>
</blockquote>
<pre><code>> remove
USAGE:
remove <package> remove a cloned package completely from the disk
remove --list list cloned packages</code></pre>
<p>The rest is done via git, using the <code>proj</code> command to set the context (repo) in which git should operate.</p>
<pre><code>> proj foo
[foo] > git ls-files
foo.lua
foo.md
[foo] > proj bar
[bar] > git pull
...
[bar] > proj baz
[baz] > git pull
...</code></pre>
<blockquote>
<p><code>proj</code> is just a glorified wrapper for setting the env var <code>GIT_DIR=_git/<package>/.git</code>, which allows us to use git (for a specific package) without leaving the (shared) work-tree.</p>
</blockquote>
<h2 id="building-all-c-libraries">Building all C libraries</h2>
<pre><code>> cd csrc
> build --all</code></pre>
<p>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 <a href="building.html">environment</a> for this to work.</p>
<h2 id="updating-all-packages">Updating all packages</h2>
<pre><code>> on-all git pull</code></pre>
<h2 id="module-development">Module development</h2>
<h3 id="creating-a-new-package">Creating a new package</h3>
<ol style="list-style-type: decimal">
<li>Create <code>_git/<package.origin></code> and write in it the git url where you plan to upload your package.</li>
<li>Run <code>clone <package></code>. It will fail since there's no repo at that url, but it will create your local repository.</li>
<li>Add your files, which can be anywhere in the luapower tree. Refer to <a href="get-involved.html">get-involved</a> if you want to stick to the conventions, but you don't have to, unless you want to add your module to luapower.com.</li>
<li>Type <code>proj <package></code> and then add/commit/push with the usual <code>git add</code>, <code>git commit</code> and <code>git push</code> commands. To avoid seeing other modules' files as untracked, create a file named <code><package>.exclude</code>, which is the .gitignore file for your package.</li>
</ol>
<h3 id="updating-multiple-packages">Updating multiple packages</h3>
<p>Here's a few handy git wrappers for tracking changes across the entire repo collection:</p>
<pre><code>> modified ; list modified files across all repos
> unpushed ; list unpushed repos
> untracked ; list untracked files (takes a while)</code></pre>
<h2 id="module-publishing">Module publishing</h2>
<p>Refer to <a href="get-involved.html">get-involved</a>.</p>
</section>
</div>
<div id="tab2_container" class="doc"></div>
</div>
</div>
<div class="container">
<footer>
<div id="disqus_thread"></div>
<div class="faint">[email protected] | <a href="http://unlicense.org/">public domain</a></div>
</footer>
</div>
</div>
<script type="text/x-mustache" id=info_tab_template>
<h3>Modules</h3>
<ul>
{{#module_array}}
<li>{{name}}</li>
{{/module_array}}
</ul>
</script>
</body>
</html>