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

Xcode's Source Control issue #538

Closed
miku1958 opened this issue Oct 14, 2022 · 4 comments
Closed

Xcode's Source Control issue #538

miku1958 opened this issue Oct 14, 2022 · 4 comments

Comments

@miku1958
Copy link

miku1958 commented Oct 14, 2022

Hi, I am working on the Office monorepo and we found that Xcode's Source Control(libgit2 1.3) doesn't work with microsoft/git.

But after a lot of testing I accidentally found that Xcode works as long as I use the official git(2.37.0) to run status command once, can you take a look at this and fix it? Thanks

@derrickstolee
Copy link
Collaborator

XCode uses libgit2 as its backend instead of executing the version of git on your PATH (which is how Visual Studio does it).

Do not use any version of Git other than one from microsoft/git or you might have unpredictable results. Other versions do not know how to get missing objects from Azure DevOps and hence may have failures you do not expect.

Please avoid using XCode's version control tools. Instead, use git from the command line.

@miku1958
Copy link
Author

miku1958 commented Oct 14, 2022

Hi @derrickstolee , thank you for your reply.

The only useful feature of Xcode's Source Control is the diff function, which is very necessary for Office Mac developers, and others are usually used from the command line or other GUIs that use command-line git.

What I mean is, if it's possible to fix it with the official git status, maybe you can see if it can be adapted.

@derrickstolee
Copy link
Collaborator

derrickstolee commented Oct 14, 2022

By running git status with standard Git, you probably rewrote the .git/index file to no longer be sparse (microsoft/git assumes index.sparse=true by default, while normal Git does not), allowing libgit2 to understand it. The sparse index is important for performance reasons, but you could disable it with git config index.sparse false and that might enable XCode diffs to work. When libgit2 learns to parse a sparse index (no idea when) and XCode upgrades to that version, you would be able to take advantage of the sparse index again.

@miku1958
Copy link
Author

Test with removing .git/index, it did work.
Thanks for the suggestion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants