gitdoc icon indicating copy to clipboard operation
gitdoc copied to clipboard

GitDoc inactive on codespace start, regardless of being enabled in settings

Open mdeyanov83 opened this issue 11 months ago • 8 comments

Hi, I am using a CS50 codespace, which uses GitDoc for automatic commits. A couple months ago the auto commits stopped working. When I first connect to the codespace, GitDoc is inactive, reagardless of it being enabled in the settings. When I change the setting in .vscode/settings.json file to false and then back to true then GitDoc behaves as expected and auto commits work every 30 seconds, as by default. Once I close VSCode or disconnect from the codespace, once I connect back up, GitDoc is inactive again and need to reset the setting in .vscode/setting.json. I've tried rubilding the container, creating a new codespace, nothing seems to solves it.

.devcontainer.json
{
  "customizations": {
    "vscode": {
      "extensions": [
        "vsls-contrib.gitdoc"
      ],
      "settings": {
        "gitdoc.autoPull": "off",
        "gitdoc.commitMessageFormat": "ccc, LLL d, kkkk, h:mm a ZZ",
        "gitdoc.commitValidationLevel": "none",
        "gitdoc.enabled": true,
        "gitdoc.pullOnOpen": false,
      }
    }
  }
}
.vscode/settings.json

{
    "gitdoc.enabled": true,
}

mdeyanov83 avatar Feb 01 '25 18:02 mdeyanov83

Same issue. I manually committed and it woke up.

Turbine1991 avatar Aug 01 '25 14:08 Turbine1991

Same issue. I manually committed and it woke up.

My solution is to run a script (using AutoLaunch extension) that manually toggles "gitdoc.enabled": true, to false and a second later back to true in my workspace settings file (.vscode/settings.json)

mdeyanov83 avatar Aug 01 '25 15:08 mdeyanov83

I still have the same issue in a custom devcontainer. I have tried "gitdoc.enabled": true in both remote (devcontainer.json) and workspace (.vscode/settings.json) settings and gitdoc is not active on container initial start. The setting need to be cycled false -> true on each start.

mdeyanov83 avatar Aug 24 '25 00:08 mdeyanov83

I'm still getting it with one particular workspace, even on a fresh system. What's odd is that I have another workspace/profile using gitdoc that doesn't suffer from this issue. Either it's interacting with another extension somehow (I'm not even really sure what kind of extension would cause such interaction to try to more efficiently narrow it down than just disabling everything and checking one by one), or once it gets triggered in a workspace, it's permanent.

ShaunaGordon avatar Aug 31 '25 15:08 ShaunaGordon

I am seeing the same issue.

Interestingly, if I rebuild the container without ms-vscode.cpptools listed in the extensions, then gitdoc is enabled at startup as expected. If I add cpptools back, then gitdoc never loads correctly initially. If I toggle it or reload the window it loads as expected. Just the initial load does not work if I have both it and cpptools being added (order does not matter).

    "customizations": {
        "vscode": {
            "extensions": [
                "usernamehw.errorlens",
                "cschlosser.doxdocgen",
                "vsls-contrib.gitdoc",
                "ms-vscode.cpptools",
                "davidkaiser.kaiser-project-zip"
            ]
        }

ascholerChemeketa avatar Sep 13 '25 23:09 ascholerChemeketa

My current workaround is to not list ms-vscode.cpptools in the customizations/vscode/extensions, but instead to use a postAttachCommand to install it. That appears to allow gitdoc to get initialized successfully.

"postAttachCommand": "code --install-extension ms-vscode.cpptools"

ascholerChemeketa avatar Sep 13 '25 23:09 ascholerChemeketa

FYI, i got frustrated with the fact that this doesn't work reliably and i wrote a tiny daemon that can be run as a systemd user service that monitors git repos and does auto pull/commit/push. it is independent of any editor. if anyone is interested, it can be found here: https://github.com/awalland/autogit. i also made an rpm for opensuse tumbleweed https://build.opensuse.org/package/show/home:brezel/autogit

awalland avatar Nov 15 '25 19:11 awalland

Same here, Gitdoc is disabled unless i run gitdoc.enable first, although the config states that gitdoc should be enabled.

I guess something in VSCode and Updates broke gitdoc a long time ago.

jsuelwald avatar Nov 27 '25 17:11 jsuelwald

My current workaround is to not list ms-vscode.cpptools in the customizations/vscode/extensions, but instead to use a postAttachCommand to install it. That appears to allow gitdoc to get initialized successfully.

"postAttachCommand": "code --install-extension ms-vscode.cpptools"

Have you noticed if it works the other way around? cpptools listed in devcontainer vscode/extensions, while gitdoc installed post create (either manually or via a postcreate command)?

mdeyanov83 avatar Dec 25 '25 20:12 mdeyanov83