Commit 0c4a0b6e10f7fbf15127339750a6ff490d9aa3c8
git/config: wta: remove --no-checkout, it confuses state
When using --no-checkout, the main repository would be confused about the state of the submodules: Instead of considering them not checked-out it would consider them checked out at their HEAD, yet with their index cleared, so all files would look deleted and after `git wtas` you would have to do: git submodule update --init # obviously git submodule foreach git checkout HEAD -- . # oh, ok With this change, `git wtas` will take longer and may do superfluous checkouts of files, but a `git submodule update --init` is all that is necessary to get everything right.Claes Wallin (韋嘉誠) committed on 3/30/2017, 7:35:34 AM
Parent: 2d10a5774dbb7a387dae0ac4aeb79c579865c865
Files changed
.config/git/config | changed |
.config/git/config | |||
---|---|---|---|
@@ -7,9 +7,9 @@ | |||
7 | 7 … | amend = commit --amend --no-edit --reset-author | |
8 | 8 … | gco = !bash -c 'git fetch gerrit \"$1\" && git checkout FETCH_HEAD' git-gco | |
9 | 9 … | fc = "!bash -ec 'change=\"$1\"; prefix=\"${change:3:2}\"; git fetch gerrit \"refs/changes/${prefix}/${change}/*:refs/remotes/gerrit/changes/${prefix}/${change}/*\"' git-fc" | |
10 | 10 … | cc = "!bash -ec 'change=\"$1\"; prefix=\"${change:3:2}\"; git fc \"$change\"; latest=$(git ls-remote . \"refs/remotes/gerrit/changes/${prefix}/${change}/*\" | sort -n -t / -k 7 | cut -f 2 | tail -n 1); if [[ -z $latest ]]; then echo >&2 \"No such change: $change\"; exit 1; else git checkout \"$latest\"; fi' git-cc" | |
11 | - wta = worktree add --no-checkout --detach | ||
11 … | + wta = worktree add --detach | ||
12 | 12 … | wtas = "!bash -ec 'if (( $# != 1)); then echo >&2 git wtas: 1 parameter expected; exit 2; fi; tree=\"$(python -c \"from __future__ import print_function; import os, os.path, sys; print(os.path.normpath(os.path.join(os.getenv(\\\"PWD\\\"), sys.argv[1])))\" \"$1\")\"; git wta \"$tree\"; cd \"$(git rev-parse --git-dir)\"; for mod in $(git config --blob HEAD:.gitmodules -l --name-only|gawk -F . \"/\\.path$/ {print \\$2}\"); do [ -d modules/$mod ] && git -C modules/$mod wta \"${tree}/$(git config --blob HEAD:.gitmodules --get submodule.${mod}.path)\"; done' wtas" | |
13 | 13 … | ||
14 | 14 … | [core] | |
15 | 15 … | autocrlf = false |
Built with git-ssb-web