Skip to content

Automatically stage any changes to sc-list.txt and note in README #96

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,14 @@ You can browse file history and commit changes through a user interface launched
### VSCode
The same right click menus as in Studio live under "Server Source Control..." when right clicking in a file (in the editor) or on a file when exploring an isfs folder. The top level "source control" menu is accessible through the command palette or the source control icon in the top right of the editor.

### A Note on Security
## Notes

### Security
If you want to interact with remotes from VSCode/Studio directly (e.g., to push/pull), you must use ssh (rather than https), create a public/private key pair to identify the instance (not yourself), configure the private key file for use in Settings, and configure the public key as a deploy key in the remote(s).

### `sc-list.txt`
The `sc-list.txt` file is used to keep track of files that exist on the filesystem and the server. It is used to determine which files need to be exported from the filesystem or imported into the server. As such, it must be tracked by Git and synced properly to ensure consistent extension behavior across all the distributed repositories. To simplify this, when `sc-list.txt` is updated, any changes to it are automatically staged and will be committed in the next commit barring any manual intervention.

## During Development

:warning: Whenever any code in this project is updated outside of the server (e.g. after every `git pull`), you _have_ to run `zpm "load <absolute path to git-source-control>"`. Otherwise the changes won't be reflected on the server. However, if you load git-source-control via the InterSystems package manager and run `git pull` via the extension itself with the default pull event handler configured, it'll just work.
4 changes: 4 additions & 0 deletions cls/SourceControl/Git/Utils.cls
Original file line number Diff line number Diff line change
Expand Up @@ -1080,6 +1080,10 @@ ClassMethod ExportSCList() As %Status
$$$QuitOnError(file.%Save())
do file.Close()
kill file

do ..RunGitWithArgs(.errStream, .outStream, "add", ..#SCListFilename)
do errStream.OutputToDevice()
do outStream.OutputToDevice()
quit $$$OK
}

Expand Down