From: "D. Ben Knoble" <ben.knoble+github@gmail.com>
To: git@vger.kernel.org
Cc: "D. Ben Knoble" <ben.knoble+github@gmail.com>
Subject: [PATCH 0/9] make stash apply with --index by default
Date: Sat, 10 May 2025 14:33:35 -0400 [thread overview]
Message-ID: <20250510183358.36806-1-ben.knoble+github@gmail.com> (raw)
Since git-stash's inception, it has defaulted to stashing the index but not
restoring it. This has caused some confusion: change the default as part of Git
3.0 to unstash the index, too.
I ran into this myself a while back and did some digging; it appears that other
have been bit, too (see references in patch 3). Moreover, when git-stash was
originally written, defaulting with --index was suggested but not implemented
before the script merged. So this RFC should bring us back towards "less
confusing," hopefully.
The series is structured as follows:
Patches 1-2: unrelated prep/style commits noticed while working on tests.
Patch 3: update Documentation/BreakingChanges.adoc. This seems like a natural
place to discuss the proposal, so it contains no other changes.
Patch 4: make it so in builtin/stash.c.
Patches 5-9: update the impacted tests. Separated out for ease of review. I used
a style more like "split the test into 2: one with, one without breaking
changes." In retrospect, the diff might be smaller (and the 2 versions of
the test easier to compare) if I used "test_has_prereq" in the tests… but at
the cost of making the tests harder to follow. Thoughts?
D. Ben Knoble (9):
t3903: reduce dependencies on previous tests
t3905: remove unneeded blank line
BreakingChanges: announce stash {apply,pop} will imply --index
stash: restore the index by default when breaking changes are enabled
t0450: mark stash documentation as a known discrepancy
t3903: adjust stash test to account for --[no-]index with breaking
changes
t3904: adjust stash -p test to account for index states with breaking
changes
t3905: adjust stash -u tests for breaking changes
t3906: adjust stash submodule tests to account for breaking changes
Documentation/BreakingChanges.adoc | 11 ++
Documentation/git-stash.adoc | 6 ++
builtin/stash.c | 38 +++++++
t/lib-submodule-update.sh | 24 ++++-
t/t0450/adoc-help-mismatches | 1 +
t/t3903-stash.sh | 161 +++++++++++++++++++++++++++--
t/t3904-stash-patch.sh | 14 ++-
t/t3905-stash-include-untracked.sh | 40 ++++++-
8 files changed, 276 insertions(+), 19 deletions(-)
base-commit: 1ee85f0e215f22b0878d0ad4b2445d12bbb63887
--
2.48.1
next reply other threads:[~2025-05-10 18:34 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-10 18:33 D. Ben Knoble [this message]
2025-05-10 18:33 ` [PATCH 1/9] t3903: reduce dependencies on previous tests D. Ben Knoble
2025-05-10 18:33 ` [PATCH 2/9] t3905: remove unneeded blank line D. Ben Knoble
2025-05-10 18:33 ` [PATCH 3/9] BreakingChanges: announce stash {apply,pop} will imply --index D. Ben Knoble
2025-05-10 18:33 ` [PATCH 4/9] stash: restore the index by default when breaking changes are enabled D. Ben Knoble
2025-05-10 18:33 ` [PATCH 5/9] t0450: mark stash documentation as a known discrepancy D. Ben Knoble
2025-05-10 18:33 ` [PATCH 6/9] t3903: adjust stash test to account for --[no-]index with breaking changes D. Ben Knoble
2025-05-10 18:33 ` [PATCH 7/9] t3904: adjust stash -p test to account for index states " D. Ben Knoble
2025-05-10 18:33 ` [PATCH 8/9] t3905: adjust stash -u tests for " D. Ben Knoble
2025-05-10 18:33 ` [PATCH 9/9] t3906: adjust stash submodule tests to account " D. Ben Knoble
2025-05-12 12:52 ` [PATCH 0/9] make stash apply with --index by default Junio C Hamano
2025-05-20 14:36 ` D. Ben Knoble
2025-05-20 14:39 ` D. Ben Knoble
2025-09-16 0:37 ` [PATCH v2 0/4] Teach git-stash to use --index from config D. Ben Knoble
2025-09-16 0:37 ` [PATCH v2 1/4] t3903: reduce dependencies on previous tests D. Ben Knoble
2025-09-16 0:37 ` [PATCH v2 2/4] t3905: remove unneeded blank line D. Ben Knoble
2025-09-16 0:37 ` [PATCH v2 3/4] stash: refactor private config globals D. Ben Knoble
2025-09-16 0:37 ` [PATCH v2 4/4] stash: honor stash.index in apply, pop modes D. Ben Knoble
2025-09-16 9:18 ` Phillip Wood
2025-09-16 17:07 ` D. Ben Knoble
2025-09-16 9:24 ` [PATCH v2 0/4] Teach git-stash to use --index from config Phillip Wood
2025-09-16 17:06 ` D. Ben Knoble
2025-09-16 16:49 ` Junio C Hamano
2025-09-22 1:39 ` [PATCH v3 " D. Ben Knoble
2025-09-22 1:39 ` [PATCH v3 1/4] t3903: reduce dependencies on previous tests D. Ben Knoble
2025-09-22 1:39 ` [PATCH v3 2/4] t3905: remove unneeded blank line D. Ben Knoble
2025-09-22 1:39 ` [PATCH v3 3/4] stash: refactor private config globals D. Ben Knoble
2025-09-22 1:39 ` [PATCH v3 4/4] stash: honor stash.index in apply, pop modes D. Ben Knoble
2025-09-22 14:11 ` Phillip Wood
2025-09-24 20:40 ` D. Ben Knoble
2025-09-29 10:01 ` Phillip Wood
2025-10-06 12:59 ` [PATCH] doc: explain the impact of stash.index on --autostash options D. Ben Knoble
2025-10-09 22:54 ` Kristoffer Haugsbakk
2025-10-11 14:44 ` D. Ben Knoble
2025-10-11 17:28 ` Junio C Hamano
2025-10-12 18:04 ` Ben Knoble
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250510183358.36806-1-ben.knoble+github@gmail.com \
--to=ben.knoble+github@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).