Closed iaindillingham closed 4 weeks ago
from RStudio version control docs
You should also become familiar with using RStudio Projects (which are required for version control features to be enabled).
In a Codespace I had running on the research-template repo I didn't have the git button in RStudio. However, when I went through the "New Project" dialogue in RStudio to add an RStudio project to the existing workspace directory, the Git button appeared and the various git dialogues seem to work fine:
@milanwiedemann has suggested to me that we consider adding the RProject file to the template so this works out of the box for everyone. Apparently the desktop version of RStudio adds this file automatically whenever you open a workspace folder.
A number of researchers already have an .Rproj file in their projects (see search). Equally this will just be noise to those researchers not using RStudio. Would it be possible to point people to some existing documentation that shows them how to create an R project file instead (and why they might want to do that)?
There have been a couple of things like this recently: too large to ignore, but too small to document (for good reasons). Possibly the "Getting started" section needs a "Troubleshooting" page?
I don't imagine for a moment that anyone will search for this page; they will ask tech support for help. However, tech support can link to this page when they respond.
Equally this will just be noise to those researchers not using RStudio
I share this concern. Interestingly, I found that when I used codespaces last, when I opened RStudio it did indeed create an RProj file automatically...
Possibly the "Getting started" section needs a "Troubleshooting" page?
Good idea! I think this will also have the side effect of us documenting some of the smaller problems we come across, which will help us understand whether or not we want to fix them, or if there's a wider problem that needs tackling.
We'll add this to a troubleshooting page rather than trying to fix it.
RStudio users find it convenient to work with Git using RStudio's version control interface, as described in the "Version Control" page of the RStudio documentation. It is enabled by default in all OpenSAFELY Codespaces, but the expected visual elements -- the Git/Version control dropdown and the Git/Version Control tab -- don't appear.
The "Troubleshooting" section of the previously mentioned page suggests this is because the
rstudio
user doesn't own the working directory.ls -l .
within the working directory tells us that it is owned by therstudio
user, but also by theroot
group. Possibly, the working directory needs to be owned by both therstudio
user and therstudio
group? That said,git status
doesn't report the expected error.Thanks, @milanwiedemann, for the feedback.
When I mentioned this to @lucyb, she asked about preferred interfaces to Git. Although we use
git
on the "How to add GitHub Codespaces to your project" page of the OpenSAFELY documentation, this is more becausegit
provides canonical command names that can be translated into the user's preferred interface, and less because we thinkgit
is the preferred interface. So, I think it's reasonable that we support RStudio's version control interface, just as we support VS Code's Source Control interface, without describing either in the documentation.