emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/git-commit ad8eb7f33a: magit-sequencer-continue: Abort for


From: ELPA Syncer
Subject: [nongnu] elpa/git-commit ad8eb7f33a: magit-sequencer-continue: Abort for unmerged, not unstaged, content
Date: Tue, 1 Mar 2022 23:58:01 -0500 (EST)

branch: elpa/git-commit
commit ad8eb7f33a0037c8a1a4ba255011e98c241fdad9
Author: Kyle Meyer <kyle@kyleam.com>
Commit: Kyle Meyer <kyle@kyleam.com>

    magit-sequencer-continue: Abort for unmerged, not unstaged, content
    
    magit-sequencer-continue signals a user error if there are any
    unstaged changes.  However, that's stricter than the behavior of 'git
    cherry-pick --continue' and 'git revert --continue', which are okay
    with unstaged modifications in files without conflicts.
    
    To support this behavior, one option would be to drop the guard
    entirely and let 'git (cherry-pick|revert) --continue' do the error
    reporting.  However, the reason the Lisp error was added in the first
    place was in response users reporting these Git failures as a bug.
    
    So instead signal a user-error if there are unmerged files.  It's
    possible that this narrower condition lets through a few rare cases
    that trigger a '(cherry-pick|revert) --continue' failure, but those
    are hopefully uncommon enough that they won't prompt bug reports.
    
    Closes #4615.
---
 docs/RelNotes/3.4.0.org | 4 ++++
 lisp/magit-sequence.el  | 4 ++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/docs/RelNotes/3.4.0.org b/docs/RelNotes/3.4.0.org
index 5021c97843..f927a0d0cd 100644
--- a/docs/RelNotes/3.4.0.org
+++ b/docs/RelNotes/3.4.0.org
@@ -24,6 +24,10 @@
   default) to support partial cloning, a feature that is available as
   of Git v2.17.  #4102
 
+- A cherry pick or revert can now be continued when there are unstaged
+  changes as long as there are no unresolved conflicts, a behavior
+  that more closely matches the command line behavior.  #4615
+
 ** Fixes since v3.3.0
 
 - Automatic saving of file-visiting buffers was broken inside remote
diff --git a/lisp/magit-sequence.el b/lisp/magit-sequence.el
index d9848e93d9..d200e909a2 100644
--- a/lisp/magit-sequence.el
+++ b/lisp/magit-sequence.el
@@ -95,8 +95,8 @@
   "Resume the current cherry-pick or revert sequence."
   (interactive)
   (if (magit-sequencer-in-progress-p)
-      (if (magit-anything-unstaged-p t)
-          (user-error "Cannot continue due to unstaged changes")
+      (if (magit-anything-unmerged-p)
+          (user-error "Cannot continue due to unresolved conflicts")
         (magit-run-git-sequencer
          (if (magit-revert-in-progress-p) "revert" "cherry-pick") 
"--continue"))
     (user-error "No cherry-pick or revert in progress")))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]