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

Merge tag 'v1.3-1' into debian-squeeze-sloppy

Debian package 1.3-1

Conflicts:
	debian/changelog
parents 02d09e18 a5e82906
No related branches found
Tags
No related merge requests found
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>
martin f. krafft <madduck@madduck.net>
Valentin Haenel <valentin.haenel@gmx.de> Valentin Haenel <valentin.haenel@gmx.de>
Richard Hartmann <richih.mailinglist@gmail.com> Richard Hartmann <richih.mailinglist@gmail.com>
mek-apelsin <mek@pels.in>
Dieter Plaetinck <dieter@plaetinck.be> Dieter Plaetinck <dieter@plaetinck.be>
Corey Quinn <corey@sequestered.net> Corey Quinn <corey@sequestered.net>
Gernot Schulz <post@gernot-schulz.com> Gernot Schulz <post@gernot-schulz.com>
Jonathan Sternberg <jonathansternberg@gmail.com>
Frank Terbeck <ft@bewatermyfriend.org>
# Pre-requisites # # Pre-requisites #
If you want to build the manpage, you will need ronn. Newer versions of Debian come with a package: If you want to build the manpage, you will need [ronn] [1].
Debian 7.0 and above come with a package, so do most Debian clones.
To install ronn on your Debian-based system, simply run
apt-get install ruby-ronn apt-get install ruby-ronn
There are no other dependencies other than `git`, `ronn` and a POSIX shell.
# Installing # # Installing #
...@@ -14,13 +19,15 @@ If you want to build the manpage, you will need ronn. Newer versions of Debian c ...@@ -14,13 +19,15 @@ If you want to build the manpage, you will need ronn. Newer versions of Debian c
sudo make uninstall sudo make uninstall
There is another, more thorough, version. Just make sure you are not running this when you have installed to an important directory which is empty, otherwise. There is another, more thorough, version. Just make sure you are not running
this when you have installed to an important directory which is empty,
otherwise.
**THIS WILL DELETE /usr/local IF YOU INSTALLED THERE AND IT'S EMPTY, OTHERWISE** **THIS WILL DELETE /usr/local IF YOU INSTALLED THERE AND IT BECOMES EMPTY**
sudo make purge sudo make purge
**THIS WILL DELETE /usr/local IF YOU INSTALLED THERE AND IT'S EMPTY, OTHERWISE** **THIS WILL DELETE /usr/local IF YOU INSTALLED THERE AND IT BECOMES EMPTY**
This is not in the default behaviour of `make uninstall` for obvious reasons. This is not in the default behaviour of `make uninstall` for obvious reasons.
...@@ -34,3 +41,5 @@ To clean up the generated manpage, run ...@@ -34,3 +41,5 @@ To clean up the generated manpage, run
and if you are bored, I suggest and if you are bored, I suggest
make moo make moo
[1]: http://rtomayko.github.io/ronn/
...@@ -11,15 +11,27 @@ the upstream repository ...@@ -11,15 +11,27 @@ the upstream repository
Ubuntu imports Debian's package automagically. Ubuntu imports Debian's package automagically.
# Mac OS X # Mac OS X
Homebrew does not require any packaging information within this repository. Homebrew does not require any packaging information within this repository.
A separate branch with a statically compiled manpage and release tags is A separate branch with a statically compiled manpage and release tags is
provided to ease packaging. The static manpage because Homebrew lacks Ronn; provided to ease packaging. The static manpage because Homebrew lacks ronn;
the tag so github generates tarballs Homebrew can be pointed at. the tag so github generates tarballs Homebrew can be pointed at.
# Anything else
# Additional notes
## Static manpage
In case you can not build the manpage because you are missing ronn please
contact the author. The "debian-squeeze" branch carries a quilt patchset with
a pre-compiled manpage and the "homebrew" one carries a static manpage. If you
need, or want, to build your packages against a static version in your own
branch this can be done.
## Other systems
If you are maintaining a package for a different distribution, please get 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 in touch so your work can be included in another branch, thus allowing others
to adapt it to their needs or to improve it. to adapt it to their needs or to improve upon it.
...@@ -15,55 +15,64 @@ community around the general idea of version controlling your (digital) life. ...@@ -15,55 +15,64 @@ community around the general idea of version controlling your (digital) life.
* IRC: #vcs-home on irc.oftc.net * IRC: #vcs-home on irc.oftc.net
* Mailing list: http://lists.madduck.net/listinfo/vcs-home * Mailing list: [http://lists.madduck.net/listinfo/vcs-home][vcs-home-list]
* Pull requests or issues on https://github.com/RichiH/vcsh * Pull requests or issues on [https://github.com/RichiH/vcsh][vcsh]
# 2 Introduction # # 2 Introduction #
vcsh allows you to have several git repositories, all maintaining their working [vcsh][vcsh] allows you to maintain several git repositories in one single
trees in $HOME without clobbering each other. That, in turn, means you can have directory. They all maintain their working trees without clobbering each other
one repository per config set (zsh, vim, ssh, etc), picking and choosing which or interfering otherwise. By default, all git repositories maintained via
configs you want to use on which machine. `vcsh` are stored in <$HOME> but you can override this setting if you want to.
All that means that you can have one repository per application or application
vcsh was designed with [mr] [1] in mind so you might want to install that, as family, i.e. `zsh`, `vim`, `ssh`, etc. This, in turn, allows you to clone
custom sets of configurations onto different machines or even for different
users; picking and mixing which configurations you want to use where.
For example, you may not need to have your `mplayer` configuration on a server
or available to root and you may want to maintain different configuration for
`ssh` on your personal and your work machines.
`vcsh` was designed with [mr][mr] in mind so you might want to install that, as
well. well.
Read INSTALL.md for detailed setup instructions. Read <INSTALL.md> and <PACKAGING.md> for instructions specific to your operating
system.
The following overview will try to give you an idea of the use cases and 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 ## ## 2.1 Talks ##
Some people found it useful to look at slides and videos explaining how vcsh works. Some people found it useful to look at slides and videos explaining how `vcsh`
They can all be found at [here](http://richardhartmann.de/talks/). works.
They can all be found [on the author's talk page][talks].
# 3 Overview # 3 Overview
## 3.1 Comparison to Other Solutions ## ## 3.1 Comparison to Other Solutions ##
Most people who decide to put their dotfiles under version control start with a Most people who decide to put their dotfiles under version control start with a
**single repository in $HOME**, adding all their dotfiles (and possibly more) single repository in <$HOME>, adding all their dotfiles (and possibly more)
to it. This works, of course, but can become a nuisance as soon as you try to to it. This works, of course, but can become a nuisance as soon as you try to
manage more than one host. manage more than one host.
The next logical step is to create single-purpose repositories in, for example, The next logical step is to create single-purpose repositories in, for example,
~/.dotfiles and to create **symbolic links in $HOME**. This gives you the <~/.dotfiles> and to create symbolic links into <$HOME>. This gives you the
flexibility to check out only certain repositories on different hosts. The flexibility to check out only certain repositories on different hosts. The
downsides of this approach are the necessary manual steps of cloning and downsides of this approach are the necessary manual steps of cloning and
symlinking the individual repositories. It will probably become a nuisance when symlinking the individual repositories.
you try to manage more than two hosts.
**vcsh** takes this second approach one step further. It expects `vcsh` takes this second approach one step further. It expects
**single-purpose repositories** and stores them in a hidden directory (similar single-purpose repositories and stores them in a hidden directory (similar
to ~/.dotfiles). However, it does not create symbolic links in $HOME; it puts to <~/.dotfiles>). However, it does not create symbolic links in <$HOME>; it
the **actual files right into $HOME**. puts the actual files right into <$HOME>.
Furthermore, by making use of [mr] [1], it makes it very easy to enable/disable Furthermore, by making use of [mr][mr], it makes it very easy to enable/disable
and clone a large number of repositories. The use of mr is technically optional and clone a large number of repositories. The use of `mr` is technically
(see 4.3), but it will be an integral part of the proposed system that follows. optional (see section 4.3), but it will be an integral part of the proposed
system that follows.
## 3.2 Default Directory Layout ## ## 3.2 Default Directory Layout ##
...@@ -373,8 +382,8 @@ manually. Alternatively, you could try something like this: ...@@ -373,8 +382,8 @@ manually. Alternatively, you could try something like this:
vcsh run $repo git pull; vcsh run $repo git pull;
done done
----------
mr can be found at: [http://kitenet.net/~joey/code/mr/][1]
[1]: http://kitenet.net/~joey/code/mr/ (http://kitenet.net/~joey/code/mr/) [mr]: http://kitenet.net/~joey/code/mr/
[talks]: http://richardhartmann.de/talks/
[vcsh]: https://github.com/RichiH/vcsh
[vcs-home-list]: http://lists.madduck.net/listinfo/vcs-home
#compdef vcsh #compdef vcsh
_arguments \ function __vcsh_repositories () {
':subcommand:(( local expl
clone\:"clone from repo" local -a repos
help\:"display help" repos=( ${(f)"$(command vcsh list)"} )
delete\:"delete repo" _describe -t repos 'repositories' repos
enter\:"Enter repo; spawn new \$SHELL" }
init\:"init & clone from repo"
list\:"list all repos" function __vcsh_not_implemented_yet () {
list-tracked\:"list all files tracked by vcsh" _message "Subcommand completion '${1#*-}': not implemented yet"
list-tracked-by\:"list files tracked by a repo" }
rename\:"rename repo"
run\:"run command on repo" function _vcsh-clone () {
setup\:"set up repo with recommended settings" __vcsh_not_implemented_yet "$0" #TODO
write-gitignore\:"write .gitignore.d/foo via git ls-files" }
\<REPO\>\:"Run git command directly"
))' function _vcsh-delete () {
(( CURRENT == 2 )) && __vcsh_repositories
}
function _vcsh-enter () {
(( CURRENT == 2 )) && __vcsh_repositories
}
function _vcsh-help () {
_nothing
}
function _vcsh-init () {
_nothing
}
function _vcsh-list () {
_nothing
}
function _vcsh-list-tracked () {
_nothing
}
function _vcsh-list-tracked-by () {
(( CURRENT == 2 )) && __vcsh_repositories
}
function _vcsh-rename () {
(( CURRENT == 2 )) && __vcsh_repositories
(( CURRENT == 3 )) && _message "new repository name"
(( CURRENT > 3 )) && _nothing
}
function _vcsh-run () {
(( CURRENT == 2 )) && __vcsh_repositories
if (( CURRENT >= 3 )); then
words=( "${(@)words[3,-1]}" )
(( CURRENT -= 2 ))
_complete
fi
}
function _vcsh-upgrade () {
(( CURRENT == 2 )) && __vcsh_repositories
}
function _vcsh-version () {
_nothing
}
function _vcsh-which () {
_files
}
function _vcsh-write-gitignore () {
(( CURRENT == 2 )) && __vcsh_repositories
}
function _vcsh () {
local curcontext="${curcontext}"
local state vcshcommand
local -a args subcommands
subcommands=(
"clone:clone an existing repository"
"delete:delete an existing repository"
"enter:enter repository; spawn new <\$SHELL>"
"help:display help"
"init:initialize an empty repository"
"list:list all local vcsh repositories"
"list-tracked:list all files tracked by vcsh"
"list-tracked-by:list files tracked by a repository"
"rename:rename a repository"
"run:run command with <\$GIT_DIR> and <\$GIT_WORK_TREE> set"
"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"
)
args=(
'-c[source <file> prior to other configuration files]:config files:_path_files'
'-d[enable debug mode]'
'-v[enable verbose mode]'
'*:: :->subcommand_or_options_or_repo'
)
_arguments -C ${args} && return
if [[ ${state} == "subcommand_or_options_or_repo" ]]; then
if (( CURRENT == 1 )); then
_describe -t subcommands 'vcsh sub-commands' subcommands
__vcsh_repositories
else
vcshcommand="${words[1]}"
if ! (( ${+functions[_vcsh-$vcshcommand]} )); then
# There is no handler function, so this is probably the name
# of a repository. Act accordingly.
_message "git sub-command"
#TODO and now we need to complete on git subcommands
else
curcontext="${curcontext%:*:*}:vcsh-${vcshcommand}:"
_call_function ret _vcsh-${vcshcommand}
fi
fi
fi
}
_vcsh "$@"
2013-05-27 Richard Hartmann <richih.mailinglist@gmail.com>
* Release 1.3
* Hide hook execution unless verbose is set
* Ancher ignore file to root of Git repo
* Implemented basename() to save one process spawn
* Improve packaged Zsh completion
* Renamed `vcsh setup` to `vcsh upgrade`
* Various documentation and spelling improvements
2013-04-21 Richard Hartmann <richih.mailinglist@gmail.com> 2013-04-21 Richard Hartmann <richih.mailinglist@gmail.com>
* Release 1.2 * Release 1.2
...@@ -22,7 +32,6 @@ ...@@ -22,7 +32,6 @@
* Make `vcsh list` more resilient * Make `vcsh list` more resilient
* Lots of doc improvements * 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.3-1) unstable; urgency=low
* New upstream release
+ Hide hook execution unless verbose is set
+ Ancher ignore file to root of Git repo
+ Implemented basename() to save one process spawn
+ Improve packaged Zsh completion
+ Renamed `vcsh setup` to `vcsh upgrade`
+ Various documentation and spelling improvements
-- Richard Hartmann <richih.mailinglist@gmail.com> Mon, 27 May 2013 23:40:08 +0200
vcsh (1.2-3~bpo60+3) squeeze-backports-sloppy; urgency=low vcsh (1.2-3~bpo60+3) squeeze-backports-sloppy; urgency=low
* Bump version number due to mistaken upload (see #709517) * Bump version number due to mistaken upload (see #709517)
......
...@@ -3,3 +3,8 @@ upstream-branch = master ...@@ -3,3 +3,8 @@ upstream-branch = master
debian-branch = debian-squeeze-sloppy debian-branch = debian-squeeze-sloppy
upstream-tag = v%(version)s upstream-tag = v%(version)s
debian-tag = debian/%(version)s debian-tag = debian/%(version)s
postbuild = lintian $GBP_CHANGES_FILE
color = on
compression = xz
compression-level = 9
# The Debian package is just a branch in the upstream repo. version=3
# At the moment, I don't see a need for debian/watch. opts=uversionmangle=s/^((?:\d+\.)*\d+-\d+-bpo\d+\+\d+)$/0.0.$1/;s/^(1\.2-homebrew)$/0.0.$1/;s/^((?:\d+\.)*\d+-\d+)$/0.0.$1/ \
# This file exists solely to make lintian happy. https://github.com/RichiH/vcsh/tags \
.*/archive/(?:upstream/)?(?:v||version-|release-|X|R|r)(\d\S*)\.tar\.gz
# Bart Martens <bartm@debian.org> Tue, 07 May 2013 19:38:25 +0000
...@@ -5,5 +5,5 @@ pre-enter ...@@ -5,5 +5,5 @@ pre-enter
post-enter post-enter
pre-run pre-run
post-run post-run
pre-setup pre-upgrade
post-setup post-upgrade
vcsh(1) - manage config files in $HOME via fake bare git repositories vcsh(1) - manage config files in $HOME via fake bare Git repositories
===================================================================== =====================================================================
## SYNOPSIS ## SYNOPSIS
...@@ -25,7 +25,7 @@ vcsh(1) - manage config files in $HOME via fake bare git repositories ...@@ -25,7 +25,7 @@ vcsh(1) - manage config files in $HOME via fake bare git repositories
`vcsh` run <repo> <shell command> `vcsh` run <repo> <shell command>
`vcsh` setup <repo> `vcsh` upgrade <repo>
`vcsh` version `vcsh` version
...@@ -45,7 +45,7 @@ working trees in $HOME without clobbering each other. That, in turn, means you ...@@ -45,7 +45,7 @@ working trees in $HOME without clobbering each other. That, in turn, means you
can have one repository per config set (zsh, vim, ssh, etc), picking and can have one repository per config set (zsh, vim, ssh, etc), picking and
choosing which configs you want to use on which machine. choosing which configs you want to use on which machine.
`vcsh` is using a technique called fake bare git repositories, keeping <$GIT_DIR> `vcsh` is using a technique called fake bare Git repositories, keeping <$GIT_DIR>
in a different directory from <$GIT_WORK_TREE> which is pointed to <$HOME>. in a different directory from <$GIT_WORK_TREE> which is pointed to <$HOME>.
The use of symlinks is not needed in this setup, making for a cleaner setup. The use of symlinks is not needed in this setup, making for a cleaner setup.
...@@ -112,8 +112,8 @@ an interactive user. ...@@ -112,8 +112,8 @@ an interactive user.
This is needed to support mr and other scripts properly and of no concern to This is needed to support mr and other scripts properly and of no concern to
an interactive user. an interactive user.
* setup: * upgrade:
Set up repository with recommended settings. Upgrade repository to currently recommended settings.
* version: * version:
Print version information. Print version information.
...@@ -122,7 +122,7 @@ an interactive user. ...@@ -122,7 +122,7 @@ an interactive user.
Find <substring> in name of any tracked file. Find <substring> in name of any tracked file.
* write-gitignore: * write-gitignore:
Write .gitignore.d/<repo> via git ls-files. Write .gitignore.d/<repo> via `git ls-files`.
* <repo> <gitcommand>: * <repo> <gitcommand>:
Shortcut to run `vcsh` on a repo. Will prepend `git` to <command>. Shortcut to run `vcsh` on a repo. Will prepend `git` to <command>.
...@@ -133,7 +133,7 @@ an interactive user. ...@@ -133,7 +133,7 @@ an interactive user.
## ENVIRONMENT ## ENVIRONMENT
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 ## CONFIG
...@@ -207,7 +207,7 @@ same rules as above apply. The dot between the repository's name and the hook ...@@ -207,7 +207,7 @@ same rules as above apply. The dot between the repository's name and the hook
is mandatory, though. is mandatory, though.
Available hooks are <pre-enter>, <post-enter>, <pre-run>, <post-run>, 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. but please let upstream know so we can ship them by default.
## DETAILED HOWTO AND FURTHER READING ## DETAILED HOWTO AND FURTHER READING
...@@ -246,7 +246,7 @@ resulting in unhappy end users. ...@@ -246,7 +246,7 @@ resulting in unhappy end users.
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
config files, all of which were soft-linked into <$HOME>. config files, all of which were soft-linked into <$HOME>.
Martin F. Krafft aka madduck came up with the concept of fake bare git Martin F. Krafft aka madduck came up with the concept of fake bare Git
repositories. repositories.
vcsh was initally written by madduck. This version is a re-implementation from vcsh was initally written by madduck. This version is a re-implementation from
......
File moved
#!/bin/sh #!/bin/sh
# This program is licensed under the GNU GPL version 2 or later. # This program is licensed under the GNU GPL version 2 or later.
# (c) Richard "RichiH" Hartmann <richih.mailinglist@gmail.com>, 2011-2012 # (c) Richard "RichiH" Hartmann <richih.mailinglist@gmail.com>, 2011-2013
# 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 # While the following is not legally binding, the author would like to
# explain the choice of GPLv2+ over GPLv3+. # explain the choice of GPLv2+ over GPLv3+.
# The author prefers GPLv3+ over GPLv2+ but feels it's better to maintain # 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, # full compatibility's with git. In case git ever changes its licensing terms,
# which is admittedly extremely unlikely to the point of being impossible,
# this software will most likely follow suit. # this software will most likely follow suit.
# This should always be the first line of code to facilitate debugging
[ -n "$VCSH_DEBUG" ] && set -vx
basename() {
# Implemented in shell to avoid spawning another process
local file
file="${1##*/}"
[ -z "$2" ] || file="${file%$2}"
echo "$file"
}
SELF=$(basename $0) SELF=$(basename $0)
VERSION='1.2' VERSION='1.3'
fatal() { fatal() {
echo "$SELF: fatal: $1" >&2 echo "$SELF: fatal: $1" >&2
...@@ -26,8 +38,10 @@ while getopts "c:dv" flag; do ...@@ -26,8 +38,10 @@ while getopts "c:dv" flag; do
if [ "$1" = '-d' ] || [ "$1" = '--debug' ]; then if [ "$1" = '-d' ] || [ "$1" = '--debug' ]; then
set -vx set -vx
VCSH_DEBUG=1 VCSH_DEBUG=1
echo "$SELF $VERSION"
elif [ "$1" = '-v' ];then elif [ "$1" = '-v' ];then
VCSH_VERBOSE=1 VCSH_VERBOSE=1
echo "$SELF $VERSION"
elif [ "$1" = '-c' ];then elif [ "$1" = '-c' ];then
VCSH_OPTION_CONFIG=$OPTARG VCSH_OPTION_CONFIG=$OPTARG
fi fi
...@@ -90,7 +104,7 @@ help() { ...@@ -90,7 +104,7 @@ help() {
<newname> Rename repository <newname> Rename repository
run <repo> \\ run <repo> \\
<command> Use this repository <command> Use this repository
setup <repo> Set up repository with recommended settings upgrade <repo> Upgrade repository to currently recommended settings
version Print version information 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 \\
...@@ -170,7 +184,7 @@ git_dir_exists() { ...@@ -170,7 +184,7 @@ git_dir_exists() {
hook() { hook() {
for hook in $VCSH_HOOK_D/$1* $VCSH_HOOK_D/$VCSH_REPO_NAME.$1*; do for hook in $VCSH_HOOK_D/$1* $VCSH_HOOK_D/$VCSH_REPO_NAME.$1*; do
[ -x "$hook" ] || continue [ -x "$hook" ] || continue
info "executing '$hook'" verbose "executing '$hook'"
"$hook" "$hook"
done done
} }
...@@ -181,7 +195,7 @@ init() { ...@@ -181,7 +195,7 @@ init() {
mkdir -p "$GIT_WORK_TREE" || fatal "could not create '$GIT_WORK_TREE'" 50 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 cd "$GIT_WORK_TREE" || fatal "could not enter '$GIT_WORK_TREE'" 11
git init git init
setup upgrade
} }
list() { list() {
...@@ -220,14 +234,14 @@ run() { ...@@ -220,14 +234,14 @@ run() {
hook post-run hook post-run
} }
setup() { upgrade() {
hook pre-setup hook pre-upgrade
use use
git config core.worktree "$GIT_WORK_TREE" git config core.worktree "$GIT_WORK_TREE"
git config core.excludesfile ".gitignore.d/$VCSH_REPO_NAME" git config core.excludesfile ".gitignore.d/$VCSH_REPO_NAME"
git config vcsh.vcsh 'true' git config vcsh.vcsh 'true'
[ -e "$VCSH_BASE/.gitignore.d/$VCSH_REPO_NAME" ] && git add -f "$VCSH_BASE/.gitignore.d/$VCSH_REPO_NAME" [ -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() { use() {
...@@ -257,9 +271,9 @@ write_gitignore() { ...@@ -257,9 +271,9 @@ write_gitignore() {
tempfile=$(mktemp) || fatal "could not create tempfile" 51 tempfile=$(mktemp) || fatal "could not create tempfile" 51
echo '*' > "$tempfile" || fatal "could not write to '$tempfile'" 57 echo '*' > "$tempfile" || fatal "could not write to '$tempfile'" 57
for gitignore in $gitignores; do for gitignore in $gitignores; do
echo "$gitignore" | sed 's/^/!/' >> "$tempfile" || fatal "could not write to '$tempfile'" 57 echo "$gitignore" | sed 's@^@!/@' >> "$tempfile" || fatal "could not write to '$tempfile'" 57
if [ x$VCSH_GITIGNORE = x'recursive' ] && [ -d "$gitignore" ]; then if [ x$VCSH_GITIGNORE = x'recursive' ] && [ -d "$gitignore" ]; then
{ echo "$gitignore/*" | sed 's/^/!/' >> "$tempfile" || fatal "could not write to '$tempfile'" 57; } { echo "$gitignore/*" | sed 's@^@!/@' >> "$tempfile" || fatal "could not write to '$tempfile'" 57; }
fi fi
done done
if diff -N "$tempfile" "$VCSH_BASE/.gitignore.d/$VCSH_REPO_NAME" > /dev/null; then if diff -N "$tempfile" "$VCSH_BASE/.gitignore.d/$VCSH_REPO_NAME" > /dev/null; then
...@@ -300,7 +314,7 @@ elif [ "$1" = 'delete' ] || ...@@ -300,7 +314,7 @@ elif [ "$1" = 'delete' ] ||
[ "$1" = 'list-tracked-by' ] || [ "$1" = 'list-tracked-by' ] ||
[ "$1" = 'rename' ] || [ "$1" = 'rename' ] ||
[ "$1" = 'run' ] || [ "$1" = 'run' ] ||
[ "$1" = 'setup' ] || [ "$1" = 'upgrade' ] ||
[ "$1" = 'write-gitignore' ]; then [ "$1" = 'write-gitignore' ]; then
[ -z $2 ] && fatal "$1: please specify repository to work on" 1 [ -z $2 ] && fatal "$1: please specify repository to work on" 1
[ "$1" = 'rename' -a -z "$3" ] && fatal "$1: please specify a target name" 1 [ "$1" = 'rename' -a -z "$3" ] && fatal "$1: please specify a target name" 1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment