Skip to content

Commit b9f791a

Browse files
committed
Merge branch 'js/no-more-legacy-stash'
Removal of unused code and doc. * js/no-more-legacy-stash: stash: stop warning about the obsolete `stash.useBuiltin` config setting stash: remove documentation for `stash.useBuiltin` add: remove support for `git-legacy-stash` git-sh-setup: remove remnant bits referring to `git-legacy-stash`
2 parents 9a16099 + e9b272e commit b9f791a

File tree

5 files changed

+0
-47
lines changed

5 files changed

+0
-47
lines changed

Documentation/config/stash.txt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
stash.useBuiltin::
2-
Unused configuration variable. Used in Git versions 2.22 to
3-
2.26 as an escape hatch to enable the legacy shellscript
4-
implementation of stash. Now the built-in rewrite of it in C
5-
is always used. Setting this will emit a warning, to alert any
6-
remaining users that setting this now does nothing.
7-
81
stash.showIncludeUntracked::
92
If this is set to true, the `git stash show` command will show
103
the untracked files of a stash entry. Defaults to false. See

builtin/add.c

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ static int add_renormalize;
3232
static int pathspec_file_nul;
3333
static int include_sparse;
3434
static const char *pathspec_from_file;
35-
static int legacy_stash_p; /* support for the scripted `git stash` */
3635

3736
struct update_callback_data {
3837
int flags;
@@ -388,8 +387,6 @@ static struct option builtin_add_options[] = {
388387
N_("override the executable bit of the listed files")),
389388
OPT_HIDDEN_BOOL(0, "warn-embedded-repo", &warn_on_embedded_repo,
390389
N_("warn when adding an embedded repository")),
391-
OPT_HIDDEN_BOOL(0, "legacy-stash-p", &legacy_stash_p,
392-
N_("backend for `git stash -p`")),
393390
OPT_PATHSPEC_FROM_FILE(&pathspec_from_file),
394391
OPT_PATHSPEC_FILE_NUL(&pathspec_file_nul),
395392
OPT_END(),
@@ -512,17 +509,6 @@ int cmd_add(int argc, const char **argv, const char *prefix)
512509
die(_("options '%s' and '%s' cannot be used together"), "--pathspec-from-file", "--interactive/--patch");
513510
exit(interactive_add(argv + 1, prefix, patch_interactive));
514511
}
515-
if (legacy_stash_p) {
516-
struct pathspec pathspec;
517-
518-
parse_pathspec(&pathspec, 0,
519-
PATHSPEC_PREFER_FULL |
520-
PATHSPEC_SYMLINK_LEADING_PATH |
521-
PATHSPEC_PREFIX_ORIGIN,
522-
prefix, argv);
523-
524-
return run_add_interactive(NULL, "--patch=stash", &pathspec);
525-
}
526512

527513
if (edit_interactive) {
528514
if (pathspec_from_file)

builtin/stash.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -788,7 +788,6 @@ static int list_stash(int argc, const char **argv, const char *prefix)
788788
static int show_stat = 1;
789789
static int show_patch;
790790
static int show_include_untracked;
791-
static int use_legacy_stash;
792791

793792
static int git_stash_config(const char *var, const char *value, void *cb)
794793
{
@@ -804,10 +803,6 @@ static int git_stash_config(const char *var, const char *value, void *cb)
804803
show_include_untracked = git_config_bool(var, value);
805804
return 0;
806805
}
807-
if (!strcmp(var, "stash.usebuiltin")) {
808-
use_legacy_stash = !git_config_bool(var, value);
809-
return 0;
810-
}
811806
return git_diff_basic_config(var, value, cb);
812807
}
813808

@@ -1782,11 +1777,6 @@ int cmd_stash(int argc, const char **argv, const char *prefix)
17821777

17831778
git_config(git_stash_config, NULL);
17841779

1785-
if (use_legacy_stash ||
1786-
!git_env_bool("GIT_TEST_STASH_USE_BUILTIN", -1))
1787-
warning(_("the stash.useBuiltin support has been removed!\n"
1788-
"See its entry in 'git help config' for details."));
1789-
17901780
argc = parse_options(argc, argv, prefix, options, git_stash_usage,
17911781
PARSE_OPT_KEEP_UNKNOWN | PARSE_OPT_KEEP_DASHDASH);
17921782

git-sh-setup.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ $LONG_USAGE")"
101101
case "$1" in
102102
-h)
103103
echo "$LONG_USAGE"
104-
case "$0" in *git-legacy-stash) exit 129;; esac
105104
exit
106105
esac
107106
fi

t/t3903-stash.sh

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1272,7 +1272,6 @@ test_expect_success 'stash works when user.name and user.email are not set' '
12721272
>2 &&
12731273
git add 2 &&
12741274
test_config user.useconfigonly true &&
1275-
test_config stash.usebuiltin true &&
12761275
(
12771276
sane_unset GIT_AUTHOR_NAME &&
12781277
sane_unset GIT_AUTHOR_EMAIL &&
@@ -1323,20 +1322,6 @@ test_expect_success 'stash handles skip-worktree entries nicely' '
13231322
git rev-parse --verify refs/stash:A.t
13241323
'
13251324

1326-
test_expect_success 'stash -c stash.useBuiltin=false warning ' '
1327-
expected="stash.useBuiltin support has been removed" &&
1328-
1329-
git -c stash.useBuiltin=false stash 2>err &&
1330-
test_i18ngrep "$expected" err &&
1331-
env GIT_TEST_STASH_USE_BUILTIN=false git stash 2>err &&
1332-
test_i18ngrep "$expected" err &&
1333-
1334-
git -c stash.useBuiltin=true stash 2>err &&
1335-
test_must_be_empty err &&
1336-
env GIT_TEST_STASH_USE_BUILTIN=true git stash 2>err &&
1337-
test_must_be_empty err
1338-
'
1339-
13401325
test_expect_success 'git stash succeeds despite directory/file change' '
13411326
test_create_repo directory_file_switch_v1 &&
13421327
(

0 commit comments

Comments
 (0)