The OS-Schools research template is based on this research template.
Recently a OS-Schools researcher had trouble committing their work as they were unaware that they would need to write directly in (and subsequently save and close) the COMMIT_EDITMSG file that appears when clicking the "✔️ Commit" button without having first filled in a commit message.
The commit workflow via writing in COMMIT_EDITMSG is documented in the VSCode docs: https://code.visualstudio.com/docs/sourcecontrol/staging-commits#_use-the-editor-for-commit-messages, but not in the Codespaces docs: https://docs.github.com/en/codespaces/developing-in-a-codespace/using-source-control-in-your-codespace#committing-your-changes. In the OpenSAFELY docs, we only link to the Codespaces docs.
Since the user did not know about this workflow, they thought that the source control panel was unresponsive for unknown reasons (when in reality it was waiting for COMMIT_EDITMSG to be closed. This seems like something that other OpenSAFELY users might encounter and could potentially be a frustrating experience. (See Slack thread documenting user frustration.)
We can configure VSCode not to use its text editor for commit messages by adding "git.useEditorAsCommitInput": false to the template's VSCode settings in devcontainer.json:
|
"vscode": { |
|
"extensions": [ |
|
"ms-python.python", |
|
"ms-toolsai.jupyter", |
|
"ms-toolsai.jupyter-renderers", |
|
"bennettoxford.opensafely" |
|
], |
|
"settings": { |
|
"extensions.ignoreRecommendations": true, |
|
"files.autoSave": "afterDelay", |
|
"files.autoSaveDelay": 1000, |
|
"git.autofetch": true, |
|
"python.analysis.extraPaths": [".devcontainer/ehrql-main/"], |
|
"python.defaultInterpreterPath": "/opt/venv/bin/python", |
|
"python.terminal.activateEnvInCurrentTerminal": true, |
|
"python.terminal.activateEnvironment": true, |
|
"window.autoDetectColorScheme": true |
|
} |
|
} |
Adding the above setting changes the behaviour from opening COMMIT_EDITMSG in the editor

to asking for a commit message in the top dialogue box:

.
If this is desirable, we might consider adding the setting to this template. The downside is that any users who would like to make use of COMMIT_EDITMSG would have to configure the setting themselves in their own research repos.
Alternatively, we could link to the VSCode docs from the OpenSAFELY docs, so that users who are confused by COMMIT_EDITMSG have a higher chance of finding the relevant section in the VSCode docs. The downside is that we could potentially be then linking to two sets of GitHub docs on how to commit which creates more reading for our users.
The OS-Schools research template is based on this research template.
Recently a OS-Schools researcher had trouble committing their work as they were unaware that they would need to write directly in (and subsequently save and close) the
COMMIT_EDITMSGfile that appears when clicking the "✔️ Commit" button without having first filled in a commit message.The commit workflow via writing in
COMMIT_EDITMSGis documented in the VSCode docs: https://code.visualstudio.com/docs/sourcecontrol/staging-commits#_use-the-editor-for-commit-messages, but not in the Codespaces docs: https://docs.github.com/en/codespaces/developing-in-a-codespace/using-source-control-in-your-codespace#committing-your-changes. In the OpenSAFELY docs, we only link to the Codespaces docs.Since the user did not know about this workflow, they thought that the source control panel was unresponsive for unknown reasons (when in reality it was waiting for
COMMIT_EDITMSGto be closed. This seems like something that other OpenSAFELY users might encounter and could potentially be a frustrating experience. (See Slack thread documenting user frustration.)We can configure VSCode not to use its text editor for commit messages by adding
"git.useEditorAsCommitInput": falseto the template's VSCode settings indevcontainer.json:research-template/.devcontainer/devcontainer.json
Lines 31 to 49 in b181f92
Adding the above setting changes the behaviour from opening


COMMIT_EDITMSGin the editorto asking for a commit message in the top dialogue box:
.
If this is desirable, we might consider adding the setting to this template. The downside is that any users who would like to make use of
COMMIT_EDITMSGwould have to configure the setting themselves in their own research repos.Alternatively, we could link to the VSCode docs from the OpenSAFELY docs, so that users who are confused by
COMMIT_EDITMSGhave a higher chance of finding the relevant section in the VSCode docs. The downside is that we could potentially be then linking to two sets of GitHub docs on how to commit which creates more reading for our users.