Skip to main content
Sign in
Snippets Groups Projects
Commit 58951134 authored by Richard Hartmann's avatar Richard Hartmann
Browse files

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

Package v1.20130724-1

Conflicts:
	debian/changelog
parents 7151feb5 057d4d3f
No related branches found
Tags
No related merge requests found
Richard Hartmann <richih.mailinglist@gmail.com> <richih+github.com@richih.org> Richard Hartmann <richih.mailinglist@gmail.com> <richih+github.com@richih.org>
Alexander Skurikhin <a.skurihin@gmail.com> <a.skurihin@gmail.com>
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>
Thomas Ferris Nicolaisen <tfnico@gmail.com>
martin f. krafft <madduck@madduck.net> martin f. krafft <madduck@madduck.net>
Alessandro Ghedini <alessandro@ghedini.me>
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> 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>
Alexander Skurikhin <a.skurihin@gmail.com>
Jonathan Sternberg <jonathansternberg@gmail.com> Jonathan Sternberg <jonathansternberg@gmail.com>
Frank Terbeck <ft@bewatermyfriend.org> Frank Terbeck <ft@bewatermyfriend.org>
...@@ -56,8 +56,9 @@ Let's say you want to version control your `vim` configuration: ...@@ -56,8 +56,9 @@ Let's say you want to version control your `vim` configuration:
vcsh vim commit -m 'Initial commit of my Vim configuration' vcsh vim commit -m 'Initial commit of my Vim configuration'
# optionally push your files to a remote # optionally push your files to a remote
vcsh vim remote add origin <remote> vcsh vim remote add origin <remote>
vcsh vim push origin master:master vcsh vim push -u origin master
vcsh vim branch --track master origin/master # from now on you can push additional commits like this
vcsh vim push
If all that looks a _lot_ like standard `git`, that's no coincidence; it's If all that looks a _lot_ like standard `git`, that's no coincidence; it's
a design feature. a design feature.
...@@ -365,7 +366,7 @@ ignore this fact for now and follow the examples. ...@@ -365,7 +366,7 @@ ignore this fact for now and follow the examples.
## Initialize a new repository "vim" ## Initialize a new repository "vim"
vcsh init vcsh vcsh init vim
## Clone an existing repository ## Clone an existing repository
... ...
......
...@@ -43,6 +43,14 @@ function _vcsh-list-tracked-by () { ...@@ -43,6 +43,14 @@ function _vcsh-list-tracked-by () {
(( CURRENT == 2 )) && __vcsh_repositories (( CURRENT == 2 )) && __vcsh_repositories
} }
function _vcsh-pull () {
_nothing
}
function _vcsh-push () {
_nothing
}
function _vcsh-rename () { function _vcsh-rename () {
(( CURRENT == 2 )) && __vcsh_repositories (( CURRENT == 2 )) && __vcsh_repositories
(( CURRENT == 3 )) && _message "new repository name" (( CURRENT == 3 )) && _message "new repository name"
...@@ -88,6 +96,7 @@ function _vcsh () { ...@@ -88,6 +96,7 @@ function _vcsh () {
"list:list all local vcsh repositories" "list:list all local vcsh repositories"
"list-tracked:list all files tracked by vcsh" "list-tracked:list all files tracked by vcsh"
"list-tracked-by:list files tracked by a repository" "list-tracked-by:list files tracked by a repository"
"pull:pull from all vcsh remotes"
"rename:rename a repository" "rename:rename a repository"
"run:run command with <\$GIT_DIR> and <\$GIT_WORK_TREE> set" "run:run command with <\$GIT_DIR> and <\$GIT_WORK_TREE> set"
"upgrade:upgrade repository to currently recommended settings" "upgrade:upgrade repository to currently recommended settings"
...@@ -114,8 +123,7 @@ function _vcsh () { ...@@ -114,8 +123,7 @@ function _vcsh () {
if ! (( ${+functions[_vcsh-$vcshcommand]} )); then if ! (( ${+functions[_vcsh-$vcshcommand]} )); then
# There is no handler function, so this is probably the name # There is no handler function, so this is probably the name
# of a repository. Act accordingly. # of a repository. Act accordingly.
_message "git sub-command" _dispatch git git
#TODO and now we need to complete on git subcommands
else else
curcontext="${curcontext%:*:*}:vcsh-${vcshcommand}:" curcontext="${curcontext%:*:*}:vcsh-${vcshcommand}:"
_call_function ret _vcsh-${vcshcommand} _call_function ret _vcsh-${vcshcommand}
... ...
......
2013-07-24 Richard Hartmann <richih.mailinglist@gmail.com>
* Release 1.20130724
* Add support for `vcsh status`
* Improve output of `vcsh pull`
* Improve output of `vcsh push`
* Minor documentation improvements
2013-07-23 Richard Hartmann <richih.mailinglist@gmail.com>
* Release 1.20130723
* Support $VCSH_GITIGNORE == none
* Documentation improvements,
* Improved zsh completion
* Add support for `vcsh pull`
* Add support for `vcsh push`
* Add retire() to tear down vcsh ENV
* Add clone hooks, including one witout vcsh ENV to
allow subsequent cloning of other repos
* Fix `vcsh rename`
* Improve general code robustness
2013-06-14 Richard Hartmann <richih.mailinglist@gmail.com> 2013-06-14 Richard Hartmann <richih.mailinglist@gmail.com>
* Release 1.20130614 * Release 1.20130614
... ...
......
...@@ -4,6 +4,32 @@ vcsh (1.20130614-1~bpo60+1) squeeze-backports-sloppy; urgency=low ...@@ -4,6 +4,32 @@ vcsh (1.20130614-1~bpo60+1) squeeze-backports-sloppy; urgency=low
-- Richard Hartmann <richih.mailinglist@gmail.com> Fri, 26 Jul 2013 22:33:02 +0200 -- Richard Hartmann <richih.mailinglist@gmail.com> Fri, 26 Jul 2013 22:33:02 +0200
vcsh (1.20130724-1) unstable; urgency=low
* New upstream release
+ Add support for `vcsh status`
+ Improve output of `vcsh pull`
+ Improve output of `vcsh push`
+ Minor documentation improvements
-- Richard Hartmann <richih.mailinglist@gmail.com> Wed, 24 Jul 2013 22:19:50 +0200
vcsh (1.20130723-1) unstable; urgency=low
* New upstream release
+ Support $VCSH_GITIGNORE == none
+ Documentation improvements,
+ Improved zsh completion
+ Add support for `vcsh pull`
+ Add support for `vcsh push`
+ Add retire() to tear down vcsh ENV
+ Add clone hooks, including one witout vcsh ENV to
allow subsequent cloning of other repos
+ Fix `vcsh rename`
+ Improve general code robustness
-- Richard Hartmann <richih.mailinglist@gmail.com> Tue, 23 Jul 2013 21:35:34 +0200
vcsh (1.20130614-1) unstable; urgency=low vcsh (1.20130614-1) unstable; urgency=low
* New upstream release * New upstream release
... ...
......
...@@ -2,15 +2,15 @@ Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ ...@@ -2,15 +2,15 @@ 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
Copyright: 2011-2012 Richard Hartmann Copyright: 2011-2013 Richard Hartmann
License: GPL-2+ License: GPL-2+
Files: * Files: *
Copyright: 2011-2012 Richard Hartmann <richih.mailinglist@gmail.com> Copyright: 2011-2013 Richard Hartmann <richih.mailinglist@gmail.com>
License: GPL-2+ License: GPL-2+
Files: debian/* Files: debian/*
Copyright: 2011-2012 Richard Hartmann <richih.mailinglist@gmail.com> Copyright: 2011-2013 Richard Hartmann <richih.mailinglist@gmail.com>
License: GPL-2+ License: GPL-2+
License: GPL-2+ License: GPL-2+
... ...
......
Available hooks are: Available hooks are:
pre-command
post-command * pre-clone
pre-enter * post-clone
post-enter * post-clone-retired
pre-run Use this if you need to operate on different git repositories after cloning.
post-run This hook can be useful if your configuration needs some remote
pre-upgrade repositories, but you do not want to include it into your vcsh
post-upgrade repository. For instance, if you use vim plugins manager (vundle,
NeoBundle), zsh configuration frameworks (oh-my-zsh, prezto), etc.
* pre-command
* post-command
* pre-enter
* post-enter
* pre-pull
* post-pull
* pre-push
* post-push
* pre-run
* post-run
* pre-upgrade
* post-upgrade
If you write any interesting or useful hooks, please send them upstream
so they can be included in an examples section.
...@@ -21,10 +21,16 @@ vcsh(1) - Version Control System for $HOME - multiple Git repositories in $HOME ...@@ -21,10 +21,16 @@ vcsh(1) - Version Control System for $HOME - multiple Git repositories in $HOME
`vcsh` list-tracked-by <repo> `vcsh` list-tracked-by <repo>
`vcsh` pull
`vcsh` push
`vcsh` rename <repo> <newname> `vcsh` rename <repo> <newname>
`vcsh` run <repo> <shell command> `vcsh` run <repo> <shell command>
`vcsh` status
`vcsh` upgrade <repo> `vcsh` upgrade <repo>
`vcsh` version `vcsh` version
...@@ -77,6 +83,9 @@ an interactive user. ...@@ -77,6 +83,9 @@ an interactive user.
* clone: * clone:
Clone an existing repository. Clone an existing repository.
If you need to clone a bundle of repositories, look into the
`post-clone-retired` hook.
* delete: * delete:
Delete an existing repository. Delete an existing repository.
...@@ -98,6 +107,12 @@ an interactive user. ...@@ -98,6 +107,12 @@ an interactive user.
* list-tracked-by: * list-tracked-by:
List files tracked by a repository. List files tracked by a repository.
* pull:
Pull from all vcsh remotes.
* push:
Push to all vcsh remotes.
* rename: * rename:
Rename a repository. Rename a repository.
...@@ -112,6 +127,9 @@ an interactive user. ...@@ -112,6 +127,9 @@ 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.
* status:
Show statuses of all vcsh repositories.
* upgrade: * upgrade:
Upgrade repository to currently recommended settings. Upgrade repository to currently recommended settings.
...@@ -151,11 +169,13 @@ executed in the context of your shell. ...@@ -151,11 +169,13 @@ executed in the context of your shell.
Interesting knobs you can turn: Interesting knobs you can turn:
* <$VCSH_GITIGNORE>: * <$VCSH_GITIGNORE>:
Can be either <exact> or <recursive>. Can be <exact>, <none>, or <recursive>.
<exact> will seed the repo-specific <.gitignore> with all file and directory <exact> will seed the repo-specific ignore file with all file and directory
names which `git ls-files` returns. names which `git ls-files` returns.
<none> will not write any ignore file.
<recursive> will descend through all directories recursively additionally to <recursive> will descend through all directories recursively additionally to
the above. the above.
...@@ -259,7 +279,7 @@ This manpage and `vcsh` itself were written by Richard "RichiH" Hartmann. ...@@ -259,7 +279,7 @@ This manpage and `vcsh` itself were written by Richard "RichiH" Hartmann.
## COPYRIGHT ## COPYRIGHT
Copyright 2011-2012 Richard Hartmann <richih.mailinglist@gmail.com> Copyright 2011-2013 Richard Hartmann <richih.mailinglist@gmail.com>
Licensed under the GNU GPL version 2 or higher. Licensed under the GNU GPL version 2 or higher.
... ...
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
# 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 compatibility's 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, # 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.
...@@ -24,7 +24,7 @@ basename() { ...@@ -24,7 +24,7 @@ basename() {
} }
SELF=$(basename $0) SELF=$(basename $0)
VERSION='1.20130614' VERSION='1.20130724'
fatal() { fatal() {
echo "$SELF: fatal: $1" >&2 echo "$SELF: fatal: $1" >&2
...@@ -100,10 +100,13 @@ help() { ...@@ -100,10 +100,13 @@ help() {
list-tracked List all files tracked by vcsh list-tracked List all files tracked by vcsh
list-tracked-by \\ list-tracked-by \\
<repo> List files tracked by a repository <repo> List files tracked by a repository
pull Pull from all vcsh remotes
push Push to vcsh remotes
rename <repo> \\ rename <repo> \\
<newname> Rename repository <newname> Rename repository
run <repo> \\ run <repo> \\
<command> Use this repository <command> Use this repository
status Show statuses of all vcsh repositories
upgrade <repo> Upgrade repository to currently 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
...@@ -131,6 +134,7 @@ info() { ...@@ -131,6 +134,7 @@ info() {
} }
clone() { clone() {
hook pre-clone
init init
git remote add origin "$GIT_REMOTE" git remote add origin "$GIT_REMOTE"
git config branch.master.remote origin git config branch.master.remote origin
...@@ -149,6 +153,9 @@ clone() { ...@@ -149,6 +153,9 @@ clone() {
fatal "will stop after fetching and not try to merge! fatal "will stop after fetching and not try to merge!
Once this situation has been resolved, run 'vcsh run $VCSH_REPO_NAME git pull' to finish cloning.\n" 17 Once this situation has been resolved, run 'vcsh run $VCSH_REPO_NAME git pull' to finish cloning.\n" 17
git merge origin/master git merge origin/master
hook post-clone
retire
hook post-clone-retired
} }
delete() { delete() {
...@@ -220,11 +227,46 @@ list_tracked_by() { ...@@ -220,11 +227,46 @@ list_tracked_by() {
git ls-files | sort -u git ls-files | sort -u
} }
pull() {
hook pre-pull
for VCSH_REPO_NAME in $(list); do
echo -n "$VCSH_REPO_NAME: "
export GIT_DIR="$VCSH_REPO_D/$VCSH_REPO_NAME.git"
use
git pull
echo
done
hook post-pull
}
push() {
hook pre-push
for VCSH_REPO_NAME in $(list); do
echo -n "$VCSH_REPO_NAME: "
export GIT_DIR="$VCSH_REPO_D/$VCSH_REPO_NAME.git"
use
git push
echo
done
hook post-push
}
retire() {
unset GIT_WORK_TREE
unset VCSH_DIRECTORY
}
rename() { rename() {
git_dir_exists git_dir_exists
[ -d "$GIT_DIR_NEW" ] && fatal "'$GIT_DIR_NEW' exists" 54 [ -d "$GIT_DIR_NEW" ] && fatal "'$GIT_DIR_NEW' exists" 54
mv -f "$GIT_DIR" "$GIT_DIR_NEW" || fatal "Could not mv '$GIT_DIR' '$GIT_DIR_NEW'" 52 mv -f "$GIT_DIR" "$GIT_DIR_NEW" || fatal "Could not mv '$GIT_DIR' '$GIT_DIR_NEW'" 52
# Now that the repository has been renamed, we need to fix up its configuration
# Overwrite old name..
GIT_DIR="$GIT_DIR_NEW"
$VCSH_REPO_NAME="$VCSH_REPO_NAME_NEW"
# ..and clobber all old configuration
upgrade
} }
run() { run() {
...@@ -234,11 +276,21 @@ run() { ...@@ -234,11 +276,21 @@ run() {
hook post-run hook post-run
} }
status() {
for VCSH_REPO_NAME in $(list); do
echo "$VCSH_REPO_NAME:"
export GIT_DIR="$VCSH_REPO_D/$VCSH_REPO_NAME.git"
use
git status --short --untracked-files='no'
echo
done
}
upgrade() { upgrade() {
hook pre-upgrade 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" [ ! "x$VCSH_GITIGNORE" = 'xnone' ] && 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-upgrade hook post-upgrade
...@@ -259,6 +311,12 @@ which() { ...@@ -259,6 +311,12 @@ which() {
} }
write_gitignore() { write_gitignore() {
# Don't do anything if the user does not want to write gitignore
if [ "x$VCSH_GITIGNORE" = 'xnone' ]; then
info "Not writing gitignore as '\$VCSH_GITIGNORE' is set to 'none'"
exit
fi
use use
cd "$VCSH_BASE" || fatal "could not enter '$VCSH_BASE'" 11 cd "$VCSH_BASE" || fatal "could not enter '$VCSH_BASE'" 11
gitignores=$(for file in $(git ls-files); do gitignores=$(for file in $(git ls-files); do
...@@ -272,7 +330,7 @@ write_gitignore() { ...@@ -272,7 +330,7 @@ write_gitignore() {
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" = 'xrecursive' ] && [ -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
...@@ -289,8 +347,8 @@ write_gitignore() { ...@@ -289,8 +347,8 @@ write_gitignore() {
fatal "could not move '$tempfile' to '$VCSH_BASE/.gitignore.d/$VCSH_REPO_NAME'" 53 fatal "could not move '$tempfile' to '$VCSH_BASE/.gitignore.d/$VCSH_REPO_NAME'" 53
} }
if [ ! "x$VCSH_GITIGNORE" = 'xexact' ] && [ ! "x$VCSH_GITIGNORE" = 'xrecursive' ]; then if [ ! "x$VCSH_GITIGNORE" = 'xexact' ] && [ ! "x$VCSH_GITIGNORE" = 'xnone' ] && [ ! "x$VCSH_GITIGNORE" = 'xrecursive' ]; then
fatal "'\$VCSH_GITIGNORE' must be either 'exact' or 'recursive'" 1 fatal "'\$VCSH_GITIGNORE' must equal 'exact', 'none', or 'recursive'" 1
fi fi
if [ "$1" = 'clone' ]; then if [ "$1" = 'clone' ]; then
...@@ -322,11 +380,14 @@ elif [ "$1" = 'delete' ] || ...@@ -322,11 +380,14 @@ elif [ "$1" = 'delete' ] ||
export VCSH_COMMAND="$1" export VCSH_COMMAND="$1"
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 VCSH_REPO_NAME_NEW="$3";
export GIT_DIR_NEW="$VCSH_REPO_D/$VCSH_REPO_NAME_NEW.git"; }
[ "$VCSH_COMMAND" = 'run' ] && shift 2 [ "$VCSH_COMMAND" = 'run' ] && shift 2
[ "$VCSH_COMMAND" = 'write-gitignore' ]
elif [ "$1" = 'list' ] || elif [ "$1" = 'list' ] ||
[ "$1" = 'list-tracked' ]; then [ "$1" = 'list-tracked' ] ||
[ "$1" = 'pull' ] ||
[ "$1" = 'push' ] ||
[ "$1" = 'status' ]; then
export VCSH_COMMAND="$1" export VCSH_COMMAND="$1"
elif [ -n "$2" ]; then elif [ -n "$2" ]; then
export VCSH_COMMAND='run' export VCSH_COMMAND='run'
...@@ -352,9 +413,8 @@ if echo $VCSH_REPO_NAME | grep -q '/'; then ...@@ -352,9 +413,8 @@ if echo $VCSH_REPO_NAME | grep -q '/'; then
export VCSH_REPO_NAME=$(basename "$VCSH_REPO_NAME" .git) export VCSH_REPO_NAME=$(basename "$VCSH_REPO_NAME" .git)
fi fi
check_dir() {
for check_directory in "$VCSH_REPO_D" "$VCSH_BASE/.gitignore.d" check_directory="$1"
do
if [ ! -d "$check_directory" ]; then if [ ! -d "$check_directory" ]; then
if [ -e "$check_directory" ]; then if [ -e "$check_directory" ]; then
fatal "'$check_directory' exists but is not a directory" 13 fatal "'$check_directory' exists but is not a directory" 13
...@@ -363,7 +423,10 @@ do ...@@ -363,7 +423,10 @@ do
mkdir -p "$check_directory" || fatal "could not create '$check_directory'" 50 mkdir -p "$check_directory" || fatal "could not create '$check_directory'" 50
fi fi
fi fi
done }
check_dir "$VCSH_REPO_D"
[ ! "x$VCSH_GITIGNORE" = 'xnone' ] && check_dir "$VCSH_BASE/.gitignore.d"
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')
... ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment