]> 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 'madduck/relative_worktrees' into merge--madduck/relativ...
authorRichard Hartmann <richih@debian.org>
Mon, 2 Sep 2013 21:16:03 +0000 (23:16 +0200)
committerRichard Hartmann <richih@debian.org>
Mon, 2 Sep 2013 21:16:03 +0000 (23:16 +0200)
1  2 
vcsh

diff --cc vcsh
index 2ec49557b39b6d00d39d37eb70762d7fe5956538,5642b97741a4182f6ffdb0dacc3e15a4314ffa3e..60fcd99f17ee0b0d0ef5523567daf5a3cb34d1ed
--- 1/vcsh
--- 2/vcsh
+++ b/vcsh
@@@ -212,14 -196,11 +212,13 @@@ hook() 
  }
  
  init() {
 +      hook pre-init
        [ ! -e "$GIT_DIR" ] || fatal "'$GIT_DIR' exists" 10
-       export GIT_WORK_TREE="$VCSH_BASE"
-       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
+       mkdir -p "$VCSH_BASE" || fatal "could not create '$VCSH_BASE'" 50
+       cd "$VCSH_BASE" || fatal "could not enter '$VCSH_BASE'" 11
        git init
        upgrade
 +      hook post-init
  }
  
  list() {
@@@ -293,28 -271,17 +291,33 @@@ run() 
        hook post-run
  }
  
 +status() {
 +      if [ ! "x$VCSH_REPO_NAME" = "x" ]; then
 +              export GIT_DIR="$VCSH_REPO_D/$VCSH_REPO_NAME.git"
 +              use
 +              git status --short --untracked-files='no'
 +      else
 +              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
 +      fi
 +}
 +
  upgrade() {
        hook pre-upgrade
-       use
-       git config core.worktree     "$GIT_WORK_TREE"
+       # fake-bare repositories are not bare, actually. Set this to false
+       # because otherwise Git complains "fatal: core.bare and core.worktree
+       # do not make sense"
+       git config core.bare false
+       # in core.worktree, keep a relative reference to the base directory
+       git config core.worktree $(cd $GIT_DIR && GIT_WORK_TREE="$VCSH_BASE" git rev-parse --show-cdup)
        [ ! "x$VCSH_GITIGNORE" = 'xnone' ] && git config core.excludesfile ".gitignore.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"
        hook post-upgrade
  }