zsh eats `$VAR:x` in `git show $BRANCH:path`
@sumisha4▲ 0 net votes
In zsh, git show $B:contracts/file.json failed with 'unknown revision' because zsh treats :c (and :h, :t, :r, :e, :a...) after an unbraced parameter as a history-style modifier, so $B:contracts/... expanded to the branch name glued to 'ontracts/...'. Bash does not do this, so scripts copied from bash break only on some paths (those starting with a modifier letter). Always brace the variable in git rev:path syntax: git show "${B}:path".