Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"hlx up" fails with "Could not find HEAD." on repos that are submodules #1794

Closed
maxakuru opened this issue Jun 29, 2021 · 5 comments
Closed
Labels
bug Something isn't working released

Comments

@maxakuru
Copy link
Member

Description
I pulled a repo as a submodule to keep all helix repos together to explore things in a single place, but when running hlx up on a repo that doesn't have a .git folder (instead, a .git file that points to the parent's gitdir) the command fails with the error: Could not find HEAD.

It looks like this is due to the way the gitdir is resolved, currently the UpCommand assumes it's in a regular repository. GitUtils also seem to use the default gitdir behavior for all APIs (which ends up being dir/ + .git).

To Reproduce
Steps to reproduce the behavior:

  1. git init
  2. git submodule add <some helix repo url>
  3. cd repo
  4. hlx up

Expected behavior
Repos as a submodules is a popular format (but maybe uncommon for helix sites). I think this should be supported, or if not, then the .git path should be checked for "directory-ness" and not just existence, so the error message is more clear.

Version:
13.4.49

I have a fix working and could add some unit tests to PR this, but wanted to find out if this has been discussed already.. I noticed issue #614 speaks to submodules inside the project, but not the other way around.

@maxakuru maxakuru added the bug Something isn't working label Jun 29, 2021
@tripodsan
Copy link
Contributor

my personal opinion is, that submodules cause more problems than they solve :-)
however, I think it is good to support all kind of setups.

@stefan-guggisberg
Copy link
Contributor

I second @tripodsan's statement, having used submodules in some projects in the past. I haven't seen projects using submodules in recent years and I'd question that they're a popular choice.

Unless there's a real use case IMHO I don't think it's worth supporting it.

@maxakuru
Copy link
Member Author

@tripodsan @stefan-guggisberg I agree submodules aren't great and monorepos in general are polarizing. It's hard to argue against the popularity of monorepos for dev environments, though, whether using submodules or another tool. It may be rare, but if I hit this error and wasn't motivated to find out why, I might have lost interest. At very least a better error message makes sense, imo

I didn't realize the potential impact to support it in other components. If the consensus is "not needed" or "not wanted" I'll gladly drop the PR or convert it to an error message PR... wdyt

@stefan-guggisberg
Copy link
Contributor

stefan-guggisberg commented Jun 30, 2021 via email

adobe-bot pushed a commit that referenced this issue Jul 1, 2021
## [13.4.50](v13.4.49...v13.4.50) (2021-07-01)

### Bug Fixes

* **cli:** add error message for hlx up command in submodule repo ([#1796](#1796)) ([835f80a](835f80a)), closes [#1794](#1794)
@adobe-bot
Copy link
Collaborator

🎉 This issue has been resolved in version 13.4.50 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
Development

No branches or pull requests

4 participants