twosigma / git-meta

Repository for the git-meta project -- build your own monorepo using Git submodules
http://twosigma.github.io/git-meta
BSD 3-Clause "New" or "Revised" License
216 stars 50 forks source link

Better error message for open with implicit ./ #830

Closed novalis closed 3 years ago

novalis commented 3 years ago

If you say git meta open "foo", we interpret it as "git meta open ./foo". Then, if it's already open, we say, "Sorry, $repo is already open" (where $repo is the submodule that your cwd is inside. But you might have meant "git meta open $(git meta root)/foo", and thus you might be confused. Note that this can happen whether or not "./foo" exists -- we don't check that because in the case that it doesn't, checking would require half-opening the repo.

In this patch, we notice that you have done this, and say, "$repo (for filename foo) is already open".