From 5f90bf0b4e1690d3a26e313146de96b71614c6d7 Mon Sep 17 00:00:00 2001 From: Elijah Tamarchenko Date: Thu, 21 Nov 2024 16:32:46 -0500 Subject: [PATCH 1/7] fix stash merge conflicts --- CHANGELOG.md | 3 + cls/SourceControl/Git/WebUIDriver.cls | 70 ++++++++++++++----- .../share/git-webui/webui/js/git-webui.js | 10 ++- .../src/share/git-webui/webui/js/git-webui.js | 10 ++- 4 files changed, 69 insertions(+), 24 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 46dcc89a..df33dfb2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added filtering through branch names in UI (#615) - FullLoad pull event handler allows deploying changes with a full import of the repository (#619) +### Fixed +- Fixed merge conflict resolution on stash popping (#531) + ## [2.7.1] - 2024-11-13 ### Fixed diff --git a/cls/SourceControl/Git/WebUIDriver.cls b/cls/SourceControl/Git/WebUIDriver.cls index fe91feb8..4506e514 100644 --- a/cls/SourceControl/Git/WebUIDriver.cls +++ b/cls/SourceControl/Git/WebUIDriver.cls @@ -218,27 +218,61 @@ ClassMethod HandleRequest(pagePath As %String, InternalName As %String = "", Out } else { set inFile = "" } + // Want to invoke merge conflict autoresolver in case of issues + if (($piece(args, " ", 1, 2) = "stash pop") || ($piece(args, " ", 1, 2) = "stash apply")) { + set succeeded = 0 + set initTLevel = $TLEVEL + try { + TSTART + set returnCode = ##class(SourceControl.Git.Utils).RunGitCommandWithInput("-c",inFile,.errStream,.outStream,gitArgs...) + if (returnCode '= 0) { + $$$ThrowStatus($$$ERROR($$$GeneralError,"git stash pop reported failure")) + } + set succeeded = 1 + TCOMMIT + } catch e { + write !,"Attempting to resolve differences in production definition..." + set resolver = ##class(SourceControl.Git.Util.ResolutionManager).FromLog(outStream) + if resolver.resolved { + set succeeded = 1 + TCOMMIT + write " success!" + } else { + write " unable to resolve - "_resolver.errorMessage + } + } + while $TLevel > initTLevel { + TROLLBACK 1 + } + set %data = ##class(%Stream.TmpCharacter).%New() + if succeeded { + do %data.WriteLine("Stash pop/apply succeeded!") + } else { + do %data.WriteLine("ERROR: Stash pop/apply encountered merge conflict, aborted. Please apply stashed changes manually.") + } + do %data.Rewind() + } else { + set returnCode = ##class(SourceControl.Git.Utils).RunGitCommandWithInput("-c",inFile,.errStream,.outStream,gitArgs...) + + set %data = ##class(%Stream.TmpCharacter).%New() + set changeTerminators = (%data.LineTerminator '= $char(13,10)) + set %data.LineTerminator = $char(13,10) // For the CSPGateway. + do outStream.Rewind() + while 'outStream.AtEnd { + do %data.WriteLine(outStream.ReadLine()) + } - set returnCode = ##class(SourceControl.Git.Utils).RunGitCommandWithInput("-c",inFile,.errStream,.outStream,gitArgs...) - - set %data = ##class(%Stream.TmpCharacter).%New() - set changeTerminators = (%data.LineTerminator '= $char(13,10)) - set %data.LineTerminator = $char(13,10) // For the CSPGateway. - do outStream.Rewind() - while 'outStream.AtEnd { - do %data.WriteLine(outStream.ReadLine()) - } + set nLines = 0 + do errStream.Rewind() + while 'errStream.AtEnd { + do %data.WriteLine(errStream.ReadLine()) + set:changeTerminators nLines = nLines + 1 + } - set nLines = 0 - do errStream.Rewind() - while 'errStream.AtEnd { - do %data.WriteLine(errStream.ReadLine()) - set:changeTerminators nLines = nLines + 1 + do %data.WriteLine("Git-Stderr-Length: " _ (errStream.Size + nLines)) + do %data.Write("Git-Return-Code: " _ returnCode) // No ending newline expected + do %data.Rewind() } - - do %data.WriteLine("Git-Stderr-Length: " _ (errStream.Size + nLines)) - do %data.Write("Git-Return-Code: " _ returnCode) // No ending newline expected - do %data.Rewind() if '$listfind(readOnlyCommands,baseCommand) { do ##class(SourceControl.Git.Change).RefreshUncommitted(,,,1) } 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 7c3acf18..ee44d200 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 @@ -1906,9 +1906,13 @@ webui.DiffView = function(sideBySide, hunkSelectionAllowed, parent, stashedCommi } var stashIndex = parseInt($(".log-entry.active .stash-list-index").text()); webui.git("stash pop stash@{"+stashIndex+"}", function(output){ - webui.showSuccess(output); - parent.stashView.update(0); - self.clear(); + if (output.substring(0,5) == "ERROR") { + webui.showError(output) + } else { + webui.showSuccess(output); + parent.stashView.update(0); + self.clear(); + } }); } 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 7c3acf18..ee44d200 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 @@ -1906,9 +1906,13 @@ webui.DiffView = function(sideBySide, hunkSelectionAllowed, parent, stashedCommi } var stashIndex = parseInt($(".log-entry.active .stash-list-index").text()); webui.git("stash pop stash@{"+stashIndex+"}", function(output){ - webui.showSuccess(output); - parent.stashView.update(0); - self.clear(); + if (output.substring(0,5) == "ERROR") { + webui.showError(output) + } else { + webui.showSuccess(output); + parent.stashView.update(0); + self.clear(); + } }); } From bb65f1fe0810c8e6eeced42fbd7dd45df9f80e04 Mon Sep 17 00:00:00 2001 From: Elijah Tamarchenko Date: Thu, 21 Nov 2024 16:48:43 -0500 Subject: [PATCH 2/7] fix user alerting for stash --- .../release/share/git-webui/webui/js/git-webui.js | 12 +++++++++--- git-webui/src/share/git-webui/webui/js/git-webui.js | 12 +++++++++--- 2 files changed, 18 insertions(+), 6 deletions(-) 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 ee44d200..9269b85e 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 @@ -1895,8 +1895,14 @@ webui.DiffView = function(sideBySide, hunkSelectionAllowed, parent, stashedCommi return; } var stashIndex = parseInt($(".log-entry.active .stash-list-index").text()); - webui.git("stash apply stash@{"+stashIndex+"}", function(output){ - webui.showSuccess(output); + $.post("git", {command: "stash apply stash@{"+stashIndex+"}"}, function(output) { + if (output.substring(0,5) == "ERROR") { + webui.showError(output) + } else { + webui.showSuccess(output); + parent.stashView.update(0); + self.clear(); + } }); } @@ -1905,7 +1911,7 @@ webui.DiffView = function(sideBySide, hunkSelectionAllowed, parent, stashedCommi return; } var stashIndex = parseInt($(".log-entry.active .stash-list-index").text()); - webui.git("stash pop stash@{"+stashIndex+"}", function(output){ + $.post("git", {command: "stash pop stash@{"+stashIndex+"}"}, function(output) { if (output.substring(0,5) == "ERROR") { webui.showError(output) } else { 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 ee44d200..9269b85e 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 @@ -1895,8 +1895,14 @@ webui.DiffView = function(sideBySide, hunkSelectionAllowed, parent, stashedCommi return; } var stashIndex = parseInt($(".log-entry.active .stash-list-index").text()); - webui.git("stash apply stash@{"+stashIndex+"}", function(output){ - webui.showSuccess(output); + $.post("git", {command: "stash apply stash@{"+stashIndex+"}"}, function(output) { + if (output.substring(0,5) == "ERROR") { + webui.showError(output) + } else { + webui.showSuccess(output); + parent.stashView.update(0); + self.clear(); + } }); } @@ -1905,7 +1911,7 @@ webui.DiffView = function(sideBySide, hunkSelectionAllowed, parent, stashedCommi return; } var stashIndex = parseInt($(".log-entry.active .stash-list-index").text()); - webui.git("stash pop stash@{"+stashIndex+"}", function(output){ + $.post("git", {command: "stash pop stash@{"+stashIndex+"}"}, function(output) { if (output.substring(0,5) == "ERROR") { webui.showError(output) } else { From 73b74e8dea2b8a062af01e25559551de793320b2 Mon Sep 17 00:00:00 2001 From: Elijah Tamarchenko Date: Thu, 5 Dec 2024 10:06:20 -0500 Subject: [PATCH 3/7] Refactor stash --- cls/SourceControl/Git/Utils.cls | 32 +++++ cls/SourceControl/Git/WebUIDriver.cls | 124 ++++++++---------- .../share/git-webui/webui/js/git-webui.js | 26 ++-- .../src/share/git-webui/webui/js/git-webui.js | 26 ++-- 4 files changed, 107 insertions(+), 101 deletions(-) diff --git a/cls/SourceControl/Git/Utils.cls b/cls/SourceControl/Git/Utils.cls index aafa49c4..5acfd27e 100644 --- a/cls/SourceControl/Git/Utils.cls +++ b/cls/SourceControl/Git/Utils.cls @@ -3038,4 +3038,36 @@ ClassMethod InDefaultBranchBasicMode() As %Boolean quit 0 } +ClassMethod RunGitAndHandleMerge(command As %String, inFile As %String, Output resolver As SourceControl.Git.Util.ProductionConflictResolver, Output succeeded As %Boolean, Output returnCode As %String, Output errStream, Output outStream, args...) As %Status +{ + set succeeded = 0 + set initTLevel = $TLEVEL + try { + TSTART + set returnCode = ##class(SourceControl.Git.Utils).RunGitCommandWithInput(command,inFile,.errStream,.outStream, args...) + if (returnCode '= 0) { + $$$ThrowStatus($$$ERROR($$$GeneralError,"git reported failure")) + } + set succeeded = 1 + TCOMMIT + } catch e { + write !,"Attempting to resolve differences in production definition..." + set resolver = ##class(SourceControl.Git.Util.ResolutionManager).FromLog(outStream) + if resolver.resolved { + set succeeded = 1 + TCOMMIT + write " success!" + } else { + write " unable to resolve - "_resolver.errorMessage + } + } + while $TLevel > initTLevel { + TROLLBACK 1 + } + if succeeded { + return $$$OK + } + return $$$ERROR($$$GeneralError,"git reported failure") +} + } diff --git a/cls/SourceControl/Git/WebUIDriver.cls b/cls/SourceControl/Git/WebUIDriver.cls index 4506e514..d8c1d3ff 100644 --- a/cls/SourceControl/Git/WebUIDriver.cls +++ b/cls/SourceControl/Git/WebUIDriver.cls @@ -219,60 +219,26 @@ ClassMethod HandleRequest(pagePath As %String, InternalName As %String = "", Out set inFile = "" } // Want to invoke merge conflict autoresolver in case of issues - if (($piece(args, " ", 1, 2) = "stash pop") || ($piece(args, " ", 1, 2) = "stash apply")) { - set succeeded = 0 - set initTLevel = $TLEVEL - try { - TSTART - set returnCode = ##class(SourceControl.Git.Utils).RunGitCommandWithInput("-c",inFile,.errStream,.outStream,gitArgs...) - if (returnCode '= 0) { - $$$ThrowStatus($$$ERROR($$$GeneralError,"git stash pop reported failure")) - } - set succeeded = 1 - TCOMMIT - } catch e { - write !,"Attempting to resolve differences in production definition..." - set resolver = ##class(SourceControl.Git.Util.ResolutionManager).FromLog(outStream) - if resolver.resolved { - set succeeded = 1 - TCOMMIT - write " success!" - } else { - write " unable to resolve - "_resolver.errorMessage - } - } - while $TLevel > initTLevel { - TROLLBACK 1 - } - set %data = ##class(%Stream.TmpCharacter).%New() - if succeeded { - do %data.WriteLine("Stash pop/apply succeeded!") - } else { - do %data.WriteLine("ERROR: Stash pop/apply encountered merge conflict, aborted. Please apply stashed changes manually.") - } - do %data.Rewind() - } else { - set returnCode = ##class(SourceControl.Git.Utils).RunGitCommandWithInput("-c",inFile,.errStream,.outStream,gitArgs...) - - set %data = ##class(%Stream.TmpCharacter).%New() - set changeTerminators = (%data.LineTerminator '= $char(13,10)) - set %data.LineTerminator = $char(13,10) // For the CSPGateway. - do outStream.Rewind() - while 'outStream.AtEnd { - do %data.WriteLine(outStream.ReadLine()) - } - - set nLines = 0 - do errStream.Rewind() - while 'errStream.AtEnd { - do %data.WriteLine(errStream.ReadLine()) - set:changeTerminators nLines = nLines + 1 - } + set returnCode = ##class(SourceControl.Git.Utils).RunGitCommandWithInput("-c",inFile,.errStream,.outStream,gitArgs...) + + set %data = ##class(%Stream.TmpCharacter).%New() + set changeTerminators = (%data.LineTerminator '= $char(13,10)) + set %data.LineTerminator = $char(13,10) // For the CSPGateway. + do outStream.Rewind() + while 'outStream.AtEnd { + do %data.WriteLine(outStream.ReadLine()) + } - do %data.WriteLine("Git-Stderr-Length: " _ (errStream.Size + nLines)) - do %data.Write("Git-Return-Code: " _ returnCode) // No ending newline expected - do %data.Rewind() + set nLines = 0 + do errStream.Rewind() + while 'errStream.AtEnd { + do %data.WriteLine(errStream.ReadLine()) + set:changeTerminators nLines = nLines + 1 } + + do %data.WriteLine("Git-Stderr-Length: " _ (errStream.Size + nLines)) + do %data.Write("Git-Return-Code: " _ returnCode) // No ending newline expected + do %data.Rewind() if '$listfind(readOnlyCommands,baseCommand) { do ##class(SourceControl.Git.Change).RefreshUncommitted(,,,1) } @@ -318,24 +284,48 @@ ClassMethod HandleRequest(pagePath As %String, InternalName As %String = "", Out } set inFile = "" + if (gitCmd = "stash") { + set st = ##class(SourceControl.Git.Utils).RunGitAndHandleMerge("-c",inFile, .resolver, .succeeded, .returnCode, .errStream, .outStream, argsArr...) + + set %data = ##class(%Stream.TmpCharacter).%New() + set changeTerminators = (%data.LineTerminator '= $char(13,10)) + set %data.LineTerminator = $char(13,10) // For the CSPGateway. + do outStream.Rewind() - set returnCode = ##class(SourceControl.Git.Utils).RunGitCommandWithInput("-c", inFile, .errStream, .outStream, argsArr...) - set %data = ##class(%Stream.TmpCharacter).%New() - set changeTerminators = (%data.LineTerminator '= $char(13,10)) - set %data.LineTerminator = $char(13,10) // For the CSPGateway. - while 'outStream.AtEnd { - do %data.WriteLine(outStream.ReadLine()) - } + // Don't show merge error if merge succeeded + if succeeded { + do %data.WriteLine(outStream.ReadLine()) + do %data.WriteLine("Git-Stderr-Length: " _ 0) + } else { + set nLines = 0 + do errStream.Rewind() + while 'errStream.AtEnd { + do %data.WriteLine(errStream.ReadLine()) + set:changeTerminators nLines = nLines + 1 + } + do %data.WriteLine("Git-Stderr-Length: " _ (errStream.Size + nLines)) + } + do %data.Write("Git-Return-Code: " _ returnCode) // No ending newline expected + do %data.Rewind() + } else { + set returnCode = ##class(SourceControl.Git.Utils).RunGitCommandWithInput("-c", inFile, .errStream, .outStream, argsArr...) + set %data = ##class(%Stream.TmpCharacter).%New() + set changeTerminators = (%data.LineTerminator '= $char(13,10)) + set %data.LineTerminator = $char(13,10) // For the CSPGateway. + while 'outStream.AtEnd { + do %data.WriteLine(outStream.ReadLine()) + } - set nLines = 0 - while 'errStream.AtEnd { - do %data.WriteLine(errStream.ReadLine()) - set:changeTerminators nLines = nLines + 1 - } + set nLines = 0 + while 'errStream.AtEnd { + do %data.WriteLine(errStream.ReadLine()) + set:changeTerminators nLines = nLines + 1 + } - do %data.WriteLine("Git-Stderr-Length: " _ (errStream.Size + nLines)) - do %data.Write("Git-Return-Code: " _ returnCode) // No ending newline expected - do %data.Rewind() + do %data.WriteLine("Git-Stderr-Length: " _ (errStream.Size + nLines)) + do %data.Write("Git-Return-Code: " _ returnCode) // No ending newline expected + do %data.Rewind() + } set handled = 1 // Make sure discarded items are not in the uncommitted queue 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 9269b85e..01fa76b7 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 @@ -1895,14 +1895,10 @@ webui.DiffView = function(sideBySide, hunkSelectionAllowed, parent, stashedCommi return; } var stashIndex = parseInt($(".log-entry.active .stash-list-index").text()); - $.post("git", {command: "stash apply stash@{"+stashIndex+"}"}, function(output) { - if (output.substring(0,5) == "ERROR") { - webui.showError(output) - } else { - webui.showSuccess(output); - parent.stashView.update(0); - self.clear(); - } + webui.git_command(["stash", "apply", "stash@{"+stashIndex+"}"], function() { + workspaceView.update(); + parent.stashView.update(0); + self.clear() }); } @@ -1911,14 +1907,10 @@ webui.DiffView = function(sideBySide, hunkSelectionAllowed, parent, stashedCommi return; } var stashIndex = parseInt($(".log-entry.active .stash-list-index").text()); - $.post("git", {command: "stash pop stash@{"+stashIndex+"}"}, function(output) { - if (output.substring(0,5) == "ERROR") { - webui.showError(output) - } else { - webui.showSuccess(output); - parent.stashView.update(0); - self.clear(); - } + webui.git_command(["stash", "pop", "stash@{"+stashIndex+"}"], function() { + workspaceView.update(); + parent.stashView.update(0); + self.clear() }); } @@ -1927,7 +1919,7 @@ webui.DiffView = function(sideBySide, hunkSelectionAllowed, parent, stashedCommi return; } var stashIndex = parseInt($(".log-entry.active .stash-list-index").text()); - webui.git("stash drop stash@{"+stashIndex+"}", function(output){ + webui.git_command(["stash", "drop", "stash@{"+stashIndex+"}"], function() { webui.showSuccess(output.substring(output.indexOf("Dropped"))); parent.stashView.update(0); self.clear(); 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 9269b85e..01fa76b7 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 @@ -1895,14 +1895,10 @@ webui.DiffView = function(sideBySide, hunkSelectionAllowed, parent, stashedCommi return; } var stashIndex = parseInt($(".log-entry.active .stash-list-index").text()); - $.post("git", {command: "stash apply stash@{"+stashIndex+"}"}, function(output) { - if (output.substring(0,5) == "ERROR") { - webui.showError(output) - } else { - webui.showSuccess(output); - parent.stashView.update(0); - self.clear(); - } + webui.git_command(["stash", "apply", "stash@{"+stashIndex+"}"], function() { + workspaceView.update(); + parent.stashView.update(0); + self.clear() }); } @@ -1911,14 +1907,10 @@ webui.DiffView = function(sideBySide, hunkSelectionAllowed, parent, stashedCommi return; } var stashIndex = parseInt($(".log-entry.active .stash-list-index").text()); - $.post("git", {command: "stash pop stash@{"+stashIndex+"}"}, function(output) { - if (output.substring(0,5) == "ERROR") { - webui.showError(output) - } else { - webui.showSuccess(output); - parent.stashView.update(0); - self.clear(); - } + webui.git_command(["stash", "pop", "stash@{"+stashIndex+"}"], function() { + workspaceView.update(); + parent.stashView.update(0); + self.clear() }); } @@ -1927,7 +1919,7 @@ webui.DiffView = function(sideBySide, hunkSelectionAllowed, parent, stashedCommi return; } var stashIndex = parseInt($(".log-entry.active .stash-list-index").text()); - webui.git("stash drop stash@{"+stashIndex+"}", function(output){ + webui.git_command(["stash", "drop", "stash@{"+stashIndex+"}"], function() { webui.showSuccess(output.substring(output.indexOf("Dropped"))); parent.stashView.update(0); self.clear(); From ca2839d6ae8c9398f959e292acbfa8165d5e1d0a Mon Sep 17 00:00:00 2001 From: Elijah Tamarchenko Date: Fri, 6 Dec 2024 13:30:53 -0500 Subject: [PATCH 4/7] show successes --- git-webui/release/share/git-webui/webui/js/git-webui.js | 2 ++ git-webui/src/share/git-webui/webui/js/git-webui.js | 2 ++ 2 files changed, 4 insertions(+) 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 01fa76b7..32e419c8 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 @@ -1896,6 +1896,7 @@ webui.DiffView = function(sideBySide, hunkSelectionAllowed, parent, stashedCommi } var stashIndex = parseInt($(".log-entry.active .stash-list-index").text()); webui.git_command(["stash", "apply", "stash@{"+stashIndex+"}"], function() { + webui.showSuccess(output); workspaceView.update(); parent.stashView.update(0); self.clear() @@ -1908,6 +1909,7 @@ webui.DiffView = function(sideBySide, hunkSelectionAllowed, parent, stashedCommi } var stashIndex = parseInt($(".log-entry.active .stash-list-index").text()); webui.git_command(["stash", "pop", "stash@{"+stashIndex+"}"], function() { + webui.showSuccess(output); workspaceView.update(); parent.stashView.update(0); self.clear() 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 01fa76b7..32e419c8 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 @@ -1896,6 +1896,7 @@ webui.DiffView = function(sideBySide, hunkSelectionAllowed, parent, stashedCommi } var stashIndex = parseInt($(".log-entry.active .stash-list-index").text()); webui.git_command(["stash", "apply", "stash@{"+stashIndex+"}"], function() { + webui.showSuccess(output); workspaceView.update(); parent.stashView.update(0); self.clear() @@ -1908,6 +1909,7 @@ webui.DiffView = function(sideBySide, hunkSelectionAllowed, parent, stashedCommi } var stashIndex = parseInt($(".log-entry.active .stash-list-index").text()); webui.git_command(["stash", "pop", "stash@{"+stashIndex+"}"], function() { + webui.showSuccess(output); workspaceView.update(); parent.stashView.update(0); self.clear() From aad9338a4b87b54d4a854bf2b1ba6527a5ab57fd Mon Sep 17 00:00:00 2001 From: Elijah Tamarchenko Date: Fri, 6 Dec 2024 13:37:30 -0500 Subject: [PATCH 5/7] Remov issue code --- git-webui/release/share/git-webui/webui/js/git-webui.js | 2 -- git-webui/src/share/git-webui/webui/js/git-webui.js | 2 -- 2 files changed, 4 deletions(-) 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 32e419c8..b4b4f8ec 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 @@ -1897,7 +1897,6 @@ webui.DiffView = function(sideBySide, hunkSelectionAllowed, parent, stashedCommi var stashIndex = parseInt($(".log-entry.active .stash-list-index").text()); webui.git_command(["stash", "apply", "stash@{"+stashIndex+"}"], function() { webui.showSuccess(output); - workspaceView.update(); parent.stashView.update(0); self.clear() }); @@ -1910,7 +1909,6 @@ webui.DiffView = function(sideBySide, hunkSelectionAllowed, parent, stashedCommi var stashIndex = parseInt($(".log-entry.active .stash-list-index").text()); webui.git_command(["stash", "pop", "stash@{"+stashIndex+"}"], function() { webui.showSuccess(output); - workspaceView.update(); parent.stashView.update(0); self.clear() }); 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 32e419c8..b4b4f8ec 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 @@ -1897,7 +1897,6 @@ webui.DiffView = function(sideBySide, hunkSelectionAllowed, parent, stashedCommi var stashIndex = parseInt($(".log-entry.active .stash-list-index").text()); webui.git_command(["stash", "apply", "stash@{"+stashIndex+"}"], function() { webui.showSuccess(output); - workspaceView.update(); parent.stashView.update(0); self.clear() }); @@ -1910,7 +1909,6 @@ webui.DiffView = function(sideBySide, hunkSelectionAllowed, parent, stashedCommi var stashIndex = parseInt($(".log-entry.active .stash-list-index").text()); webui.git_command(["stash", "pop", "stash@{"+stashIndex+"}"], function() { webui.showSuccess(output); - workspaceView.update(); parent.stashView.update(0); self.clear() }); From 00ffc34c643dc86a1389a45d275707c3cef6362e Mon Sep 17 00:00:00 2001 From: Elijah Tamarchenko Date: Fri, 6 Dec 2024 13:40:15 -0500 Subject: [PATCH 6/7] Show output --- git-webui/release/share/git-webui/webui/js/git-webui.js | 4 ++-- git-webui/src/share/git-webui/webui/js/git-webui.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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 b4b4f8ec..925695b4 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 @@ -1895,7 +1895,7 @@ webui.DiffView = function(sideBySide, hunkSelectionAllowed, parent, stashedCommi return; } var stashIndex = parseInt($(".log-entry.active .stash-list-index").text()); - webui.git_command(["stash", "apply", "stash@{"+stashIndex+"}"], function() { + webui.git_command(["stash", "apply", "stash@{"+stashIndex+"}"], function(output) { webui.showSuccess(output); parent.stashView.update(0); self.clear() @@ -1907,7 +1907,7 @@ webui.DiffView = function(sideBySide, hunkSelectionAllowed, parent, stashedCommi return; } var stashIndex = parseInt($(".log-entry.active .stash-list-index").text()); - webui.git_command(["stash", "pop", "stash@{"+stashIndex+"}"], function() { + webui.git_command(["stash", "pop", "stash@{"+stashIndex+"}"], function(output) { webui.showSuccess(output); parent.stashView.update(0); self.clear() 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 b4b4f8ec..925695b4 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 @@ -1895,7 +1895,7 @@ webui.DiffView = function(sideBySide, hunkSelectionAllowed, parent, stashedCommi return; } var stashIndex = parseInt($(".log-entry.active .stash-list-index").text()); - webui.git_command(["stash", "apply", "stash@{"+stashIndex+"}"], function() { + webui.git_command(["stash", "apply", "stash@{"+stashIndex+"}"], function(output) { webui.showSuccess(output); parent.stashView.update(0); self.clear() @@ -1907,7 +1907,7 @@ webui.DiffView = function(sideBySide, hunkSelectionAllowed, parent, stashedCommi return; } var stashIndex = parseInt($(".log-entry.active .stash-list-index").text()); - webui.git_command(["stash", "pop", "stash@{"+stashIndex+"}"], function() { + webui.git_command(["stash", "pop", "stash@{"+stashIndex+"}"], function(output) { webui.showSuccess(output); parent.stashView.update(0); self.clear() From 3f59836b0411696fecb081b5152eabb6fce6a10c Mon Sep 17 00:00:00 2001 From: Elijah Tamarchenko Date: Mon, 9 Dec 2024 08:58:09 -0500 Subject: [PATCH 7/7] Updated changelog --- CHANGELOG.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 689d916f..e110546c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [2.8.1] - Unreleased + +### Fixed +- Fixed merge conflict resolution on stash popping (#531) + ## [2.8.0] - 2024-12-06 ### Added @@ -19,9 +24,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixed minor issues in Studio UI (#641) - Document save is forced before menu operations that can modify repository state -### Fixed -- Fixed merge conflict resolution on stash popping (#531) - ## [2.7.1] - 2024-11-13 ### Fixed