aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorJonas Bernoulli <jonas@bernoul.li>2024-11-26 20:00:50 +0100
committerJonas Bernoulli <jonas@bernoul.li>2024-11-26 20:00:50 +0100
commite52dedf07f7726528cd006db88235c23a481351d (patch)
tree95064f368379aad7c4a4596e2ad5cbeb31127108 /docs
parent98667fa8b2ee051e967e1929db648777166b905c (diff)
magit-stash-{pop,apply}: Stop after successfully installing conflict
If we cannot successfully install the conflict with "git stash apply --index", we also try "git stash apply", and if that fails as well, we continue with "git apply --3way". That assumed that we could tell whether a stash was either applied with no conflict or the conflict was successfully installed by, or else the conflict could not be installed, by checking status. Unfortunately it turns out that the exit status is also 1 if the conflict was successfully installed. Instead we have to look at the output. Unfortunately we can only do that for Git v2.38.0 and later, and have to fall back to the less convenient behavior provided by Git itself. Closes #5253.
Diffstat (limited to 'docs')
-rw-r--r--docs/magit.org10
-rw-r--r--docs/magit.texi10
2 files changed, 20 insertions, 0 deletions
diff --git a/docs/magit.org b/docs/magit.org
index 14fdc7f..981fbb7 100644
--- a/docs/magit.org
+++ b/docs/magit.org
@@ -6423,6 +6423,11 @@ Also see [[man:git-stash]]
Apply a stash to the working tree.
+ When using a Git release before v2.38.0, simply run ~git stash apply~
+ or with a prefix argument ~git stash apply --index~.
+
+ When using Git v2.38.0 or later, behave more intelligently:
+
First try ~git stash apply --index~, which tries to preserve
the index stored in the stash, if any. This may fail because
applying the stash could result in conflicts and those have to
@@ -6448,6 +6453,11 @@ Also see [[man:git-stash]]
stash can be applied without any conflicts, and while preserving
the stash's index) then remove the stash from stash list.
+ When using a Git release before v2.38.0, simply run ~git stash pop~
+ or with a prefix argument ~git stash pop --index~.
+
+ When using Git v2.38.0 or later, behave more intelligently:
+
First try ~git stash pop --index~, which tries to preserve
the index stored in the stash, if any. This may fail because
applying the stash could result in conflicts and those have to
diff --git a/docs/magit.texi b/docs/magit.texi
index f00d9e7..b4ee44b 100644
--- a/docs/magit.texi
+++ b/docs/magit.texi
@@ -7913,6 +7913,11 @@ prefix arguments are equivalent to @code{--all}-.
@findex magit-stash-apply
Apply a stash to the working tree.
+When using a Git release before v2.38.0, simply run @code{git stash apply}
+or with a prefix argument @code{git stash apply --index}.
+
+When using Git v2.38.0 or later, behave more intelligently:
+
First try @code{git stash apply --index}, which tries to preserve
the index stored in the stash, if any. This may fail because
applying the stash could result in conflicts and those have to
@@ -7939,6 +7944,11 @@ Apply a stash to the working tree. On complete success (if the
stash can be applied without any conflicts, and while preserving
the stash's index) then remove the stash from stash list.
+When using a Git release before v2.38.0, simply run @code{git stash pop}
+or with a prefix argument @code{git stash pop --index}.
+
+When using Git v2.38.0 or later, behave more intelligently:
+
First try @code{git stash pop --index}, which tries to preserve
the index stored in the stash, if any. This may fail because
applying the stash could result in conflicts and those have to