Skip to content

Commit a80b505

Browse files
committed
Merge branch 'main' into issue-448
2 parents 321b88c + 3faf8a7 commit a80b505

File tree

6 files changed

+26
-4
lines changed

6 files changed

+26
-4
lines changed

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,20 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [2.6.0] - Unreleased
8+
## [2.7.0] - Unreleased
9+
10+
### Added
11+
- Added 'git push --force' in expert mode (#527)
12+
13+
## [2.6.0] - 2024-10-07
914

1015
### Added
1116
- Discards safeguarded by discard stash and warning modal (#455)
1217
- Files in uncommitted queue in any namespace warn users when opened except for in VSCode (#370)
1318
- Added link back to IRIS management portal from Settings, Git WebUI pages (#449)
1419
- Added Import all and Import All (Force) to basic mode menu (#498)
1520
- Improved behavior for commits when attribution settings are not configured (#450)
21+
- Convert URLs in Sync output UI into clickable links (#497)
1622

1723
### Fixed
1824
- Changed prompts in configure from 0/1 to no/yes (#461)
@@ -24,6 +30,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2430
- Properly handle more cases of truncated filenames from git pull (#511)
2531
- Made git-source-control backwards compatible with IRIS 2021.1 (#513)
2632
- Sync, pull properly handle more change edge cases for import (#517, #496)
33+
- "Status" menu item actually includes branch when IRIS version allows (#472)
2734

2835
## [2.5.0] - 2024-09-24
2936

cls/SourceControl/Git/Extension.cls

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ XData Menu
2222
<MenuItem Separator="true"/>
2323
<MenuItem Name="Sync" />
2424
<MenuItem Name="Push" />
25+
<MenuItem Name="PushForce" />
2526
<MenuItem Name="Fetch" />
2627
<MenuItem Name="Pull" />
2728
<MenuItem Separator="true"/>
@@ -127,6 +128,7 @@ Method LocalizeName(name As %String) As %String
127128
"Commit":$$$Text("@Commit@Commit changes to file"),
128129
"Sync":$$$Text("@Sync@Sync"),
129130
"Push":$$$Text("@Push@Push to remote branch"),
131+
"PushForce":$$$Text("@PushForce@Push to remote branch (Force)"),
130132
"Fetch":$$$Text("@Fetch@Fetch from remote"),
131133
"Pull":$$$Text("@Pull@Pull changes from remote branch"),
132134
"Status": $$$Text("@Status@Status"),
@@ -174,6 +176,7 @@ Method OnSourceMenuItem(name As %String, ByRef Enabled As %String, ByRef Display
174176
"NewBranch": 1,
175177
"SwitchBranch": 1,
176178
"Push": 1,
179+
"PushForce": 1,
177180
"Fetch": 1,
178181
"Pull": 1,
179182
"Sync": -1,
@@ -194,7 +197,7 @@ Method OnSourceMenuItem(name As %String, ByRef Enabled As %String, ByRef Display
194197

195198
if (name = "Status") {
196199
set DisplayName = ..LocalizeName(name)_" (branch: "_##class(SourceControl.Git.Utils).GetCurrentBranch()_")"
197-
} if (name '= "") {
200+
} elseif (name '= "") {
198201
set DisplayName = ..LocalizeName(name)
199202
}
200203
quit $$$OK

cls/SourceControl/Git/Utils.cls

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,10 @@ ClassMethod UserAction(InternalName As %String, MenuName As %String, ByRef Targe
272272
quit $$$OK
273273
} elseif (menuItemName = "Push") {
274274
quit ..Push()
275+
} elseif (menuItemName = "PushForce") {
276+
set Target = "Force pushing is potentially destructive and may overwrite the commit history of the remote branch. Are you sure you want to proceed?"
277+
set Action = 1 // Make sure the user confirms that they want to do this
278+
quit $$$OK
275279
} elseif (menuItemName = "Fetch") {
276280
$$$QuitOnError(..Fetch(.diffFiles))
277281
set pointer = 0
@@ -321,6 +325,11 @@ ClassMethod AfterUserAction(Type As %Integer, Name As %String, InternalName As %
321325
do ..Sync(Msg)
322326
set Reload = 1
323327
}
328+
} elseif (menuItemName = "PushForce") {
329+
if (Answer = 1) {
330+
do ..Push(,1)
331+
set Reload = 1
332+
}
324333
} elseif (menuItemName = "GitWebUI") {
325334
// Always force reload as many things could have possibly changed.
326335
set Reload = 1

csp/sync.csp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,8 @@
147147
&js<
148148
var outputContainer = document.getElementById('outputBox');
149149
var lineText = #(..QuoteJS(escapedLine))#;
150-
var lineTextNode = document.createTextNode(lineText);
150+
var urlRegex = /(https?:\/\/[^ ]*)/gi;
151+
lineText = lineText.replace(urlRegex, "<a href='$1' target=_blank>$1</a>");
151152
outputContainer.innerHTML += lineText + "<br>";
152153
>
153154
}

docs/menu-items.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ This menu option is analogous to the [git add](https://git-scm.com/docs/git-add)
2020
This menu option will only appear if the currently open file has been already added using the 'Add' menu option. It undoes the effect of adding the file, similar to running [git reset](https://git-scm.com/docs/git-reset) on a specific file.
2121
## Push to remote branch
2222
This option pushes the commits in the branch to the remote repository. This exhibits the same behavior as the [git push](https://git-scm.com/docs/git-push) command.
23+
## Push to remote branch (force)
24+
This option forcibly pushes the commits in the branch to the remote repository. This is potentially destructive and may overwrite the commit history of the remote branch. This exhibits the same behavior as the [git push --force](https://git-scm.com/docs/git-push) command.
2325
## Fetch from remote
2426
Much like the [git fetch](https://git-scm.com/docs/git-fetch) command, this option fetches the most recent versions of the branch without merging that version into the local copy of the branch.
2527
## Pull changes from remote branch

module.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<Document name="git-source-control.ZPM">
44
<Module>
55
<Name>git-source-control</Name>
6-
<Version>2.6.0</Version>
6+
<Version>2.7.0</Version>
77
<Description>Server-side source control extension for use of Git on InterSystems platforms</Description>
88
<Keywords>git source control studio vscode</Keywords>
99
<Packaging>module</Packaging>

0 commit comments

Comments
 (0)