Written by

MediQuant
Question Alan Watts · Jan 2, 2024

dubious ownership in repository

We are trying to use Git for Source Code control in our existing application. Currently all Source Control is a manual process. We are running IRIS on a Windows server. The git extension has been installed and initial configuration done. We do get the git tab in Studio. We keep getting the following error:

Git Status:
fatal: detected dubious ownership in repository at 'C:/KBS/dev/server/db'
'C:/KBS/dev/server/db' is owned by:
'S-1-1-0'
but the current user is:
'S-1-5-18'
To add an exception for this directory, call:git config --global --add safe.directory C:/KBS/dev/server/db.

Tried [ git config --global --add safe.directory C:/KBS/dev/server/db ] in git bash with and without quotes. No change.

Tried [ git config --global --add safe.directory "*" ] single and double quotes in git bash with and without double quotes. No change.

Tried changing the owner of the folder in Windows, but cannot find 'S-1-5-18' as a user in Windows.

Most of our attempts have been in git or Windows with no affect. We suspect there is something in IRIS that we need to do as we are trying to use git source control within IRIS. Using it in git bash only lets us put IRIS.DAT into the repository. Which is not very helpful.

Product version: IRIS 2022.1
$ZV: IRIS for Windows (x86-64) 2022.1 (Build 209U) Tue May 31 2022 12:16:40 EDT

Comments

Ben Spead · Jan 2, 2024

@Alan Watts - to clarify, can you please confirm that you are trying to use Embedded (aka Server-side) source control using the git-source-control package from OEM?  

0
Alan Watts  Jan 10, 2024 to Ben Spead

Yes, as far as I know.

0
Herman Slagman  Jan 16, 2024 to Timothy Leavitt

In the Git plugin, a %Studio.SourceControl.Base subclass , I get the active branch
Set Active=##class(Git.Utils).GetActiveBranch(Repos.Directory)
If Active["fatal" {
Set sc=##class(Git.Utils).AddToSaveList(Repos.Name)
}
If that gets a fatal I call:
Set Command="cd "_Repository.Directory_" && git config --global --add safe.directory "_Dir
Set sc=..CPipe(Command,.Output)
This process runs under the Studio account

0
Alan Watts  Jan 10, 2024 to Herman Slagman

Where and how did you get the Git plugin for Studio? This is what we thought might be the solution. But we thought we had already installed any extensions/ add-ons needed.

0
Ben Spead  Jan 10, 2024 to Alan Watts

@Alan Watts - there is no client-side Git plugin for Studio.  Studio works exclusively with server-side source-control hooks.  This is what the git-source-control package on OEX is ... it is server-side source control hooks to allow multiple developers to properly interact with a git repo from a single Namespace within InterSystems IRIS.  So once this is properly installed and configured for a given Namespace, once you connect via Studio you should see new top level Menu items in Studio and all changes will be governed by the source control hooks.  Nothing else is needed to be installed on the developers' Studio instances in terms of plug-ins, etc.

0
Herman Slagman  Jan 16, 2024 to Alan Watts

It is a custom build Git Studio plugin plus application and CLI, that can handle multiple repositories per namespace. It is one of the reasons I still use Studio.

0
Alan Watts  Jan 26, 2024 to Herman Slagman

If I am understanding this correctly (I'm probably not), You go to the Git tab in Studio, select Launch Git UI (?). When i do that I get a small window with a red X button graphic and nothing else. I was thinking it would have a window to enter in the commands/ code you mention, I don't seem to get that.

0
Herman Slagman  Jan 28, 2024 to Alan Watts

No, if you build a Git plugin yourself, you will also have to build the Git menu and optional context menu.

Class Git.PlugIn Extends %Studio.SourceControl.Base


0
Timothy Leavitt · Jan 4, 2024

Assuming this is with git-source-control, the approach would be to have the temp folder *and all subfolders* owned by SYSTEM (in this case), as discussed at https://github.com/intersystems/git-source-control?tab=readme-ov-file#d…. This is under folder Properties > Security > Advanced. Click "Change" next to "Owner", and under Object Names to Select type in "SYSTEM". Before applying, check the box with "Replace all child object permission entries..." at the bottom of the dialog. That should do it.

0