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

Zed Not Recognizing Git Extension in Subfolders #8275

Closed
1 task done
waaldev opened this issue Feb 23, 2024 · 4 comments · Fixed by #11550
Closed
1 task done

Zed Not Recognizing Git Extension in Subfolders #8275

waaldev opened this issue Feb 23, 2024 · 4 comments · Fixed by #11550
Labels
bug [core label] git Git integration feedback

Comments

@waaldev
Copy link

waaldev commented Feb 23, 2024

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

When using Zed editor in a mono repository, I’ve noticed that it doesn’t consistently recognize Git extensions when working within subfolders. Specifically:

When I open the main folder, Git integration works as expected.
However, when I open a subfolder, Zed fails to recognize the Git status.
This behavior makes it challenging to work efficiently in mono repos where subfolders are common. I’d appreciate any insights or solutions to address this issue.

Environment

Zed: v0.123.3 (Zed)
OS: macOS 14.2.1
Memory: 8 GiB
Architecture: aarch64

If applicable, add mockups / screenshots to help explain present your vision of the feature

No response

If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.

If you only need the most recent lines, you can run the zed: open log command palette action to see the last 1000.

No response

@waaldev waaldev added admin read Pending admin review bug [core label] triage Maintainer needs to classify the issue labels Feb 23, 2024
@mrnugget
Copy link
Member

Hey! To clarify: do you mean submodules? Can you give us some steps to reproduce?

@waaldev
Copy link
Author

waaldev commented Feb 23, 2024

Hi. No. Here are the steps to reproduce:

  1. Create a folder structure as follows:
  • a/
    ├── b/
    └── c/
  1. Initialize Git in the main folder (a).
  2. Open the main folder (a). Git integration works correctly.
  3. However, when opening subfolders (b or c) alone, Zed fails to recognize Git in the parent folder.

@mrnugget
Copy link
Member

Ah, got it. Yeah, right now Zed expects the root folder that you open to be the one containing .git.

@JosephTLyons JosephTLyons added git Git integration feedback and removed triage Maintainer needs to classify the issue admin read Pending admin review labels Feb 23, 2024
@Moshyfawn Moshyfawn mentioned this issue Feb 28, 2024
1 task
@simoncocking
Copy link

Yeah stuck between a rock and a hard place on this one:

  1. Zed won't recognise the git repo in a parent folder; and
  2. next-ls can't initialise the LSP when running in the parent folder because that's not where the Mix project is defined.

This leaves me choosing between having either Git integration working, or the LSP. 😖

osiewicz pushed a commit to RemcoSmitsDev/zed that referenced this issue May 18, 2024
…tries#11550)

TODOs:

- [x] Add assertions to the test to ensure that the git status is
propagated
- [x] Get collaboration working
- [x] Test opening a git repository inside another git repository
- [x] Test opening the sub-folder of a repository that itself contains
another git repository in a subfolder

Fixes:
- Fixes zed-industries#10154
- Fixes zed-industries#8418
- Fixes zed-industries#8275
- Fixes zed-industries#7816
- Fixes zed-industries#6762
- Fixes zed-industries#4419
- Fixes zed-industries#4672
- Fixes zed-industries#5161

Release Notes:

- Added support for opening subfolders of git repositories and treating
them as part of a repository (show git status in project panel, show git
diff in gutter, git blame works, ...)
([zed-industries#4672](zed-industries#4672)).

Demo video:


https://github.com/zed-industries/zed/assets/1185253/afc1cdc3-372c-404e-99ea-15708589251c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug [core label] git Git integration feedback
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants