Skip to content
Snippets Groups Projects
Commit 2b4962b3 authored by Richard Hartmann's avatar Richard Hartmann
Browse files

Merge branch 'debian' into debian-squeeze

Conflicts:
	debian/changelog
	debian/control
parents d8bb1185 66e301bf
No related branches found
Tags
No related merge requests found
Richard Hartmann <richih.mailinglist@gmail.com> <richih+github.com@richih.org>
Alphabetical list of everyone who ever committed to this repository Alphabetical list of everyone who ever committed to this repository
Vincent Demeester <vincent@demeester.fr> Vincent Demeester <vincent@demeester.fr>
Richard Hartmann <richih+github.com@richih.org> Valentin Haenel <valentin.haenel@gmx.de>
Richard Hartmann <richih.mailinglist@gmail.com> Richard Hartmann <richih.mailinglist@gmail.com>
Dieter Plaetinck <dieter@plaetinck.be> Dieter Plaetinck <dieter@plaetinck.be>
Corey Quinn <corey@sequestered.net> Corey Quinn <corey@sequestered.net>
......
...@@ -43,4 +43,4 @@ test: ...@@ -43,4 +43,4 @@ test:
if which git > /dev/null ; then :; else echo "'git' not found, exiting..."; exit 1; fi if which git > /dev/null ; then :; else echo "'git' not found, exiting..."; exit 1; fi
moo: moo:
if [ -x /usr/games/cowsay ]; then /usr/games/cowsay "I hope you're happy now..."; fi @if [ -x /usr/games/cowsay ]; then /usr/games/cowsay "I hope you're happy now..."; fi
# Archlinux
AUR does not require any packaging information within this repository.
# Debian
Debian packages are provided by the author in separate branches, maintained in
the upstream repository
## Ubuntu
Ubuntu imports Debian's package automagically.
# Mac OS X
Homebrew does not require any packaging information within this repository.
A separate branch with a statically compiled manpage and release tags is
provided to ease packaging. The static manpage because Homebrew lacks Ronn;
the tag so github generates tarballs Homebrew can be pointed at.
# Anything else
If you are maintaining a package for a different distribution, please get
in touch so your work can be included in another branch, thus allowing others
to adapt it to their needs or to improve it.
...@@ -35,6 +35,11 @@ The following overview will try to give you an idea of the use cases and ...@@ -35,6 +35,11 @@ The following overview will try to give you an idea of the use cases and
advantages of vcsh. See sections 3 and 4 for detailed instructions and advantages of vcsh. See sections 3 and 4 for detailed instructions and
examples. examples.
## 2.1 Talks ##
Some people found it useful to look at slides and videos explaining how vcsh works.
They can all be found at [here](http://richardhartmann.de/talks/).
# 3 Overview # 3 Overview
## 3.1 Comparison to Other Solutions ## ## 3.1 Comparison to Other Solutions ##
...@@ -197,19 +202,48 @@ the template will be stored. ...@@ -197,19 +202,48 @@ the template will be stored.
apt-get install mr apt-get install mr
#### 4.1.2 Clone the Template #### #### 4.1.2 Install vcsh ####
#### 4.1.2.1 Debian ####
If you are using Debian Squeeze, you will need to enable backports
apt-get install vcsh
#### 4.1.2.2 Arch Linux ####
vcsh is availabe via [AUR](https://aur.archlinux.org/packages.php?ID=54164)
and further documentation about the use of AUR is available
[on Arch's wiki](https://wiki.archlinux.org/index.php/Arch_User_Repository).
cd /var/abs/local/
wget https://aur.archlinux.org/packages/vc/vcsh-git/vcsh-git.tar.gz
tar xfz vcsh-git.tar.gz
cd vcsh-git
makepkg -s
pacman -U vcsh*.pkg.tar.xz
#### 4.1.2.3 From source ####
If your version of mr is older than version 1.07, make sure to put
include = cat /usr/share/mr/vcsh
into your .mrconfig .
# choose a location for your checkout
cd $HOME cd $HOME
mkdir -p ~/work/git mkdir -p ~/work/git
git clone git://github.com/RichiH/vcsh.git vcsh git clone git://github.com/RichiH/vcsh.git
# make sure 'include = cat /usr/share/mr/vcsh' points to an exiting file
vim .mrconfig
cd vcsh cd vcsh
ln -s vcsh /usr/local/bin # or add it to your PATH ln -s vcsh /usr/local/bin # or add it to your PATH
cd cd
#### 4.1.3 Clone the Template ####
vcsh clone git://github.com/RichiH/vcsh_mr_template.git mr vcsh clone git://github.com/RichiH/vcsh_mr_template.git mr
#### 4.1.3 Enable Your Test Repository #### #### 4.1.4 Enable Your Test Repository ####
mv ~/.zsh ~/zsh.bak mv ~/.zsh ~/zsh.bak
mv ~/.zshrc ~/zshrc.bak mv ~/.zshrc ~/zshrc.bak
...@@ -218,7 +252,7 @@ the template will be stored. ...@@ -218,7 +252,7 @@ the template will be stored.
cd cd
mr up mr up
#### 4.1.4 Set Up Your Own Repositories #### #### 4.1.5 Set Up Your Own Repositories ####
Now, it's time to edit the template config and fill it with your own remotes: Now, it's time to edit the template config and fill it with your own remotes:
......
2013-04-21 Richard Hartmann <richih.mailinglist@gmail.com>
* Release 1.2
* Introduce `vcsh version`
2013-03-31 Richard Hartmann <richih.mailinglist@gmail.com>
* Release 1.1
* Documentation fixes
* Use rm -f when removing a git repo
* Fix quoting bug (Debian #699093)
2013-02-13 Richard Hartmann <richih.mailinglist@gmail.com>
* Release 1.0.1
* Improve documentation
* Fix parameter bug
2012-06-30 Richard Hartmann <richih.mailinglist@gmail.com>
* Release 1.0
* Make `vcsh list` more resilient
* Lots of doc improvements
2012-02-27 Richard Hartmann <richih.mailinglist@gmail.com> 2012-02-27 Richard Hartmann <richih.mailinglist@gmail.com>
* Refactor Makefile * Refactor Makefile
......
vcsh (1.2-1) experimental; urgency=low
* New upstream release
+ Documentation fixes
+ Introduce `vcsh version` Closes: #694584
-- Richard Hartmann <richih.mailinglist@gmail.com> Sun, 21 Apr 2013 01:17:27 +0200
vcsh (1.1-1) experimental; urgency=low
* New upstream release
+ Documentation fixes
+ Use rm -f when removing a git repo
+ Fix quoting bug Closes: #699093
-- Richard Hartmann <richih.mailinglist@gmail.com> Sun, 31 Mar 2013 20:46:10 +0200
vcsh (1.0-1) unstable; urgency=low
* New upstream release
+ Make `vcsh list` more resilient
+ Lots of doc improvements
-- Richard Hartmann <richih.mailinglist@gmail.com> Sat, 30 Jun 2012 01:49:00 +0200
vcsh (0.20120227-1~bpo60+1) squeeze-backports; urgency=low vcsh (0.20120227-1~bpo60+1) squeeze-backports; urgency=low
* Rebuild for squeeze-backports. * Rebuild for squeeze-backports.
......
...@@ -3,15 +3,19 @@ Maintainer: Richard Hartmann <richih.mailinglist@gmail.com> ...@@ -3,15 +3,19 @@ Maintainer: Richard Hartmann <richih.mailinglist@gmail.com>
Section: misc Section: misc
Priority: optional Priority: optional
Standards-Version: 3.9.3 Standards-Version: 3.9.3
Build-Depends: debhelper (>= 7), git Build-Depends: debhelper (>= 7),
git
Vcs-Git: git://github.com/RichiH/vcsh.git Vcs-Git: git://github.com/RichiH/vcsh.git
Vcs-Browser: https://github.com/RichiH/vcsh Vcs-Browser: https://github.com/RichiH/vcsh
Homepage: https://github.com/RichiH/vcsh/blob/master/README.md Homepage: https://github.com/RichiH/vcsh/blob/master/README.md
Package: vcsh Package: vcsh
Architecture: all Architecture: all
Depends: ${shlibs:Depends}, ${misc:Depends}, git Depends: git,
Recommends: mr (>= 1.07), ssh-client ${misc:Depends},
${shlibs:Depends}
Recommends: mr (>= 1.07),
ssh-client
Description: manage config files in $HOME via fake bare git repositories Description: manage config files in $HOME via fake bare git repositories
vcsh allows you to have several git repositories, all maintaining their working vcsh allows you to have several git repositories, all maintaining their working
trees in $HOME without clobbering each other. That, in turn, means you can have trees in $HOME without clobbering each other. That, in turn, means you can have
......
...@@ -2,8 +2,8 @@ Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ ...@@ -2,8 +2,8 @@ Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: vcsh Upstream-Name: vcsh
Upstream-Contact: <richih.mailinglist@gmail.com> Upstream-Contact: <richih.mailinglist@gmail.com>
Source: https://github.com/RichiH/vcsh Source: https://github.com/RichiH/vcsh
License: GPL-2+
Copyright: 2011-2012 Richard Hartmann Copyright: 2011-2012 Richard Hartmann
License: GPL-2+
Files: * Files: *
Copyright: 2011-2012 Richard Hartmann <richih.mailinglist@gmail.com> Copyright: 2011-2012 Richard Hartmann <richih.mailinglist@gmail.com>
......
* 0: OK * 0: OK
* 1: Generic error * 1: Generic error
* 10: Init failed because $GIT_DIR exists * 10: Init failed because $GIT\_DIR exists
* 11: Could not enter $GIT_WORK_TREE * 11: Could not enter $GIT\_WORK\_TREE
* 12: No repository found * 12: No repository found
* 13: Required directory exists but is not a directory * 13: Required directory exists but is not a directory
* 16: Potentially harmful operation aborted * 16: Potentially harmful operation aborted
......
...@@ -3,6 +3,8 @@ vcsh(1) - manage config files in $HOME via fake bare git repositories ...@@ -3,6 +3,8 @@ vcsh(1) - manage config files in $HOME via fake bare git repositories
## SYNOPSIS ## SYNOPSIS
`vcsh` [<options>] <command>
`vcsh` clone <url> [<repo>] `vcsh` clone <url> [<repo>]
`vcsh` delete <repo> `vcsh` delete <repo>
...@@ -21,10 +23,12 @@ vcsh(1) - manage config files in $HOME via fake bare git repositories ...@@ -21,10 +23,12 @@ vcsh(1) - manage config files in $HOME via fake bare git repositories
`vcsh` rename <repo> <newname> `vcsh` rename <repo> <newname>
`vcsh` run <repo> <command> `vcsh` run <repo> <shell command>
`vcsh` setup <repo> `vcsh` setup <repo>
`vcsh` version
`vcsh` which <substring> `vcsh` which <substring>
`vcsh` write-gitignore <repo> `vcsh` write-gitignore <repo>
...@@ -59,6 +63,17 @@ an interactive user. ...@@ -59,6 +63,17 @@ an interactive user.
## OPTIONS ## OPTIONS
* -c:
Source <file> prior to other configuration files
* -d:
Enable debug mode
* -v:
Enable verbose mode
## COMMANDS
* clone: * clone:
Clone an existing repository. Clone an existing repository.
...@@ -100,6 +115,9 @@ an interactive user. ...@@ -100,6 +115,9 @@ an interactive user.
* setup: * setup:
Set up repository with recommended settings. Set up repository with recommended settings.
* version:
Print version information.
* which <substring>: * which <substring>:
Find <substring> in name of any tracked file. Find <substring> in name of any tracked file.
...@@ -117,6 +135,59 @@ an interactive user. ...@@ -117,6 +135,59 @@ an interactive user.
As noted earlier, `vcsh` will set <$GIT_DIR> and <$GIT_WORK_TREE> to the As noted earlier, `vcsh` will set <$GIT_DIR> and <$GIT_WORK_TREE> to the
appropriate values for fake bare git repositories. appropriate values for fake bare git repositories.
## CONFIG
There are several ways to turn the various knobs on `vcsh`. In order of
ascending precedence, they are:
* `VARIABLE=foo vcsh`
* </etc/vcsh/config>
* <$XDG_CONFIG_HOME/vcsh/config>
* `vcsh -c <file>`
Please note that those files are sourced. Any and all commands will be
executed in the context of your shell.
Interesting knobs you can turn:
* <$VCSH_GITIGNORE>:
Can be either <exact> or <recursive>.
<exact> will seed the repo-specific <.gitignore> with all file and directory
names which `git ls-files` returns.
<recursive> will descend through all directories recursively additionally to
the above.
Defaults to <exact>.
Less interesting knobs you could turn:
* <$VCSH_DEBUG>:
Enter debug mode.
* <$XDG_CONFIG_HOME>:
As specified in the 'XDG Base Directory Specification', see
<http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html>
Defaults to <$HOME/.config>.
* <$VCSH_REPO_D>:
The directory where repositories are read from and stored.
Defaults to <$XDG_CONFIG_HOME/vcsh/repo.d>.
* <$VCSH_HOOK_D>:
The directory where hooks are read from.
Defaults to <$XDG_CONFIG_HOME/vcsh/hooks-enabled>.
* <$VCSH_BASE>:
The directory where repositories are checked out to.
Defaults to <$HOME>.
## HOOK SYSTEM ## HOOK SYSTEM
`vcsh` provides a hook system. Hook scripts must be executable and should be `vcsh` provides a hook system. Hook scripts must be executable and should be
...@@ -141,25 +212,35 @@ but please let upstream know so we can ship them by default. ...@@ -141,25 +212,35 @@ but please let upstream know so we can ship them by default.
## DETAILED HOWTO AND FURTHER READING ## DETAILED HOWTO AND FURTHER READING
Man pages are intended to be short and thus often useless to glean best Manpages are often short and sometimes useless to glean best practices from.
practices from. This software comes with a file called <README.md>. It contains While the author tried to avoid this in this case, manpages can not cover
various approaches to setting up and using vcsh. You can view the file it as detailed howtos.
This software also comes with a file called <README.md>. It contains various
approaches to setting up and using vcsh. You can view the file it as
plain text or render it into various other formats via Markdown. plain text or render it into various other formats via Markdown.
On Debian-based systems, this file can be found in </usr/share/doc/vcsh>. On Debian-based systems, this file can be found in </usr/share/doc/vcsh>.
## SECURITY CONSIDERATIONS ## SECURITY CONSIDERATIONS
`vcsh` allows you to execute arbitrary commands via `vcsh` run. For example, `vcsh` allows you to execute arbitrary commands via `vcsh run`. For example,
adding a `sudo`(8) rule for `vcsh` would be pretty stupid. adding a `sudo`(8) rule for `vcsh` would be pretty stupid.
Additionally, vcsh will source, i.e. execute, <$XDG_CONFIG_HOME/vcsh/config>. Additionally, vcsh will source, i.e. execute, all files listed in <CONFIG>.
You can put any and all commands into this config file and they will be executed. You can put any and all commands into these config files and they will be
executed.
## BUGS ## BUGS
None are known at this time, but reports and/or patches are more than welcome. None are known at this time, but reports and/or patches are more than welcome.
## INTEROPERABILITY
If you rely on `git submodule` use `git` 1.7.12 or later. Earlier versions
do not clean internal variables properly before descending into submodules,
resulting in unhappy end users.
## HISTORY ## HISTORY
Like most people, the author initially made do with a single repository for all Like most people, the author initially made do with a single repository for all
......
...@@ -2,4 +2,4 @@ ...@@ -2,4 +2,4 @@
echo 'Alphabetical list of everyone who ever committed to this repository echo 'Alphabetical list of everyone who ever committed to this repository
' '
git log --all --format='%an <%ae>' | sort -u -k2 git shortlog -se --all | cut -f1 --complement | sort -u -k2
...@@ -5,26 +5,82 @@ ...@@ -5,26 +5,82 @@
# For details, see LICENSE. To submit patches, you have to agree to # For details, see LICENSE. To submit patches, you have to agree to
# license your code under the GNU GPL version 2 or later. # license your code under the GNU GPL version 2 or later.
# While the following is not legally binding, the author would like to
# explain the choice of GPLv2+ over GPLv3+.
# The author prefers GPLv3+ over GPLv2+ but feels it's better to maintain
# full compability with git. In case git ever changes its licensing terms,
# this software will most likely follow suit.
SELF=$(basename $0)
VERSION='1.2'
fatal() {
echo "$SELF: fatal: $1" >&2
exit $2
}
# We need to run getops as soon as possible so we catch -d and other
# options that will modify our behaviour.
# Commands are handled at the end of this script.
while getopts "c:dv" flag; do
if [ "$1" = '-d' ] || [ "$1" = '--debug' ]; then
set -vx
VCSH_DEBUG=1
elif [ "$1" = '-v' ];then
VCSH_VERBOSE=1
elif [ "$1" = '-c' ];then
VCSH_OPTION_CONFIG=$OPTARG
fi
shift 1
done
source_all() {
# Source file even if it's in $PWD and does not have any slashes in it
case "$1" in
*/*) . "$1";;
*) . "$PWD/$1";;
esac;
}
# Read configuration and set defaults if anything's not set
[ -n "$VCSH_DEBUG" ] && set -vx [ -n "$VCSH_DEBUG" ] && set -vx
[ -z "$XDG_CONFIG_HOME" ] && XDG_CONFIG_HOME="$HOME/.config" [ -z "$XDG_CONFIG_HOME" ] && XDG_CONFIG_HOME="$HOME/.config"
# Read configuration files if there are any
[ -r "/etc/vcsh/config" ] && . "/etc/vcsh/config"
[ -r "$XDG_CONFIG_HOME/vcsh/config" ] && . "$XDG_CONFIG_HOME/vcsh/config" [ -r "$XDG_CONFIG_HOME/vcsh/config" ] && . "$XDG_CONFIG_HOME/vcsh/config"
if [ -n "$VCSH_OPTION_CONFIG" ]; then
# Source $VCSH_OPTION_CONFIG if it can be read and is in $PWD of $PATH
if [ -r "$VCSH_OPTION_CONFIG" ]; then
source_all "$VCSH_OPTION_CONFIG"
else
fatal "Can not read configuration file '$VCSH_OPTION_CONFIG'" 1
fi
fi
[ -n "$VCSH_DEBUG" ] && set -vx [ -n "$VCSH_DEBUG" ] && set -vx
# Read defaults
[ -z "$VCSH_REPO_D" ] && VCSH_REPO_D="$XDG_CONFIG_HOME/vcsh/repo.d" [ -z "$VCSH_REPO_D" ] && VCSH_REPO_D="$XDG_CONFIG_HOME/vcsh/repo.d"
[ -z "$VCSH_HOOK_D" ] && VCSH_HOOK_D="$XDG_CONFIG_HOME/vcsh/hooks-enabled" [ -z "$VCSH_HOOK_D" ] && VCSH_HOOK_D="$XDG_CONFIG_HOME/vcsh/hooks-enabled"
[ -z "$VCSH_BASE" ] && VCSH_BASE="$HOME" [ -z "$VCSH_BASE" ] && VCSH_BASE="$HOME"
[ -z "$VCSH_GITIGNORE" ] && VCSH_GITIGNORE='exact' [ -z "$VCSH_GITIGNORE" ] && VCSH_GITIGNORE='exact'
SELF=$(basename $0)
help() { help() {
echo "usage: $SELF <args> echo "usage: $SELF <options> <command>
options:
-c <file> Source file
-d Enable debug mode
-v Enable verbose mode
commands:
clone <remote> \\ clone <remote> \\
[<repo>] Clone from an existing repository [<repo>] Clone from an existing repository
delete <repo> Delete an existing repository
enter <repo> Enter repository; spawn new instance of \$SHELL
help Display this help text help Display this help text
delete Delete an existing repository
enter Enter repository; spawn new instance of \$SHELL
init <repo> Initialize a new repository init <repo> Initialize a new repository
list List all repositories list List all repositories
list-tracked List all files tracked by vcsh list-tracked List all files tracked by vcsh
...@@ -34,7 +90,8 @@ help() { ...@@ -34,7 +90,8 @@ help() {
<newname> Rename repository <newname> Rename repository
run <repo> \\ run <repo> \\
<command> Use this repository <command> Use this repository
setup Set up repository with recommended settings setup <repo> Set up repository with recommended settings
version Print version information
which <substring> Find substring in name of any tracked file which <substring> Find substring in name of any tracked file
write-gitignore \\ write-gitignore \\
<repo> Write .gitignore.d/<repo> via git ls-files <repo> Write .gitignore.d/<repo> via git ls-files
...@@ -51,11 +108,6 @@ verbose() { ...@@ -51,11 +108,6 @@ verbose() {
if [ -n "$VCSH_DEBUG" ] || [ -n "$VCSH_VERBOSE" ]; then echo "$SELF: verbose: $@"; fi if [ -n "$VCSH_DEBUG" ] || [ -n "$VCSH_VERBOSE" ]; then echo "$SELF: verbose: $@"; fi
} }
fatal() {
echo "$SELF: fatal: $1" >&2
exit $2
}
error() { error() {
echo "$SELF: error: $1" >&2 echo "$SELF: error: $1" >&2
} }
...@@ -88,7 +140,7 @@ clone() { ...@@ -88,7 +140,7 @@ clone() {
delete() { delete() {
cd "$VCSH_BASE" || fatal "could not enter '$VCSH_BASE'" 11 cd "$VCSH_BASE" || fatal "could not enter '$VCSH_BASE'" 11
use use
info "This operation WILL DETROY DATA!" info "This operation WILL DESTROY DATA!"
files=$(git ls-files) files=$(git ls-files)
echo "These files will be deleted: echo "These files will be deleted:
...@@ -101,7 +153,7 @@ To continue, type 'Yes, do as I say'" ...@@ -101,7 +153,7 @@ To continue, type 'Yes, do as I say'"
for file in $files; do for file in $files; do
rm -f $file || info "could not delete '$file', continuing with deletion" rm -f $file || info "could not delete '$file', continuing with deletion"
done done
rm -r "$GIT_DIR" || error "could not delete '$GIT_DIR'" rm -rf "$GIT_DIR" || error "could not delete '$GIT_DIR'"
} }
enter() { enter() {
...@@ -133,8 +185,8 @@ init() { ...@@ -133,8 +185,8 @@ init() {
} }
list() { list() {
for i in "$VCSH_REPO_D"/*.git; do for repo in "$VCSH_REPO_D"/*.git; do
echo $(basename "$i" .git) [ -d "$repo" ] && [ -r "$repo" ] && echo $(basename "$repo" .git)
done done
} }
...@@ -164,7 +216,7 @@ rename() { ...@@ -164,7 +216,7 @@ rename() {
run() { run() {
hook pre-run hook pre-run
use use
$VCSH_EXTERNAL_COMMAND "$@"
hook post-run hook post-run
} }
...@@ -234,6 +286,9 @@ if [ "$1" = 'clone' ]; then ...@@ -234,6 +286,9 @@ if [ "$1" = 'clone' ]; then
[ -n "$3" ] && VCSH_REPO_NAME="$3" || VCSH_REPO_NAME=$(basename "$GIT_REMOTE" .git) [ -n "$3" ] && VCSH_REPO_NAME="$3" || VCSH_REPO_NAME=$(basename "$GIT_REMOTE" .git)
export VCSH_REPO_NAME export VCSH_REPO_NAME
export GIT_DIR="$VCSH_REPO_D/$VCSH_REPO_NAME.git" export GIT_DIR="$VCSH_REPO_D/$VCSH_REPO_NAME.git"
elif [ "$1" = 'version' ]; then
echo "$SELF $VERSION"
exit
elif [ "$1" = 'which' ]; then elif [ "$1" = 'which' ]; then
[ -z "$2" ] && fatal "$1: please specify a filename" 1 [ -z "$2" ] && fatal "$1: please specify a filename" 1
[ -n "$3" ] && fatal "$1: too many parameters" 1 [ -n "$3" ] && fatal "$1: too many parameters" 1
...@@ -254,7 +309,7 @@ elif [ "$1" = 'delete' ] || ...@@ -254,7 +309,7 @@ elif [ "$1" = 'delete' ] ||
export VCSH_REPO_NAME="$2" export VCSH_REPO_NAME="$2"
export GIT_DIR="$VCSH_REPO_D/$VCSH_REPO_NAME.git" export GIT_DIR="$VCSH_REPO_D/$VCSH_REPO_NAME.git"
[ "$VCSH_COMMAND" = 'rename' ] && export GIT_DIR_NEW="$VCSH_REPO_D/$3.git" [ "$VCSH_COMMAND" = 'rename' ] && export GIT_DIR_NEW="$VCSH_REPO_D/$3.git"
[ "$VCSH_COMMAND" = 'run' ] && shift 2 && export VCSH_EXTERNAL_COMMAND="$*" [ "$VCSH_COMMAND" = 'run' ] && shift 2
[ "$VCSH_COMMAND" = 'write-gitignore' ] [ "$VCSH_COMMAND" = 'write-gitignore' ]
elif [ "$1" = 'list' ] || elif [ "$1" = 'list' ] ||
[ "$1" = 'list-tracked' ]; then [ "$1" = 'list-tracked' ]; then
...@@ -265,7 +320,7 @@ elif [ -n "$2" ]; then ...@@ -265,7 +320,7 @@ elif [ -n "$2" ]; then
export GIT_DIR="$VCSH_REPO_D/$VCSH_REPO_NAME.git" export GIT_DIR="$VCSH_REPO_D/$VCSH_REPO_NAME.git"
[ -d $GIT_DIR ] || { help; exit 1; } [ -d $GIT_DIR ] || { help; exit 1; }
shift 1 shift 1
export VCSH_EXTERNAL_COMMAND="git $*" set -- "git" "$@"
elif [ -n "$1" ]; then elif [ -n "$1" ]; then
export VCSH_COMMAND='enter' export VCSH_COMMAND='enter'
export VCSH_REPO_NAME="$1" export VCSH_REPO_NAME="$1"
...@@ -299,6 +354,6 @@ done ...@@ -299,6 +354,6 @@ done
verbose "$VCSH_COMMAND begin" verbose "$VCSH_COMMAND begin"
export VCSH_COMMAND=$(echo $VCSH_COMMAND | sed 's/-/_/g') export VCSH_COMMAND=$(echo $VCSH_COMMAND | sed 's/-/_/g')
hook pre-command hook pre-command
$VCSH_COMMAND $VCSH_COMMAND "$@"
hook post-command hook post-command
verbose "$VCSH_COMMAND end, exiting" verbose "$VCSH_COMMAND end, exiting"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment