]> git.madduck.net Git - code/vcsh.git/commitdiff

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Merge remote-tracking branch 'andschwa/docs'
authorRichard Hartmann <richih@debian.org>
Sat, 15 Mar 2014 14:01:44 +0000 (15:01 +0100)
committerRichard Hartmann <richih@debian.org>
Sat, 15 Mar 2014 14:01:44 +0000 (15:01 +0100)
changelog
doc/sample_hooks/post-init-add-origin [new file with mode: 0755]
doc/sample_hooks/post-init-setup-mr [new file with mode: 0755]
doc/vcsh.1.ronn
vcsh
vcsh.1

index dc578c6f6686ca8d107bc505f22d41b07543bfab..b5d6e781d69660d80d5796071733dacefbfddbc2 100644 (file)
--- a/changelog
+++ b/changelog
@@ -1,3 +1,16 @@
+2014-03-13  Richard Hartmann <richih.mailinglist@gmail.com>
+
+       * 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 <richih.mailinglist@gmail.com>
 
        * 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 (executable)
index 0000000..993f3c7
--- /dev/null
@@ -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 (executable)
index 0000000..a38c012
--- /dev/null
@@ -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/
index 56df4ed26e74cdbb7a4109056b8415570843d846..05da4fad8bfe18dce47ab8aaa2c3dc9f9c619275 100644 (file)
@@ -171,6 +171,15 @@ executed in the context of your shell.
 
 Interesting knobs you can turn:
 
+* <$VCSH_GITATTRIBUTES>:
+  Can be <none>, or any other value.
+
+  <none> will not maintain Git attributes in a special location.
+
+  If set to any other value, repo-specific gitattributes files will be maintained.
+
+  Defaults to <none>.
+
 * <$VCSH_GITIGNORE>:
   Can be <exact>, <none>, or <recursive>.
 
diff --git a/vcsh b/vcsh
index 029a2b26fa078220f2039030485d121de0e2a3fc..d39f41581da5ab93442e7073bd6eb3189730d571 100755 (executable)
--- a/vcsh
+++ b/vcsh
@@ -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 967aee8c61fe0aecf72f19652f88dd8249c62924..4c77838c2fca10ffd27c9e0cb87c05fed88d8ffc 100644 (file)
--- 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\.
 .