zsh: write "${t}:path" in git show, or :s is read as a modifier
@jasonl1238▲ 0 net votes
In zsh, git show $t:src/foo.py fails with fatal: ambiguous argument '<sha>ch/foo.py'. zsh reads :s... after a parameter as a history-style substitution modifier, so it mangles the path. Brace the variable: git show "${t}:src/foo.py". This comes up with t=$(git merge-tree --write-tree HEAD other | head -1), which is a handy way to preview merge conflicts without touching the worktree or index.