]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'js/no-more-legacy-stash'
authorJunio C Hamano <gitster@pobox.com>
Wed, 16 Feb 2022 23:14:30 +0000 (15:14 -0800)
committerJunio C Hamano <gitster@pobox.com>
Wed, 16 Feb 2022 23:14:30 +0000 (15:14 -0800)
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`

Documentation/config/stash.txt
builtin/add.c
builtin/stash.c
git-sh-setup.sh
t/t3903-stash.sh

index 9ed775281fb34f4e7ce0f7277784b7d74164daa1..b9f609ed76b7f3ff41aef03ecf0ea22fd1d355ea 100644 (file)
@@ -1,10 +1,3 @@
-stash.useBuiltin::
-       Unused configuration variable.  Used in Git versions 2.22 to
-       2.26 as an escape hatch to enable the legacy shellscript
-       implementation of stash.  Now the built-in rewrite of it in C
-       is always used. Setting this will emit a warning, to alert any
-       remaining users that setting this now does nothing.
-
 stash.showIncludeUntracked::
        If this is set to true, the `git stash show` command will show
        the untracked files of a stash entry.  Defaults to false. See
index 84dff3e796918ada3777fd7c01114ff5c9521fec..3ffb86a43384f21cad4fdcc0d8549e37dba12227 100644 (file)
@@ -32,7 +32,6 @@ static int add_renormalize;
 static int pathspec_file_nul;
 static int include_sparse;
 static const char *pathspec_from_file;
-static int legacy_stash_p; /* support for the scripted `git stash` */
 
 struct update_callback_data {
        int flags;
@@ -388,8 +387,6 @@ static struct option builtin_add_options[] = {
                   N_("override the executable bit of the listed files")),
        OPT_HIDDEN_BOOL(0, "warn-embedded-repo", &warn_on_embedded_repo,
                        N_("warn when adding an embedded repository")),
-       OPT_HIDDEN_BOOL(0, "legacy-stash-p", &legacy_stash_p,
-                       N_("backend for `git stash -p`")),
        OPT_PATHSPEC_FROM_FILE(&pathspec_from_file),
        OPT_PATHSPEC_FILE_NUL(&pathspec_file_nul),
        OPT_END(),
@@ -512,17 +509,6 @@ int cmd_add(int argc, const char **argv, const char *prefix)
                        die(_("options '%s' and '%s' cannot be used together"), "--pathspec-from-file", "--interactive/--patch");
                exit(interactive_add(argv + 1, prefix, patch_interactive));
        }
-       if (legacy_stash_p) {
-               struct pathspec pathspec;
-
-               parse_pathspec(&pathspec, 0,
-                       PATHSPEC_PREFER_FULL |
-                       PATHSPEC_SYMLINK_LEADING_PATH |
-                       PATHSPEC_PREFIX_ORIGIN,
-                       prefix, argv);
-
-               return run_add_interactive(NULL, "--patch=stash", &pathspec);
-       }
 
        if (edit_interactive) {
                if (pathspec_from_file)
index 9638c56303e8e40d5a57f042b551f571c8ff6363..5897febfbec202d23fb0da2dfdc4c9cc1867127b 100644 (file)
@@ -788,7 +788,6 @@ static int list_stash(int argc, const char **argv, const char *prefix)
 static int show_stat = 1;
 static int show_patch;
 static int show_include_untracked;
-static int use_legacy_stash;
 
 static int git_stash_config(const char *var, const char *value, void *cb)
 {
@@ -804,10 +803,6 @@ static int git_stash_config(const char *var, const char *value, void *cb)
                show_include_untracked = git_config_bool(var, value);
                return 0;
        }
-       if (!strcmp(var, "stash.usebuiltin")) {
-               use_legacy_stash = !git_config_bool(var, value);
-               return 0;
-       }
        return git_diff_basic_config(var, value, cb);
 }
 
@@ -1782,11 +1777,6 @@ int cmd_stash(int argc, const char **argv, const char *prefix)
 
        git_config(git_stash_config, NULL);
 
-       if (use_legacy_stash ||
-           !git_env_bool("GIT_TEST_STASH_USE_BUILTIN", -1))
-               warning(_("the stash.useBuiltin support has been removed!\n"
-                         "See its entry in 'git help config' for details."));
-
        argc = parse_options(argc, argv, prefix, options, git_stash_usage,
                             PARSE_OPT_KEEP_UNKNOWN | PARSE_OPT_KEEP_DASHDASH);
 
index b93f39288ce41f06b0e1f564d833a40f6c8577b9..d92df37e9924719b2aa6d1c84a88d56811d2bd4f 100644 (file)
@@ -101,7 +101,6 @@ $LONG_USAGE")"
        case "$1" in
                -h)
                echo "$LONG_USAGE"
-               case "$0" in *git-legacy-stash) exit 129;; esac
                exit
        esac
 fi
index 686747e55a301a661d75c63223a7d682c30dbd4b..b149e2af44185d5a78ff7eff1e2c0efb67f35f4d 100755 (executable)
@@ -1272,7 +1272,6 @@ test_expect_success 'stash works when user.name and user.email are not set' '
        >2 &&
        git add 2 &&
        test_config user.useconfigonly true &&
-       test_config stash.usebuiltin true &&
        (
                sane_unset GIT_AUTHOR_NAME &&
                sane_unset GIT_AUTHOR_EMAIL &&
@@ -1323,20 +1322,6 @@ test_expect_success 'stash handles skip-worktree entries nicely' '
        git rev-parse --verify refs/stash:A.t
 '
 
-test_expect_success 'stash -c stash.useBuiltin=false warning ' '
-       expected="stash.useBuiltin support has been removed" &&
-
-       git -c stash.useBuiltin=false stash 2>err &&
-       test_i18ngrep "$expected" err &&
-       env GIT_TEST_STASH_USE_BUILTIN=false git stash 2>err &&
-       test_i18ngrep "$expected" err &&
-
-       git -c stash.useBuiltin=true stash 2>err &&
-       test_must_be_empty err &&
-       env GIT_TEST_STASH_USE_BUILTIN=true git stash 2>err &&
-       test_must_be_empty err
-'
-
 test_expect_success 'git stash succeeds despite directory/file change' '
        test_create_repo directory_file_switch_v1 &&
        (