From: Richard Hartmann Date: Mon, 24 Mar 2014 09:30:00 +0000 (+0100) Subject: Merge branch 'master' of github.com:RichiH/vcsh X-Git-Url: https://git.madduck.net/code/vcsh.git/commitdiff_plain/36e44e04b656b084dbc0a5657041698f24752c4f?hp=4e58175e1b848f2f632b66571586d8bb70e2fa64 Merge branch 'master' of github.com:RichiH/vcsh --- diff --git a/CONTRIBUTORS b/CONTRIBUTORS index cbb144a..f042ac7 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -1,10 +1,12 @@ Alphabetical list of surnames of everyone who ever committed to this repository. Auto-generated from tools/list_CONTRIBUTORS. +Skurikhin Alexander Eric Bouchut Dridi Boukelmoune Rob Cornish Vincent Demeester +Jeff Fein-Worton Thomas Ferris Nicolaisen martin f. krafft Alessandro Ghedini @@ -20,7 +22,9 @@ Evan Pitstick Dieter Plaetinck Corey Quinn Pavlos Ratis +Dewey Sasser Gernot Schulz +Andrew Schwartzmeyer Dato Simó Alexander Skurikhin Jonathan Sternberg diff --git a/README.md b/README.md index 785b36c..0fc717a 100644 --- a/README.md +++ b/README.md @@ -3,15 +3,15 @@ vcsh - Version Control System for $HOME - multiple Git repositories in $HOME # Index -1. [30 second howto](#30-second-howto) +1. [30 Second How-to](#30-second-how-to) 2. [Introduction](#introduction) -3. [Usage Exmaples](#usage-examples) +3. [Usage Examples](#usage-examples) 4. [Overview](#overview) 5. [Getting Started](#getting-started) 6. [Contact](#contact) -# 30 second howto +# 30 Second How-to While it may appear that there's an overwhelming amount of documentation and while the explanation of the concepts behind `vcsh` needs to touch a few gory @@ -121,10 +121,17 @@ myrepos is just another set of files that you cat track with `vcsh` like any other. This makes setting up any new machine a breeze. It can take literally less than five minutes to go from standard installation to fully set up system. -We suggest using [myrepos][myrepos] to manage both `vcsh` and other repositories. The -`mr` utility takes care of pulling in and pushing out new data for a variety of -version control systems. While the use of myrepos is technically optional, it will -be an integral part of the proposed system that follows. +We suggest using [myrepos][myrepos] to manage both `vcsh` and other +repositories. The `mr` utility takes care of pulling in and pushing +out new data for a variety of version control systems. While the use +of myrepos is technically optional, it will be an integral part of the +proposed system that follows. For instance, you can use +[myrepos][myrepos] to track repositories in home such as `.emacs.d`, +which `mr` can clone and update for you automatically. To do this, +just add a `mr` configuration file to `availabile.d` with a `checkout` +command to clone the repo, and set the [title] to the desired +location, e.g. `$HOME/.emacs.d`. Try the `mr register` command in an +existing repository, then view `~/.mrconfig` for an example. ## Default Directory Layout @@ -174,12 +181,15 @@ repository. This is for demonstration, only. Of course, you are more than welcome to clone from this repository and fork your own. [$XDG_CONFIG_HOME/vcsh/repo.d/zsh.git] - checkout = vcsh clone 'git://github.com/RichiH/zshrc.git' zsh + checkout = vcsh clone 'git://github.com/RichiH/zshrc.git' 'zsh' update = vcsh zsh pull push = vcsh zsh push status = vcsh zsh status gc = vcsh zsh gc + [$HOME/.emacs.d] + checkout = vcsh clone 'git://github.com/andschwa/emacs.git' '.emacs.d' + ### config.d $XDG\_CONFIG\_HOME/mr/available.d contains *all available* repositories. Only @@ -248,12 +258,12 @@ Below, you will find a few different methods for setting up vcsh: Make sure none of the following files and directories exist for your test (user). If they do, move them away for now: -* ~/.gitignore.d -* ~/.mrconfig -* $XDG\_CONFIG\_HOME/mr/available.d/mr.vcsh -* $XDG\_CONFIG\_HOME/mr/available.d/zsh.vcsh -* $XDG\_CONFIG\_HOME/mr/config.d/mr.vcsh -* $XDG\_CONFIG\_HOME/vcsh/repo.d/mr.git/ +* `~/.gitignore.d` +* `~/.mrconfig` +* `$XDG\_CONFIG\_HOME/mr/available.d/mr.vcsh` +* `$XDG\_CONFIG\_HOME/mr/available.d/zsh.vcsh` +* `$XDG\_CONFIG\_HOME/mr/config.d/mr.vcsh` +* `$XDG\_CONFIG\_HOME/vcsh/repo.d/mr.git/` All of the files are part of the template repository, the directory is where the template will be stored. @@ -293,7 +303,7 @@ Or you can do it yourself manually using the documentation on installing AUR pac If you prefer to use the devel package that installs the git HEAD version it is available [here](https://aur.archlinux.org/packages/vcsh-git/). -#### Mac OSX +#### Mac OS X Formulas are available for vcsh as well as git and myrepos through [homebrew](http://brew.sh). The vcsh formula is set to depend on myrepos, so you only need one install command: @@ -385,12 +395,10 @@ Grab my myrepos config. see below for details on how I set this up ln -s ../available.d/* . -myrepos is used to actually retrieve configs, etc +[myrepos][myrepos] is used to actually retrieve configs, etc. ~ % cat ~/.mrconfig [DEFAULT] - # adapt /usr/share/mr/vcsh to your system if needed - include = cat /usr/share/mr/vcsh include = cat $XDG_CONFIG_HOME/mr/config.d/* ~ % echo $XDG_CONFIG_HOME /home/richih/.config diff --git a/changelog b/changelog index dc578c6..b5d6e78 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,16 @@ +2014-03-13 Richard Hartmann + + * Release 1.20140313 -- the "Git won a prize" edition + * Initialize repos with --shared=0600 + * Fix cloning from some spefically-named remotes + * Support custom gitattribute files + * Support filenames with whitespace in gitignores + * Pass out git exit codes + * Switch to static, pre-built manpage + * Improve documentation + * Use more portable find(1) syntax + * Various minor improvements + 2013-12-29 Richard Hartmann * Release 1.20131229 diff --git a/doc/sample_hooks/post-init-add-origin b/doc/sample_hooks/post-init-add-origin new file mode 100755 index 0000000..993f3c7 --- /dev/null +++ b/doc/sample_hooks/post-init-add-origin @@ -0,0 +1,18 @@ +#!/bin/sh + +# This adds a remote origin at $GITURL/dotfiles/$VCSH_DIRECTORY which +# is helpful for creating new dotfile repositories that you plan to +# store on (e.g.) Github. +# +# You must set $GITURL in order to use this hook. For example, add the +# following to your .bashrc (or equivalent for your shell), replacing +# YOURUSERNAME with your github username: +# +# export GITURL="git@github.com:YOURUSERNAME" + +if [ -z $GITURL ]; then + echo "\$GITURL is not set; please see post-init-add-origin hook" + exit 1; +fi + +vcsh $VCSH_DIRECTORY remote add origin $GITURL/dotfiles/$VCSH_DIRECTORY diff --git a/doc/sample_hooks/post-init-setup-mr b/doc/sample_hooks/post-init-setup-mr new file mode 100755 index 0000000..a38c012 --- /dev/null +++ b/doc/sample_hooks/post-init-setup-mr @@ -0,0 +1,10 @@ +#!/bin/sh + +# This sets up your new repos with mr. + +cat > $HOME/.config/mr/available.d/$VCSH_DIRECTORY.vcsh << EOF +[\$HOME/.config/vcsh/repo.d/$VCSH_DIRECTORY.git] +checkout = vcsh clone $GITURL/dotfiles/$VCSH_DIRECTORY.git +EOF + +ln -s $HOME/.config/mr/available.d/$VCSH_DIRECTORY.vcsh $HOME/.config/mr/config.d/ diff --git a/doc/vcsh.1.ronn b/doc/vcsh.1.ronn index 56df4ed..05da4fa 100644 --- a/doc/vcsh.1.ronn +++ b/doc/vcsh.1.ronn @@ -171,6 +171,15 @@ executed in the context of your shell. Interesting knobs you can turn: +* <$VCSH_GITATTRIBUTES>: + Can be , or any other value. + + will not maintain Git attributes in a special location. + + If set to any other value, repo-specific gitattributes files will be maintained. + + Defaults to . + * <$VCSH_GITIGNORE>: Can be , , or . diff --git a/tools/list_CONTRIBUTORS b/tools/list_CONTRIBUTORS index 2954f58..1b88451 100755 --- a/tools/list_CONTRIBUTORS +++ b/tools/list_CONTRIBUTORS @@ -1,5 +1,11 @@ #!/bin/sh +# This program is licensed under the GNU GPL version 2 or later. +# (c) Richard "RichiH" Hartmann , 2012-2014 +# For details, see LICENSE. To submit patches, you have to agree to +# license your code under the GNU GPL version 2 or later. + + echo 'Alphabetical list of surnames of everyone who ever committed to this repository. Auto-generated from tools/list_CONTRIBUTORS. ' diff --git a/vcsh b/vcsh index 029a2b2..1e9f2d5 100755 --- a/vcsh +++ b/vcsh @@ -1,7 +1,7 @@ #!/bin/sh # This program is licensed under the GNU GPL version 2 or later. -# (c) Richard "RichiH" Hartmann , 2011-2013 +# (c) Richard "RichiH" Hartmann , 2011-2014 # For details, see LICENSE. To submit patches, you have to agree to # license your code under the GNU GPL version 2 or later. @@ -19,7 +19,7 @@ # If '.git-HEAD' is appended to the version, you are seeing an unreleased # version of vcsh; the master branch is supposed to be clean at all times # so you can most likely just use it nonetheless -VERSION='1.20131229.git-HEAD' +VERSION='1.20140313' SELF=$(basename $0) fatal() { @@ -77,6 +77,7 @@ fi : ${VCSH_HOOK_D:=$XDG_CONFIG_HOME/vcsh/hooks-enabled} : ${VCSH_BASE:=$HOME} : ${VCSH_GITIGNORE:=exact} +: ${VCSH_GITATTRIBUTES:=none} : ${VCSH_WORKTREE:=absolute} if [ ! "x$VCSH_GITIGNORE" = 'xexact' ] && [ ! "x$VCSH_GITIGNORE" = 'xnone' ] && [ ! "x$VCSH_GITIGNORE" = 'xrecursive' ]; then @@ -334,7 +335,7 @@ upgrade() { git config core.worktree "$VCSH_BASE" fi [ ! "x$VCSH_GITIGNORE" = 'xnone' ] && git config core.excludesfile ".gitignore.d/$VCSH_REPO_NAME" - git config core.attributesfile ".gitattributes.d/$VCSH_REPO_NAME" + [ ! "x$VCSH_GITATTRIBUTES" = 'xnone' ] && git config core.attributesfile ".gitattributes.d/$VCSH_REPO_NAME" git config vcsh.vcsh 'true' use [ -e "$VCSH_BASE/.gitignore.d/$VCSH_REPO_NAME" ] && git add -f "$VCSH_BASE/.gitignore.d/$VCSH_REPO_NAME" @@ -503,7 +504,7 @@ check_dir() { check_dir "$VCSH_REPO_D" [ ! "x$VCSH_GITIGNORE" = 'xnone' ] && check_dir "$VCSH_BASE/.gitignore.d" -check_dir "$VCSH_BASE/.gitattributes.d" +[ ! "x$VCSH_GITATTRIBUTES" = 'xnone' ] && check_dir "$VCSH_BASE/.gitattributes.d" verbose "$VCSH_COMMAND begin" export VCSH_COMMAND=$(echo $VCSH_COMMAND | sed 's/-/_/g') diff --git a/vcsh.1 b/vcsh.1 index 967aee8..4c77838 100644 --- a/vcsh.1 +++ b/vcsh.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "VCSH" "1" "February 2014" "" "" +.TH "VCSH" "1" "March 2014" "" "" . .SH "NAME" \fBvcsh\fR \- Version Control System for $HOME \- multiple Git repositories in $HOME @@ -213,6 +213,19 @@ Please note that those files are sourced\. Any and all commands will be executed Interesting knobs you can turn: . .TP +\fI$VCSH_GITATTRIBUTES\fR +Can be \fInone\fR, or any other value\. +. +.IP +\fInone\fR will not maintain Git attributes in a special location\. +. +.IP +If set to any other value, repo\-specific gitattributes files will be maintained\. +. +.IP +Defaults to \fInone\fR\. +. +.TP \fI$VCSH_GITIGNORE\fR Can be \fIexact\fR, \fInone\fR, or \fIrecursive\fR\. .