@@ -23,13 +23,13 @@ help() {
23
23
<newname> Rename repository
24
24
run <repo> \\
25
25
<command> Use this repository
26
-
27
- seed-gitignore \\
28
- <repo> Seed .gitignore.d/<repo> from git ls-files
29
26
setup Set up repository with recommended settings
27
+ write-gitignore \\
28
+ <repo> Write .gitignore.d/<repo> via git ls-files
30
29
31
30
<repo> <git command> Special command that allows you to run git commands
32
31
directly without having to type so much ;)" >&2
32
+ < repo> Special command that enters a repository
33
33
}
34
34
35
35
debug () {
@@ -141,7 +141,21 @@ run() {
141
141
$VCSH_EXTERNAL_COMMAND
142
142
}
143
143
144
- seed_gitignore () {
144
+ setup () {
145
+ use
146
+ git config core.worktree " $GIT_WORK_TREE "
147
+ git config core.excludesfile " .gitignore.d/$VCSH_REPO_NAME "
148
+ git config vcsh.vcsh ' true'
149
+ [ -e " $HOME /.gitignore.d/$VCSH_REPO_NAME " ] && git add -f " $HOME /.gitignore.d/$VCSH_REPO_NAME "
150
+ }
151
+
152
+ use () {
153
+ git_dir_exists
154
+ export GIT_WORK_TREE=" $( git config --get core.worktree) "
155
+ export VCSH_DIRECTORY=" $VCSH_REPO_NAME "
156
+ }
157
+
158
+ write_gitignore () {
145
159
use
146
160
cd " $HOME " || fatal " could not enter '$HOME '" 11
147
161
gitignores=$( for file in $( git ls-files) ; do
@@ -170,20 +184,6 @@ seed_gitignore() {
170
184
fatal " could not move '$tempfile ' to '$HOME /.gitignore.d/$VCSH_REPO_NAME '" 53
171
185
}
172
186
173
- setup () {
174
- use
175
- git config core.worktree " $GIT_WORK_TREE "
176
- git config core.excludesfile " .gitignore.d/$VCSH_REPO_NAME "
177
- git config vcsh.vcsh ' true'
178
- [ -e " $HOME /.gitignore.d/$VCSH_REPO_NAME " ] && git add -f " $HOME /.gitignore.d/$VCSH_REPO_NAME "
179
- }
180
-
181
- use () {
182
- git_dir_exists
183
- export GIT_WORK_TREE=" $( git config --get core.worktree) "
184
- export VCSH_DIRECTORY=" $VCSH_REPO_NAME "
185
- }
186
-
187
187
if [ " $1 " = ' clone' ]; then
188
188
[ -z $2 ] && fatal " $1 : please specify a remote" 1
189
189
export VCSH_COMMAND=" $1 "
@@ -197,8 +197,8 @@ elif [ "$1" = 'delete' ] ||
197
197
[ " $1 " = ' list-tracked-by' ] ||
198
198
[ " $1 " = ' rename' ] ||
199
199
[ " $1 " = ' run' ] ||
200
- [ " $1 " = ' seed-gitignore ' ] ||
201
- [ " $1 " = ' setup ' ]; then
200
+ [ " $1 " = ' setup ' ] ||
201
+ [ " $1 " = ' write-gitignore ' ]; then
202
202
[ -z $2 ] && fatal " $1 : please specify repository to work on" 1
203
203
[ " $1 " = ' rename' -a -z " $3 " ] && fatal " $1 : please specify a target name" 1
204
204
[ " $1 " = ' run' -a -z " $3 " ] && fatal " $1 : please specify a command" 1
@@ -207,7 +207,7 @@ elif [ "$1" = 'delete' ] ||
207
207
export GIT_DIR=" $VCSH_BASE /$VCSH_REPO_NAME .git"
208
208
[ " $VCSH_COMMAND " = ' rename' ] && export GIT_DIR_NEW=" $VCSH_BASE /$3 .git"
209
209
[ " $VCSH_COMMAND " = ' run' ] && shift 2 && export VCSH_EXTERNAL_COMMAND=" $* "
210
- [ " $VCSH_COMMAND " = ' seed -gitignore' ]
210
+ [ " $VCSH_COMMAND " = ' write -gitignore' ]
211
211
elif [ " $1 " = ' list' ] ||
212
212
[ " $1 " = ' list-tracked' ]; then
213
213
export VCSH_COMMAND=" $1 "
0 commit comments