From e51a27bcf5aa29f79e985ae6e578dffaac850356 Mon Sep 17 00:00:00 2001
From: Pravin Barton <9560941+isc-pbarton@users.noreply.github.com>
Date: Wed, 12 Nov 2025 10:55:23 -0500
Subject: [PATCH 1/3] enh: workspace view has option to abort merge
---
CHANGELOG.md | 1 +
.../share/git-webui/webui/js/git-webui.js | 78 +++++++++++++++++++
.../src/share/git-webui/webui/js/git-webui.js | 78 +++++++++++++++++++
3 files changed, 157 insertions(+)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 47fbd8a3..37df1a33 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Import All has been added to public-facing API (#891)
+- Web UI workspace view now has an option to abort merge in progress (#895)
## Fixed
- Web UI workspace view labels changes as Unmerged if there are merge conflicts (#890)
diff --git a/git-webui/release/share/git-webui/webui/js/git-webui.js b/git-webui/release/share/git-webui/webui/js/git-webui.js
index b34d1886..ff17702d 100644
--- a/git-webui/release/share/git-webui/webui/js/git-webui.js
+++ b/git-webui/release/share/git-webui/webui/js/git-webui.js
@@ -2805,8 +2805,21 @@ webui.NewChangedFilesView = function(workspaceView) {
}
});
+
+ $("#abortMergeBtn").off("click");
+ $("#abortMergeBtn").on("click", function() {
+ self.confirmAbortMerge();
+ })
});
});
+
+ webui.git_command(["rev-parse", "--quiet", "--verify", "MERGE_HEAD"], function () {
+ // success code with --verify means MERGE_HEAD exists
+ $("#abortMergeBtn").show().prop("disabled",false);
+ }, null, function() {
+ // error code with --verify means MERGE_HEAD does not exist
+ $("#abortMergeBtn").hide().prop("disabled",true);
+ })
}
self.confirmDiscard = function() {
@@ -2920,6 +2933,63 @@ webui.NewChangedFilesView = function(workspaceView) {
});
}
+ self.confirmAbortMerge = function() {
+ function removePopup(popup) {
+ $(popup).children(".modal-fade").modal("hide");
+ $(".modal-backdrop").remove();
+ $("#confirmAbortMerge").remove();
+ }
+
+ var popup = $(
+ '
' +
+ '
' +
+ '
' +
+ '' +
+ '
' +
+ '' +
+ '
' +
+ '
' +
+ '
'
+ )[0];
+
+ $("body").append(popup);
+ var popupContent = $(".modal-body", popup)[0];
+ webui.detachChildren(popupContent);
+
+ $(
+ '' +
+ '
' +
+ webui.warningIcon +
+ '
' +
+ '
' +
+ '
A merge is in progress. Are you sure you want to abort it?
' +
+ '
' +
+ '
'
+ ).appendTo(popupContent);
+
+ var popupFooter = $(".modal-footer", popup)[0];
+ webui.detachChildren(popupFooter);
+
+ $(
+ '' +
+ ''
+ ).appendTo(popupFooter);
+
+ $(popup).modal('show');
+
+ $('#confirmAbortMergeBtn').on('click', function() {
+ removePopup(popup);
+ self.abortMerge();
+ });
+
+ $('#confirmAbortMerge').find('#cancelAbortMergeBtn, .close').click(function() {
+ removePopup(popup);
+ });
+ }
+
// Popup for when trying to commit to default merge branch in basic mode
self.noCommitsOnDefault = function () {
function removePopup(popup) {
@@ -3172,6 +3242,13 @@ webui.NewChangedFilesView = function(workspaceView) {
webui.git_command(["add", "--"].concat(selectedItems), restoreCommand,undefined,restoreCommand);
}
+ self.abortMerge = function() {
+ webui.git_command(["merge", "--abort"], function() {
+ workspaceView.update();
+ });
+ $("#abortMergeBtn").hide().prop("disabled",true);
+ }
+
self.amend = function(message, details) {
if (self.commitMsgEmpty()) {
$.ajax({
@@ -3274,6 +3351,7 @@ webui.NewChangedFilesView = function(workspaceView) {
'' +
'' +
'' +
+ '' +
'' +
'' +
'' +
diff --git a/git-webui/src/share/git-webui/webui/js/git-webui.js b/git-webui/src/share/git-webui/webui/js/git-webui.js
index b34d1886..ff17702d 100644
--- a/git-webui/src/share/git-webui/webui/js/git-webui.js
+++ b/git-webui/src/share/git-webui/webui/js/git-webui.js
@@ -2805,8 +2805,21 @@ webui.NewChangedFilesView = function(workspaceView) {
}
});
+
+ $("#abortMergeBtn").off("click");
+ $("#abortMergeBtn").on("click", function() {
+ self.confirmAbortMerge();
+ })
});
});
+
+ webui.git_command(["rev-parse", "--quiet", "--verify", "MERGE_HEAD"], function () {
+ // success code with --verify means MERGE_HEAD exists
+ $("#abortMergeBtn").show().prop("disabled",false);
+ }, null, function() {
+ // error code with --verify means MERGE_HEAD does not exist
+ $("#abortMergeBtn").hide().prop("disabled",true);
+ })
}
self.confirmDiscard = function() {
@@ -2920,6 +2933,63 @@ webui.NewChangedFilesView = function(workspaceView) {
});
}
+ self.confirmAbortMerge = function() {
+ function removePopup(popup) {
+ $(popup).children(".modal-fade").modal("hide");
+ $(".modal-backdrop").remove();
+ $("#confirmAbortMerge").remove();
+ }
+
+ var popup = $(
+ '' +
+ '
' +
+ '
' +
+ '' +
+ '
' +
+ '' +
+ '
' +
+ '
' +
+ '
'
+ )[0];
+
+ $("body").append(popup);
+ var popupContent = $(".modal-body", popup)[0];
+ webui.detachChildren(popupContent);
+
+ $(
+ '' +
+ '
' +
+ webui.warningIcon +
+ '
' +
+ '
' +
+ '
A merge is in progress. Are you sure you want to abort it?
' +
+ '
' +
+ '
'
+ ).appendTo(popupContent);
+
+ var popupFooter = $(".modal-footer", popup)[0];
+ webui.detachChildren(popupFooter);
+
+ $(
+ '' +
+ ''
+ ).appendTo(popupFooter);
+
+ $(popup).modal('show');
+
+ $('#confirmAbortMergeBtn').on('click', function() {
+ removePopup(popup);
+ self.abortMerge();
+ });
+
+ $('#confirmAbortMerge').find('#cancelAbortMergeBtn, .close').click(function() {
+ removePopup(popup);
+ });
+ }
+
// Popup for when trying to commit to default merge branch in basic mode
self.noCommitsOnDefault = function () {
function removePopup(popup) {
@@ -3172,6 +3242,13 @@ webui.NewChangedFilesView = function(workspaceView) {
webui.git_command(["add", "--"].concat(selectedItems), restoreCommand,undefined,restoreCommand);
}
+ self.abortMerge = function() {
+ webui.git_command(["merge", "--abort"], function() {
+ workspaceView.update();
+ });
+ $("#abortMergeBtn").hide().prop("disabled",true);
+ }
+
self.amend = function(message, details) {
if (self.commitMsgEmpty()) {
$.ajax({
@@ -3274,6 +3351,7 @@ webui.NewChangedFilesView = function(workspaceView) {
'' +
'' +
'' +
+ '' +
'' +
'' +
'' +
From 245fbb77062bee12316968da38487843d31a8898 Mon Sep 17 00:00:00 2001
From: Pravin Barton <9560941+isc-pbarton@users.noreply.github.com>
Date: Wed, 12 Nov 2025 11:02:50 -0500
Subject: [PATCH 2/3] Change label of unmerged changes based on user feedback
---
git-webui/release/share/git-webui/webui/css/git-webui.css | 2 +-
git-webui/src/share/git-webui/webui/css/git-webui.less | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/git-webui/release/share/git-webui/webui/css/git-webui.css b/git-webui/release/share/git-webui/webui/css/git-webui.css
index bc9565a5..d5958433 100644
--- a/git-webui/release/share/git-webui/webui/css/git-webui.css
+++ b/git-webui/release/share/git-webui/webui/css/git-webui.css
@@ -982,7 +982,7 @@ body {
right: 5px;
}
#changedFilesContainer .file-area .U::after {
- content: "Unmerged";
+ content: "Merge Conflict";
position: absolute;
right: 5px;
color: red;
diff --git a/git-webui/src/share/git-webui/webui/css/git-webui.less b/git-webui/src/share/git-webui/webui/css/git-webui.less
index e5a9e3ea..3183206a 100644
--- a/git-webui/src/share/git-webui/webui/css/git-webui.less
+++ b/git-webui/src/share/git-webui/webui/css/git-webui.less
@@ -985,7 +985,7 @@ body {
}
.U::after {
- content: "Unmerged";
+ content: "Merge Conflict";
position: absolute;
right: 5px;
color: red;
From 23f04ec15f691c45aabb37a360266de66818c72f Mon Sep 17 00:00:00 2001
From: Pravin Barton <9560941+isc-pbarton@users.noreply.github.com>
Date: Wed, 12 Nov 2025 12:03:01 -0500
Subject: [PATCH 3/3] fix description in CHANGELOG of unmerged changes label
---
CHANGELOG.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 37df1a33..13957879 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -12,7 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Web UI workspace view now has an option to abort merge in progress (#895)
## Fixed
-- Web UI workspace view labels changes as Unmerged if there are merge conflicts (#890)
+- Web UI workspace view labels changes as Merge Conflict if there are unmerged changes (#890)
## [2.14.0] - 2025-11-07