Closed ygoe closed 11 months ago
Could you try these commands in your repo and see if git returns some error messages?
git rev-parse --show-toplevel
git config --get remote.origin.url
I can see some error happened when DocFX try call git.exe
to get some repository information, but I cannot figure out what happened, as the Message
is empty in your attached log. Maybe DocFX should improve the error message here.
@ygoe , is it possible for you to share with us the folder you are working with? It is hard to tell what is wrong with the error message above.
Sorry, this is a closed project. I could try it with a test project when I get to it. Meanwhile, I've disabled the Git features. I'm not sure what they do anyway. On my colleague's computer it was enabled but didn't do anything visible.
@ygoe
- Prints nothing
From this, I guess you get the repository by downloading a zip package and extract, instead of using git clone
, so it misses the remote url information. Can you try git clone
to fetch the repository?
No, everything is cloned from the remote. No off-Git downloads.
Got it. I think a workaround is to run git remote add origin {repo_url}
in your repo to set the remote url. Then git config --get remote.origin.url
can get the needed information. I believe it can print some info on your colleague's machine. This should solve your issue, but I can not figure out why it is missing on your macihne, as it's set when cloning the repository.
Ehm, maybe it's because I have chosen another name for the remote? Because "origin" says nothing about where that remote actually is. Does docfx require the hard-coded name "origin" for the remote? That would be just about as inflexible as Git LFS is.
I have the same problem, and I also don't have a remote called "origin". I just tried DocFX for the first time.
Is there a way to change the name of the remote it's looking for? Git doesn't require a remote called "origin". In fact, the git clone command allows us to give the remote any name we want. So if you do require a remote called "origin", then that might be worth either documenting or fixing.
How do I disable git features?
@ygoe That hard-coded name "origin" is required for now. In some cases, we need to set multiple remote url in local git folder, then DocFX needs to figure out which one to choose. origin
should be the right one as it's the default name when clone repo.
Do you have multiple remote url? If not, DocFX can choose the default one, even it's not named original
. If yes, then it seems DocFX need a configuration to specify which url to choose, which is more complicated.
@seth-drf try --disableGitFeatures
There's currently just a single remote, so that could be used. But isn't there also something like a default push remote? Or is that just TortoiseGit's invention?
@seth-drf You could integrate this into your docfx.json file in the project directory:
{
"metadata": [
{
"disableGitFeatures": true
}
]
}
The (undocumented) commandline parameter --disableGitFeatures works fine. However, the (also undocumented) metadata value "disableGitFeatures" does not fully disable all Git features and still produces warnings. In addition "disableGitFeatures" is not included in the JSON schema and thus produces a warning in the Visual Studion JSON editor.
Would be great if the metadata value "disableGitFeatures" would work exactly like the commandline parameter, and also be included in the JSON schema at http://json.schemastore.org/docfx. Finally an updated docfx user manual would also be very welcome.
It looks like "disableGitFeatures" is in the "build" part of docfx.json, not "metadata".
{
"build": {
"disableGitFeatures": true
}
}
Putting "disableGitFeatures" into the "build" part did not change anything for me. Still getting all those Exceptions.
@subsembly @iegby disableGitFeatures
is in both build
and metadata
. --disableGitFeatures
set both of them, so it works fine for you.
I have updated the document to include disableGitFeatures
. More ehnacements:
git.exe
I though this issue can be closed.
Because latest docfx implementation don't use git.exe
and it's not throw GitException
.
DocFX Version Used: 2.39.2
Template used: unchanged
Steps to Reproduce:
Expected Behavior:
A successful build, maybe?
Actual Behavior:
This repeats for a very long time, I've cancelled the build.
It works on my colleague's computer but not on mine after checking out the code from the Git repo.