From: D. Ben Knoble Date: Sat, 10 May 2025 18:33:38 GMT Subject: [PATCH 3/9] BreakingChanges: announce stash {apply,pop} will imply --index Message-ID: <20250510183358.36806-4-ben.knoble+github@gmail.com> In-Reply-To: <20250510183358.36806-1-ben.knoble+github@gmail.com> Some uses may now require --no-index, but remove a footgun that has bit users over the years where stash {apply,pop} are not the opposite of stash push because they drop the (saved) index. Signed-off-by: D. Ben Knoble --- Notes: Dscho/Junio suggested it in the original thread [1], but it wasn't considered for the release I believe [2]. [1]: https://lore.kernel.org/git/Pine.LNX.4.64.0707021213350.4438@racer.site/ [2]: https://lore.kernel.org/git/7vzm20q1l7.fsf_-_@assigned-by-dhcp.cox.net/ Documentation/BreakingChanges.adoc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Documentation/BreakingChanges.adoc b/Documentation/BreakingChanges.adoc index 61bdd586b9..798e742267 100644 --- a/Documentation/BreakingChanges.adoc +++ b/Documentation/BreakingChanges.adoc @@ -118,6 +118,17 @@ Cf. <2f5de416-04ba-c23d-1e0b-83bb655829a7@zombino.com>, <20170223155046.e7nxivfwqqoprsqj@LykOS.localdomain>, . +* The git-stash(1) command now tries to reinstate the index by default in + the "apply" and "pop" modes. Not doing so creates a common trap: "git stash + apply" is not the reverse of "git stash push" because carefully staged indices + are lost and have to be manually recreated. ++ +Now git-stash(1) will behave like "--index" was given in the "apply" and "pop" +modes. Use "--no-index" to disable this behavior. ++ +Cf. , +. + === Removals * Support for grafting commits has long been superseded by git-replace(1). -- 2.48.1