fi
}
-function _vcsh-setup () {
+function _vcsh-upgrade () {
(( CURRENT == 2 )) && __vcsh_repositories
}
"list-tracked-by:list files tracked by a repository"
"rename:rename a repository"
"run:run command with <\$GIT_DIR> and <\$GIT_WORK_TREE> set"
- "setup:set up repository with recommended settings"
+ "upgrade:upgrade repository to currently recommended settings"
"version:print version information"
"which:find <substring> in name of any tracked file"
"write-gitignore:write .gitignore.d/<repo> via git ls-files"
post-enter
pre-run
post-run
-pre-setup
-post-setup
+pre-upgrade
+post-upgrade
`vcsh` run <repo> <shell command>
-`vcsh` setup <repo>
+`vcsh` upgrade <repo>
`vcsh` version
This is needed to support mr and other scripts properly and of no concern to
an interactive user.
-* setup:
- Set up repository with recommended settings.
+* upgrade:
+ Upgrade repository to currently recommended settings.
* version:
Print version information.
is mandatory, though.
Available hooks are <pre-enter>, <post-enter>, <pre-run>, <post-run>,
-<pre-setup>, and <post-setup>. If you need more, vcsh is trivial to patch,
+<pre-upgrade>, and <post-upgrade>. If you need more, vcsh is trivial to patch,
but please let upstream know so we can ship them by default.
## DETAILED HOWTO AND FURTHER READING
<newname> Rename repository
run <repo> \\
<command> Use this repository
- setup <repo> Set up repository with recommended settings
+ upgrade <repo> Upgrade repository to currently recommended settings
version Print version information
which <substring> Find substring in name of any tracked file
write-gitignore \\
mkdir -p "$GIT_WORK_TREE" || fatal "could not create '$GIT_WORK_TREE'" 50
cd "$GIT_WORK_TREE" || fatal "could not enter '$GIT_WORK_TREE'" 11
git init
- setup
+ upgrade
}
list() {
hook post-run
}
-setup() {
- hook pre-setup
+upgrade() {
+ hook pre-upgrade
use
git config core.worktree "$GIT_WORK_TREE"
git config core.excludesfile ".gitignore.d/$VCSH_REPO_NAME"
git config vcsh.vcsh 'true'
[ -e "$VCSH_BASE/.gitignore.d/$VCSH_REPO_NAME" ] && git add -f "$VCSH_BASE/.gitignore.d/$VCSH_REPO_NAME"
- hook post-setup
+ hook post-upgrade
}
use() {
[ "$1" = 'list-tracked-by' ] ||
[ "$1" = 'rename' ] ||
[ "$1" = 'run' ] ||
- [ "$1" = 'setup' ] ||
+ [ "$1" = 'upgrade' ] ||
[ "$1" = 'write-gitignore' ]; then
[ -z $2 ] && fatal "$1: please specify repository to work on" 1
[ "$1" = 'rename' -a -z "$3" ] && fatal "$1: please specify a target name" 1