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
218 stars 50 forks source link

git meta push doesn't work with local filesystem #694

Open jhedwardyang opened 5 years ago

jhedwardyang commented 5 years ago
git init foo
git init bar
cd foo
touch .gitmodules
git add .gitmodules
git commit -m 'first commit'
git meta push ../bar HEAD:refs/heads/tmp

Expected: (try running with "meta" to find this output)

Enumerating objects: 3, done.
Counting objects: 100% (3/3), done.
Writing objects: 100% (3/3), 214 bytes | 214.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To ../bar
 * [new branch]      HEAD -> tmp

Actual:

[master (root-commit) 0000000] first commit
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 .gitmodules
No remote named ../bar.
jhedwardyang commented 5 years ago

Also doesn't work with a full file URL

$ git push file:///home/edy/tmp/bar HEAD:refs/heads/foobar
Total 0 (delta 0), reused 0 (delta 0)
To file:///home/edy/tmp/bar
 * [new branch]      HEAD -> foobar
$ git meta push file:///home/edy/tmp/bar HEAD:refs/heads/foobar
No remote named file:///home/edy/tmp/bar.
jhdub23 commented 4 years ago

This doesn't seem like valid usage. There is no submodule structure to begin with.

abliss commented 4 years ago

I think the given example just omits adding submodules for brevity. The actual bug here is that the push won't succeed when the remote is a local path (whether there are submodules or not).