{"thread":{"id":"52879","subject":"Git Rebase: test failing with GIT_TEST_STASH_USE_BUILTIN=false","startedAt":"2020-02-24T08:39:44Z","lastAt":"2020-03-06T17:29:58Z","messageCount":21,"participants":["Son Luong Ngoc","Junio C Hamano","Thomas Gummerer","Johannes Schindelin","Elijah Newren"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"392396","messageId":"61922A39-13DC-4B17-94FC-7F67DF308347@booking.com","threadId":"52879","inReplyTo":null,"subject":"Git Rebase: test failing with GIT_TEST_STASH_USE_BUILTIN=false","fromName":"Son Luong Ngoc","fromEmail":"son.luong@booking.com","sentAt":"2020-02-24T08:33:31Z","receivedAt":"2020-02-24T08:39:44Z","isPatch":false,"sender":{"key":"son.luong@booking.com","avatar":null},"body":"Hey git folks,\n\nI have been trying to build git from source and noticing that some tests have been failing since 2.25 with the flag \"GIT_TEST_STASH_USE_BUILTIN=false\"\n\nI think in 2.25 t3903.103 started to fail (rebase related) and current master t3904 may be failing also.\n\nIs \"GIT_TEST_STASH_USE_BUILTIN=false\" is still being tested with or are we totally deprecating this flag?\n\nCheers,\nSon Luong."},{"id":"392473","messageId":"xmqq36ayob9a.fsf@gitster-ct.c.googlers.com","threadId":"52879","inReplyTo":"61922A39-13DC-4B17-94FC-7F67DF308347@booking.com","subject":"Re: Git Rebase: test failing with GIT_TEST_STASH_USE_BUILTIN=false","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-02-25T16:57:37Z","receivedAt":"2020-02-25T16:57:43Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Son Luong Ngoc <son.luong@booking.com> writes:\n\n> I have been trying to build git from source and noticing that some\n> tests have been failing since 2.25 with the flag\n> \"GIT_TEST_STASH_USE_BUILTIN=false\"\n>\n> I think in 2.25 t3903.103 started to fail (rebase related) and\n> current master t3904 may be failing also.\n>\n> Is \"GIT_TEST_STASH_USE_BUILTIN=false\" is still being tested with\n> or are we totally deprecating this flag?\n\nIn the longer term, when \"git stash\" gains new features that did not\nexist in the original scripted version, tests that observe how these\nfeatures work would start failing when using the scripted version.\n\nI picked some people from \"git shortlog --no-merges builtin/stash.c\"\nand placed them on the CC line---perhaps they may know more.  It\nhappens that Johannes is also familiar with \"rebase\", which you\nsaid is involved in the test failure, so I'd imagine he would be the\nbest person to ask.\n\nThanks for a report.\n\n\n"},{"id":"392725","messageId":"89C2FD92-5616-4834-98ED-22630DA61925@gmail.com","threadId":"52879","inReplyTo":"710DB9BA-D134-48E7-8CAB-B8816FED8AB8@booking.com","subject":"Re: [External] Git Rebase: test failing with GIT_TEST_STASH_USE_BUILTIN=false","fromName":"Son Luong Ngoc","fromEmail":"sluongng@gmail.com","sentAt":"2020-03-01T09:59:03Z","receivedAt":"2020-03-01T09:59:10Z","isPatch":false,"sender":{"key":"sluongng@gmail.com","avatar":"https://avatars.githubusercontent.com/u/26684313?v=4"},"body":"(this is a resent due to git@vger.kernel.org blocked HTML content, sry for the noises)\n(following up on https://public-inbox.org/git/xmqq36ayob9a.fsf@gitster-ct.c.googlers.com/T/#t )\n\nHi folks,\n\nI ran a simple git-bisect on this to try to figure-out whats wrong:\n\n$ cat run-test.sh\n#!/bin/bash\n\nmake -j8 prefix=/usr all\n(\n  cd ./t\n  GIT_TEST_STASH_USE_BUILTIN=false ./t3903-stash.sh --run='103'\n)\n$ git bisect start master v2.22.2\n$ git bisect run ./run-test.sh\n...\n$ git bisect log\n(b932f6a5e8...)|BISECTING ~/work/booking/git/git> git bisect log\n# bad: [2d2118b814c11f509e1aa76cb07110f7231668dc] The seventh batch for 2.26\n# good: [d9589d4051537c387b70dc76e430c61b4c85a86d] Git 2.22.2\ngit bisect start 'HEAD' 'v2.22.2'\n# bad: [22dd22dce050f042b3eec165440966186691db42] Merge branch 'wb/fsmonitor-bitmap-fix'\ngit bisect bad 22dd22dce050f042b3eec165440966186691db42\n# bad: [fa9e7934c780bc804a09bfc88a93825096b3155e] Merge branch 'bm/repository-layout-typofix'\ngit bisect bad fa9e7934c780bc804a09bfc88a93825096b3155e\n# good: [3a94cb31d52f061c315b00bfc005f1b1c42ac92d] bin-wrappers: append `.exe` to target paths if necessary\ngit bisect good 3a94cb31d52f061c315b00bfc005f1b1c42ac92d\n# bad: [7b70d46ca410f9d37045558329c3143570d47ba6] Merge branch 'bb/grep-pcre2-bug-message-fix'\ngit bisect bad 7b70d46ca410f9d37045558329c3143570d47ba6\n# good: [d60dc1a0b3829f3c4d69696f43f1c178c0701cdb] Merge branch 'ew/repack-with-bitmaps-by-default'\ngit bisect good d60dc1a0b3829f3c4d69696f43f1c178c0701cdb\n# good: [43ba21cb574ee3f9a1acf4580868982f4c883ac6] Merge branch 'tg/range-diff-output-update'\ngit bisect good 43ba21cb574ee3f9a1acf4580868982f4c883ac6\n# good: [080af915a3ee4d9511dc288b29143b9958ac0adc] Merge branch 'mt/dir-iterator-updates'\ngit bisect good 080af915a3ee4d9511dc288b29143b9958ac0adc\n# bad: [75ce48674889df6a2bb493fb5d6bef0ef60ca7ae] Merge branch 'di/readme-markup-fix'\ngit bisect bad 75ce48674889df6a2bb493fb5d6bef0ef60ca7ae\n# good: [984da7f8d2589b53cca7c920e597eab30d4c1b36] Merge branch 'sr/gpg-interface-stop-at-the-end'\ngit bisect good 984da7f8d2589b53cca7c920e597eab30d4c1b36\n# bad: [f8aee8576ac5e01fa993c80b5b888af214c03758] Merge branch 'tg/stash-keep-index-with-removed-paths'\ngit bisect bad f8aee8576ac5e01fa993c80b5b888af214c03758\n# good: [b932f6a5e8cdbb33eff4563fdfb1eae9ebf70a65] stash: fix handling removed files with --keep-index\ngit bisect good b932f6a5e8cdbb33eff4563fdfb1eae9ebf70a65\n# first bad commit: [f8aee8576ac5e01fa993c80b5b888af214c03758] Merge branch 'tg/stash-keep-index-with-removed-paths'\n\nWhich pinned point the failure starting from the moment the test was added at https://github.com/git/git/commit/b932f6a5e8cdbb33eff4563fdfb1eae9ebf70a65 by @t.gummerer\n\nI would appreciate if we can either deprecate the GIT_TEST_STASH_USE_BUILTIN flag entirely or wrap the test with an 'if' so that we auto skip it when the flag is enabled.\n\nThanks,\nSon Luong.\n\n> On Feb 25, 2020, at 17:57, Junio C Hamano <gitster@pobox.com> wrote:\n> \n> Son Luong Ngoc <son.luong@booking.com> writes:\n> \n>> I have been trying to build git from source and noticing that some\n>> tests have been failing since 2.25 with the flag\n>> \"GIT_TEST_STASH_USE_BUILTIN=false\"\n>> \n>> I think in 2.25 t3903.103 started to fail (rebase related) and\n>> current master t3904 may be failing also.\n>> \n>> Is \"GIT_TEST_STASH_USE_BUILTIN=false\" is still being tested with\n>> or are we totally deprecating this flag?\n> \n> In the longer term, when \"git stash\" gains new features that did not\n> exist in the original scripted version, tests that observe how these\n> features work would start failing when using the scripted version.\n> \n> I picked some people from \"git shortlog --no-merges builtin/stash.c\"\n> and placed them on the CC line---perhaps they may know more.  It\n> happens that Johannes is also familiar with \"rebase\", which you\n> said is involved in the test failure, so I'd imagine he would be the\n> best person to ask.\n> \n> Thanks for a report.\n> \n> \n\n\n"},{"id":"392726","messageId":"F59C8901-122C-4B75-BCEC-4D8D323C78A0@gmail.com","threadId":"52879","inReplyTo":"89C2FD92-5616-4834-98ED-22630DA61925@gmail.com","subject":"Re: [External] Git Rebase: test failing with GIT_TEST_STASH_USE_BUILTIN=false","fromName":"Son Luong Ngoc","fromEmail":"sluongng@gmail.com","sentAt":"2020-03-01T10:40:56Z","receivedAt":"2020-03-01T10:41:06Z","isPatch":false,"sender":{"key":"sluongng@gmail.com","avatar":"https://avatars.githubusercontent.com/u/26684313?v=4"},"body":"Similar strategy was used for t.3904, which has been failing with this flag since 2.25.0\n\n$ cat run-test.sh\n#!/bin/bash\n\nmake -j8 prefix=/usr all\n(\n  cd ./t && GIT_TEST_STASH_USE_BUILTIN=false ./t3904-stash-patch.sh\n)\n\n$ git bisect log\n# bad: [2d2118b814c11f509e1aa76cb07110f7231668dc] The seventh batch for 2.26\n# good: [d9589d4051537c387b70dc76e430c61b4c85a86d] Git 2.22.2\ngit bisect start 'HEAD' 'v2.22.2'\n# good: [22dd22dce050f042b3eec165440966186691db42] Merge branch 'wb/fsmonitor-bitmap-fix'\ngit bisect good 22dd22dce050f042b3eec165440966186691db42\n# good: [6514ad40a1a3cf80b2c25e3318dbf0252599fb8d] Merge branch 'ra/t5150-depends-on-perl'\ngit bisect good 6514ad40a1a3cf80b2c25e3318dbf0252599fb8d\n# bad: [f52ab33616ee1d241f2292f1c1e47ba84a263523] Merge branch 'bc/hash-independent-tests-part-7'\ngit bisect bad f52ab33616ee1d241f2292f1c1e47ba84a263523\n# good: [4d924528d8bfe947abfc54ee9bd3892ab509c8cd] Revert \"Merge branch 'ra/rebase-i-more-options'\"\ngit bisect good 4d924528d8bfe947abfc54ee9bd3892ab509c8cd\n# good: [f0940743facd619f251009e0307d8d6452cc582e] Merge branch 'js/builtin-add-i-cmds'\ngit bisect good f0940743facd619f251009e0307d8d6452cc582e\n# good: [381e8e9de142b636e4a25b6df113d70168e21a34] Merge branch 'dl/test-must-fail-fixes'\ngit bisect good 381e8e9de142b636e4a25b6df113d70168e21a34\n# bad: [d0e70cd32e95df3be2250536f9089c858a298874] Merge branch 'am/checkout-file-and-ref-ref-ambiguity'\ngit bisect bad d0e70cd32e95df3be2250536f9089c858a298874\n# bad: [94ac3c31f730ab278e1373a942fb4503829f4279] terminal: make the code of disable_echo() reusable\ngit bisect bad 94ac3c31f730ab278e1373a942fb4503829f4279\n# bad: [52628f94fc35f57f0b3c54e4f849e490bfa44449] built-in add -p: implement the \"checkout\" patch modes\ngit bisect bad 52628f94fc35f57f0b3c54e4f849e490bfa44449\n# good: [36bae1dc0ee777aa529dd955f2e619281265f262] built-in add -p: implement the \"stash\" and \"reset\" patch modes\ngit bisect good 36bae1dc0ee777aa529dd955f2e619281265f262\n# bad: [6610e4628ac12396efc20201fe85d67591bed247] built-in stash: use the built-in `git add -p` if so configured\ngit bisect bad 6610e4628ac12396efc20201fe85d67591bed247\n# bad: [90a6bb98d11a664f729dbb86c90d9c7a38ea825a] legacy stash -p: respect the add.interactive.usebuiltin setting\ngit bisect bad 90a6bb98d11a664f729dbb86c90d9c7a38ea825a\n# first bad commit: [90a6bb98d11a664f729dbb86c90d9c7a38ea825a] legacy stash -p: respect the add.interactive.usebuiltin setting\n\nWhich was merged in https://github.com/gitgitgadget/git/commit/9a5315edfdf662c4d9bf444ebc297bc802fa5e04\nAuthor was Johannes Schindelin\n\nThanks,\nSon Luong.\n\n> On Mar 1, 2020, at 10:59, Son Luong Ngoc <sluongng@gmail.com> wrote:\n> \n> (this is a resent due to git@vger.kernel.org blocked HTML content, sry for the noises)\n> (following up on https://public-inbox.org/git/xmqq36ayob9a.fsf@gitster-ct.c.googlers.com/T/#t )\n> \n> Hi folks,\n> \n> I ran a simple git-bisect on this to try to figure-out whats wrong:\n> \n> $ cat run-test.sh\n> #!/bin/bash\n> \n> make -j8 prefix=/usr all\n> (\n>  cd ./t\n>  GIT_TEST_STASH_USE_BUILTIN=false ./t3903-stash.sh --run='103'\n> )\n> $ git bisect start master v2.22.2\n> $ git bisect run ./run-test.sh\n> ...\n> $ git bisect log\n> (b932f6a5e8...)|BISECTING ~/work/booking/git/git> git bisect log\n> # bad: [2d2118b814c11f509e1aa76cb07110f7231668dc] The seventh batch for 2.26\n> # good: [d9589d4051537c387b70dc76e430c61b4c85a86d] Git 2.22.2\n> git bisect start 'HEAD' 'v2.22.2'\n> # bad: [22dd22dce050f042b3eec165440966186691db42] Merge branch 'wb/fsmonitor-bitmap-fix'\n> git bisect bad 22dd22dce050f042b3eec165440966186691db42\n> # bad: [fa9e7934c780bc804a09bfc88a93825096b3155e] Merge branch 'bm/repository-layout-typofix'\n> git bisect bad fa9e7934c780bc804a09bfc88a93825096b3155e\n> # good: [3a94cb31d52f061c315b00bfc005f1b1c42ac92d] bin-wrappers: append `.exe` to target paths if necessary\n> git bisect good 3a94cb31d52f061c315b00bfc005f1b1c42ac92d\n> # bad: [7b70d46ca410f9d37045558329c3143570d47ba6] Merge branch 'bb/grep-pcre2-bug-message-fix'\n> git bisect bad 7b70d46ca410f9d37045558329c3143570d47ba6\n> # good: [d60dc1a0b3829f3c4d69696f43f1c178c0701cdb] Merge branch 'ew/repack-with-bitmaps-by-default'\n> git bisect good d60dc1a0b3829f3c4d69696f43f1c178c0701cdb\n> # good: [43ba21cb574ee3f9a1acf4580868982f4c883ac6] Merge branch 'tg/range-diff-output-update'\n> git bisect good 43ba21cb574ee3f9a1acf4580868982f4c883ac6\n> # good: [080af915a3ee4d9511dc288b29143b9958ac0adc] Merge branch 'mt/dir-iterator-updates'\n> git bisect good 080af915a3ee4d9511dc288b29143b9958ac0adc\n> # bad: [75ce48674889df6a2bb493fb5d6bef0ef60ca7ae] Merge branch 'di/readme-markup-fix'\n> git bisect bad 75ce48674889df6a2bb493fb5d6bef0ef60ca7ae\n> # good: [984da7f8d2589b53cca7c920e597eab30d4c1b36] Merge branch 'sr/gpg-interface-stop-at-the-end'\n> git bisect good 984da7f8d2589b53cca7c920e597eab30d4c1b36\n> # bad: [f8aee8576ac5e01fa993c80b5b888af214c03758] Merge branch 'tg/stash-keep-index-with-removed-paths'\n> git bisect bad f8aee8576ac5e01fa993c80b5b888af214c03758\n> # good: [b932f6a5e8cdbb33eff4563fdfb1eae9ebf70a65] stash: fix handling removed files with --keep-index\n> git bisect good b932f6a5e8cdbb33eff4563fdfb1eae9ebf70a65\n> # first bad commit: [f8aee8576ac5e01fa993c80b5b888af214c03758] Merge branch 'tg/stash-keep-index-with-removed-paths'\n> \n> Which pinned point the failure starting from the moment the test was added at https://github.com/git/git/commit/b932f6a5e8cdbb33eff4563fdfb1eae9ebf70a65 by @t.gummerer\n> \n> I would appreciate if we can either deprecate the GIT_TEST_STASH_USE_BUILTIN flag entirely or wrap the test with an 'if' so that we auto skip it when the flag is enabled.\n> \n> Thanks,\n> Son Luong.\n> \n>> On Feb 25, 2020, at 17:57, Junio C Hamano <gitster@pobox.com> wrote:\n>> \n>> Son Luong Ngoc <son.luong@booking.com> writes:\n>> \n>>> I have been trying to build git from source and noticing that some\n>>> tests have been failing since 2.25 with the flag\n>>> \"GIT_TEST_STASH_USE_BUILTIN=false\"\n>>> \n>>> I think in 2.25 t3903.103 started to fail (rebase related) and\n>>> current master t3904 may be failing also.\n>>> \n>>> Is \"GIT_TEST_STASH_USE_BUILTIN=false\" is still being tested with\n>>> or are we totally deprecating this flag?\n>> \n>> In the longer term, when \"git stash\" gains new features that did not\n>> exist in the original scripted version, tests that observe how these\n>> features work would start failing when using the scripted version.\n>> \n>> I picked some people from \"git shortlog --no-merges builtin/stash.c\"\n>> and placed them on the CC line---perhaps they may know more.  It\n>> happens that Johannes is also familiar with \"rebase\", which you\n>> said is involved in the test failure, so I'd imagine he would be the\n>> best person to ask.\n>> \n>> Thanks for a report.\n>> \n>> \n> \n> \n\n"},{"id":"392746","messageId":"20200302181832.GA1571684@cat","threadId":"52879","inReplyTo":"xmqq36ayob9a.fsf@gitster-ct.c.googlers.com","subject":"[PATCH 1/2] stash: get git_stash_config at the top level","fromName":"Thomas Gummerer","fromEmail":"t.gummerer@gmail.com","sentAt":"2020-03-02T18:18:32Z","receivedAt":"2020-03-02T18:18:37Z","isPatch":true,"sender":{"key":"t.gummerer@gmail.com","avatar":"https://avatars.githubusercontent.com/u/191004?v=4"},"body":"On 02/25, Junio C Hamano wrote:\n> Son Luong Ngoc <son.luong@booking.com> writes:\n> \n> > I have been trying to build git from source and noticing that some\n> > tests have been failing since 2.25 with the flag\n> > \"GIT_TEST_STASH_USE_BUILTIN=false\"\n> >\n> > I think in 2.25 t3903.103 started to fail (rebase related) and\n> > current master t3904 may be failing also.\n> >\n> > Is \"GIT_TEST_STASH_USE_BUILTIN=false\" is still being tested with\n> > or are we totally deprecating this flag?\n> \n> In the longer term, when \"git stash\" gains new features that did not\n> exist in the original scripted version, tests that observe how these\n> features work would start failing when using the scripted version.\n> \n> I picked some people from \"git shortlog --no-merges builtin/stash.c\"\n> and placed them on the CC line---perhaps they may know more.  It\n> happens that Johannes is also familiar with \"rebase\", which you\n> said is involved in the test failure, so I'd imagine he would be the\n> best person to ask.\n\nThanks for the report Son, and sorry for taking so long.  I'm a little\nbehing on reading my emails right now.\n\nI think it is time to get rid of legacy stash.  Nobody seems to have\nnoticed this test failure until now, but according to your bisection\nit looks like this test has been failing since 2.23, which I confirmed\nlocally.   In addition, the last bugfix that was related to the\nrewrite was in 2.25, though that was really a fix for another fix in\n2.24 that we failed to catch earlier.\n\nI think 2.26 should still ship with the option, but after that we can\nprobably get rid of it.  So here's a couple of patches to do just\nthat, for merging after 2.26 ships.\n\n--- >8 ---\nIn the next commit we're adding another config variable to be read\nfrom 'git_stash_config', that is valid for the top level command\ninstead of just a subset.  Move the 'git_config' invocation for\n'git_stash_config' to the top-level to prepare for that.\n\nSigned-off-by: Thomas Gummerer <t.gummerer@gmail.com>\n---\n builtin/stash.c | 5 ++---\n 1 file changed, 2 insertions(+), 3 deletions(-)\n\ndiff --git a/builtin/stash.c b/builtin/stash.c\nindex 879fc5f368..f371db270c 100644\n--- a/builtin/stash.c\n+++ b/builtin/stash.c\n@@ -712,7 +712,7 @@ static int git_stash_config(const char *var, const char *value, void *cb)\n \t\tshow_patch = git_config_bool(var, value);\n \t\treturn 0;\n \t}\n-\treturn git_default_config(var, value, cb);\n+\treturn git_diff_basic_config(var, value, cb);\n }\n \n static int show_stash(int argc, const char **argv, const char *prefix)\n@@ -749,7 +749,6 @@ static int show_stash(int argc, const char **argv, const char *prefix)\n \t * any options.\n \t */\n \tif (revision_args.argc == 1) {\n-\t\tgit_config(git_stash_config, NULL);\n \t\tif (show_stat)\n \t\t\trev.diffopt.output_format = DIFF_FORMAT_DIFFSTAT;\n \n@@ -1573,7 +1572,7 @@ int cmd_stash(int argc, const char **argv, const char *prefix)\n \ttrace_repo_setup(prefix);\n \tsetup_work_tree();\n \n-\tgit_config(git_diff_basic_config, NULL);\n+\tgit_config(git_stash_config, NULL);\n \n \targc = parse_options(argc, argv, prefix, options, git_stash_usage,\n \t\t\t     PARSE_OPT_KEEP_UNKNOWN | PARSE_OPT_KEEP_DASHDASH);\n-- \n2.25.1.377.g2d2118b814\n\n"},{"id":"392747","messageId":"20200302181924.GB1571684@cat","threadId":"52879","inReplyTo":"20200302181832.GA1571684@cat","subject":"[PATCH 2/2] stash: remove the stash.useBuiltin setting","fromName":"Thomas Gummerer","fromEmail":"t.gummerer@gmail.com","sentAt":"2020-03-02T18:19:24Z","receivedAt":"2020-03-02T18:19:33Z","isPatch":true,"sender":{"key":"t.gummerer@gmail.com","avatar":"https://avatars.githubusercontent.com/u/191004?v=4"},"body":"Remove the stash.useBuiltin setting which was added as an escape hatch\nto disable the builtin version of stash first released with Git 2.22.\n\nCarrying the legacy version is a maintenance burden, and has in fact\nbecome out of date failing a test since the 2.23 release, without\nanyone noticing until now.  So users would be getting a hint to fall\nback to a potentially buggy version of the tool.\n\nWe used to shell out to git config to get the useBuiltin configuration\nto avoid changing any global state before spawning legacy-stash.\nHowever that is no longer necessary, so just use the 'git_config'\nfunction to get the setting instead.\n\nSimilar to what we've done in d03ebd411c (\"rebase: remove the\nrebase.useBuiltin setting\", 2019-03-18), where we remove the\ncorresponding setting for rebase, we leave the documentation in place,\nso people can refer back to it when searching for it online, and so we\ncan refer to it in the commit message.\n\nSigned-off-by: Thomas Gummerer <t.gummerer@gmail.com>\n---\n .gitignore                     |   1 -\n Documentation/config/stash.txt |  18 +-\n Makefile                       |   1 -\n builtin/stash.c                |  44 +-\n git-legacy-stash.sh            | 798 ---------------------------------\n t/README                       |   4 -\n t/t3903-stash.sh               |  14 +\n 7 files changed, 30 insertions(+), 850 deletions(-)\n delete mode 100755 git-legacy-stash.sh\n\ndiff --git a/.gitignore b/.gitignore\nindex aebe7c0908..188bd1c3de 100644\n--- a/.gitignore\n+++ b/.gitignore\n@@ -83,7 +83,6 @@\n /git-init-db\n /git-interpret-trailers\n /git-instaweb\n-/git-legacy-stash\n /git-log\n /git-ls-files\n /git-ls-remote\ndiff --git a/Documentation/config/stash.txt b/Documentation/config/stash.txt\nindex abc7ef4a3a..0f3db821f6 100644\n--- a/Documentation/config/stash.txt\n+++ b/Documentation/config/stash.txt\n@@ -1,17 +1,9 @@\n stash.useBuiltin::\n-       Set to `false` to use the legacy shell script implementation of\n-       linkgit:git-stash[1]. Is `true` by default, which means use\n-       the built-in rewrite of it in C.\n-+\n-The C rewrite is first included with Git version 2.22 (and Git for Windows\n-version 2.19). This option serves as an escape hatch to re-enable the\n-legacy version in case any bugs are found in the rewrite. This option and\n-the shell script version of linkgit:git-stash[1] will be removed in some\n-future release.\n-+\n-If you find some reason to set this option to `false`, other than\n-one-off testing, you should report the behavior difference as a bug in\n-Git (see https://git-scm.com/community for details).\n+\tUnused configuration Variable.  Used in Git versions 2.22 to\n+\t2.26 as an escape hatch to enable the legacy shellscript\n+\timplementation of rebase. Now the built-in rewrite of it in C\n+\tis always used. Setting this will emit a warning, to alert any\n+\tremaining users that setting this now does nothing.\n \n stash.showPatch::\n \tIf this is set to true, the `git stash show` command without an\ndiff --git a/Makefile b/Makefile\nindex 9804a0758b..096c6d1fbb 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -609,7 +609,6 @@ SCRIPT_SH += git-merge-one-file.sh\n SCRIPT_SH += git-merge-resolve.sh\n SCRIPT_SH += git-mergetool.sh\n SCRIPT_SH += git-quiltimport.sh\n-SCRIPT_SH += git-legacy-stash.sh\n SCRIPT_SH += git-request-pull.sh\n SCRIPT_SH += git-submodule.sh\n SCRIPT_SH += git-web--browse.sh\ndiff --git a/builtin/stash.c b/builtin/stash.c\nindex f371db270c..5f4bd693df 100644\n--- a/builtin/stash.c\n+++ b/builtin/stash.c\n@@ -701,6 +701,7 @@ static int list_stash(int argc, const char **argv, const char *prefix)\n \n static int show_stat = 1;\n static int show_patch;\n+static int use_legacy_stash;\n \n static int git_stash_config(const char *var, const char *value, void *cb)\n {\n@@ -712,6 +713,10 @@ static int git_stash_config(const char *var, const char *value, void *cb)\n \t\tshow_patch = git_config_bool(var, value);\n \t\treturn 0;\n \t}\n+\tif (!strcmp(var, \"stash.usebuiltin\")) {\n+\t\tuse_legacy_stash = !git_config_bool(var, value);\n+\t\treturn 0;\n+\t}\n \treturn git_diff_basic_config(var, value, cb);\n }\n \n@@ -1524,29 +1529,6 @@ static int save_stash(int argc, const char **argv, const char *prefix)\n \treturn ret;\n }\n \n-static int use_builtin_stash(void)\n-{\n-\tstruct child_process cp = CHILD_PROCESS_INIT;\n-\tstruct strbuf out = STRBUF_INIT;\n-\tint ret, env = git_env_bool(\"GIT_TEST_STASH_USE_BUILTIN\", -1);\n-\n-\tif (env != -1)\n-\t\treturn env;\n-\n-\targv_array_pushl(&cp.args,\n-\t\t\t \"config\", \"--bool\", \"stash.usebuiltin\", NULL);\n-\tcp.git_cmd = 1;\n-\tif (capture_command(&cp, &out, 6)) {\n-\t\tstrbuf_release(&out);\n-\t\treturn 1;\n-\t}\n-\n-\tstrbuf_trim(&out);\n-\tret = !strcmp(\"true\", out.buf);\n-\tstrbuf_release(&out);\n-\treturn ret;\n-}\n-\n int cmd_stash(int argc, const char **argv, const char *prefix)\n {\n \tint i = -1;\n@@ -1558,22 +1540,18 @@ int cmd_stash(int argc, const char **argv, const char *prefix)\n \t\tOPT_END()\n \t};\n \n-\tif (!use_builtin_stash()) {\n-\t\tconst char *path = mkpath(\"%s/git-legacy-stash\",\n-\t\t\t\t\t  git_exec_path());\n-\n-\t\tif (sane_execvp(path, (char **)argv) < 0)\n-\t\t\tdie_errno(_(\"could not exec %s\"), path);\n-\t\telse\n-\t\t\tBUG(\"sane_execvp() returned???\");\n-\t}\n-\n \tprefix = setup_git_directory();\n \ttrace_repo_setup(prefix);\n \tsetup_work_tree();\n \n \tgit_config(git_stash_config, NULL);\n \n+\tif (use_legacy_stash ||\n+\t    !git_env_bool(\"GIT_TEST_STASH_USE_BUILTIN\", -1))\n+\t\twarning(_(\"the stash.useBuiltin support has been removed!\\n\"\n+\t\t\t  \"See its entry in 'git help config' for details.\"));\n+\n+\n \targc = parse_options(argc, argv, prefix, options, git_stash_usage,\n \t\t\t     PARSE_OPT_KEEP_UNKNOWN | PARSE_OPT_KEEP_DASHDASH);\n \ndiff --git a/git-legacy-stash.sh b/git-legacy-stash.sh\ndeleted file mode 100755\nindex 4d4ebb4f2b..0000000000\n--- a/git-legacy-stash.sh\n+++ /dev/null\n@@ -1,798 +0,0 @@\n-#!/bin/sh\n-# Copyright (c) 2007, Nanako Shiraishi\n-\n-dashless=$(basename \"$0\" | sed -e 's/-/ /')\n-USAGE=\"list [<options>]\n-   or: $dashless show [<stash>]\n-   or: $dashless drop [-q|--quiet] [<stash>]\n-   or: $dashless ( pop | apply ) [--index] [-q|--quiet] [<stash>]\n-   or: $dashless branch <branchname> [<stash>]\n-   or: $dashless save [--patch] [-k|--[no-]keep-index] [-q|--quiet]\n-\t\t      [-u|--include-untracked] [-a|--all] [<message>]\n-   or: $dashless [push [--patch] [-k|--[no-]keep-index] [-q|--quiet]\n-\t\t       [-u|--include-untracked] [-a|--all] [-m <message>]\n-\t\t       [-- <pathspec>...]]\n-   or: $dashless clear\"\n-\n-SUBDIRECTORY_OK=Yes\n-OPTIONS_SPEC=\n-START_DIR=$(pwd)\n-. git-sh-setup\n-require_work_tree\n-prefix=$(git rev-parse --show-prefix) || exit 1\n-cd_to_toplevel\n-\n-TMP=\"$GIT_DIR/.git-stash.$$\"\n-TMPindex=${GIT_INDEX_FILE-\"$(git rev-parse --git-path index)\"}.stash.$$\n-trap 'rm -f \"$TMP-\"* \"$TMPindex\"' 0\n-\n-ref_stash=refs/stash\n-\n-if git config --get-colorbool color.interactive; then\n-       help_color=\"$(git config --get-color color.interactive.help 'red bold')\"\n-       reset_color=\"$(git config --get-color '' reset)\"\n-else\n-       help_color=\n-       reset_color=\n-fi\n-\n-no_changes () {\n-\tgit diff-index --quiet --cached HEAD --ignore-submodules -- \"$@\" &&\n-\tgit diff-files --quiet --ignore-submodules -- \"$@\" &&\n-\t(test -z \"$untracked\" || test -z \"$(untracked_files \"$@\")\")\n-}\n-\n-untracked_files () {\n-\tif test \"$1\" = \"-z\"\n-\tthen\n-\t\tshift\n-\t\tz=-z\n-\telse\n-\t\tz=\n-\tfi\n-\texcl_opt=--exclude-standard\n-\ttest \"$untracked\" = \"all\" && excl_opt=\n-\tgit ls-files -o $z $excl_opt -- \"$@\"\n-}\n-\n-prepare_fallback_ident () {\n-\tif ! git -c user.useconfigonly=yes var GIT_COMMITTER_IDENT >/dev/null 2>&1\n-\tthen\n-\t\tGIT_AUTHOR_NAME=\"git stash\"\n-\t\tGIT_AUTHOR_EMAIL=git@stash\n-\t\tGIT_COMMITTER_NAME=\"git stash\"\n-\t\tGIT_COMMITTER_EMAIL=git@stash\n-\t\texport GIT_AUTHOR_NAME\n-\t\texport GIT_AUTHOR_EMAIL\n-\t\texport GIT_COMMITTER_NAME\n-\t\texport GIT_COMMITTER_EMAIL\n-\tfi\n-}\n-\n-clear_stash () {\n-\tif test $# != 0\n-\tthen\n-\t\tdie \"$(gettext \"git stash clear with parameters is unimplemented\")\"\n-\tfi\n-\tif current=$(git rev-parse --verify --quiet $ref_stash)\n-\tthen\n-\t\tgit update-ref -d $ref_stash $current\n-\tfi\n-}\n-\n-maybe_quiet () {\n-\tcase \"$1\" in\n-\t--keep-stdout)\n-\t\tshift\n-\t\tif test -n \"$GIT_QUIET\"\n-\t\tthen\n-\t\t\t\"$@\" 2>/dev/null\n-\t\telse\n-\t\t\t\"$@\"\n-\t\tfi\n-\t\t;;\n-\t*)\n-\t\tif test -n \"$GIT_QUIET\"\n-\t\tthen\n-\t\t\t\"$@\" >/dev/null 2>&1\n-\t\telse\n-\t\t\t\"$@\"\n-\t\tfi\n-\t\t;;\n-\tesac\n-}\n-\n-create_stash () {\n-\n-\tprepare_fallback_ident\n-\n-\tstash_msg=\n-\tuntracked=\n-\twhile test $# != 0\n-\tdo\n-\t\tcase \"$1\" in\n-\t\t-m|--message)\n-\t\t\tshift\n-\t\t\tstash_msg=${1?\"BUG: create_stash () -m requires an argument\"}\n-\t\t\t;;\n-\t\t-m*)\n-\t\t\tstash_msg=${1#-m}\n-\t\t\t;;\n-\t\t--message=*)\n-\t\t\tstash_msg=${1#--message=}\n-\t\t\t;;\n-\t\t-u|--include-untracked)\n-\t\t\tshift\n-\t\t\tuntracked=${1?\"BUG: create_stash () -u requires an argument\"}\n-\t\t\t;;\n-\t\t--)\n-\t\t\tshift\n-\t\t\tbreak\n-\t\t\t;;\n-\t\tesac\n-\t\tshift\n-\tdone\n-\n-\tgit update-index -q --refresh\n-\tif maybe_quiet no_changes \"$@\"\n-\tthen\n-\t\texit 0\n-\tfi\n-\n-\t# state of the base commit\n-\tif b_commit=$(maybe_quiet --keep-stdout git rev-parse --verify HEAD)\n-\tthen\n-\t\thead=$(git rev-list --oneline -n 1 HEAD --)\n-\telif test -n \"$GIT_QUIET\"\n-\tthen\n-\t\texit 1\n-\telse\n-\t\tdie \"$(gettext \"You do not have the initial commit yet\")\"\n-\tfi\n-\n-\tif branch=$(git symbolic-ref -q HEAD)\n-\tthen\n-\t\tbranch=${branch#refs/heads/}\n-\telse\n-\t\tbranch='(no branch)'\n-\tfi\n-\tmsg=$(printf '%s: %s' \"$branch\" \"$head\")\n-\n-\t# state of the index\n-\ti_tree=$(git write-tree) &&\n-\ti_commit=$(printf 'index on %s\\n' \"$msg\" |\n-\t\tgit commit-tree $i_tree -p $b_commit) ||\n-\t\tdie \"$(gettext \"Cannot save the current index state\")\"\n-\n-\tif test -n \"$untracked\"\n-\tthen\n-\t\t# Untracked files are stored by themselves in a parentless commit, for\n-\t\t# ease of unpacking later.\n-\t\tu_commit=$(\n-\t\t\tuntracked_files -z \"$@\" | (\n-\t\t\t\tGIT_INDEX_FILE=\"$TMPindex\" &&\n-\t\t\t\texport GIT_INDEX_FILE &&\n-\t\t\t\trm -f \"$TMPindex\" &&\n-\t\t\t\tgit update-index -z --add --remove --stdin &&\n-\t\t\t\tu_tree=$(git write-tree) &&\n-\t\t\t\tprintf 'untracked files on %s\\n' \"$msg\" | git commit-tree $u_tree  &&\n-\t\t\t\trm -f \"$TMPindex\"\n-\t\t) ) || die \"$(gettext \"Cannot save the untracked files\")\"\n-\n-\t\tuntracked_commit_option=\"-p $u_commit\";\n-\telse\n-\t\tuntracked_commit_option=\n-\tfi\n-\n-\tif test -z \"$patch_mode\"\n-\tthen\n-\n-\t\t# state of the working tree\n-\t\tw_tree=$( (\n-\t\t\tgit read-tree --index-output=\"$TMPindex\" -m $i_tree &&\n-\t\t\tGIT_INDEX_FILE=\"$TMPindex\" &&\n-\t\t\texport GIT_INDEX_FILE &&\n-\t\t\tgit diff-index --name-only -z HEAD -- \"$@\" >\"$TMP-stagenames\" &&\n-\t\t\tgit update-index --ignore-skip-worktree-entries \\\n-\t\t\t\t-z --add --remove --stdin <\"$TMP-stagenames\" &&\n-\t\t\tgit write-tree &&\n-\t\t\trm -f \"$TMPindex\"\n-\t\t) ) ||\n-\t\t\tdie \"$(gettext \"Cannot save the current worktree state\")\"\n-\n-\telse\n-\n-\t\trm -f \"$TMP-index\" &&\n-\t\tGIT_INDEX_FILE=\"$TMP-index\" git read-tree HEAD &&\n-\n-\t\t# find out what the user wants\n-\t\tGIT_INDEX_FILE=\"$TMP-index\" \\\n-\t\t\tgit add --legacy-stash-p -- \"$@\" &&\n-\n-\t\t# state of the working tree\n-\t\tw_tree=$(GIT_INDEX_FILE=\"$TMP-index\" git write-tree) ||\n-\t\tdie \"$(gettext \"Cannot save the current worktree state\")\"\n-\n-\t\tgit diff-tree -p HEAD $w_tree -- >\"$TMP-patch\" &&\n-\t\ttest -s \"$TMP-patch\" ||\n-\t\tdie \"$(gettext \"No changes selected\")\"\n-\n-\t\trm -f \"$TMP-index\" ||\n-\t\tdie \"$(gettext \"Cannot remove temporary index (can't happen)\")\"\n-\n-\tfi\n-\n-\t# create the stash\n-\tif test -z \"$stash_msg\"\n-\tthen\n-\t\tstash_msg=$(printf 'WIP on %s' \"$msg\")\n-\telse\n-\t\tstash_msg=$(printf 'On %s: %s' \"$branch\" \"$stash_msg\")\n-\tfi\n-\tw_commit=$(printf '%s\\n' \"$stash_msg\" |\n-\tgit commit-tree $w_tree -p $b_commit -p $i_commit $untracked_commit_option) ||\n-\tdie \"$(gettext \"Cannot record working tree state\")\"\n-}\n-\n-store_stash () {\n-\twhile test $# != 0\n-\tdo\n-\t\tcase \"$1\" in\n-\t\t-m|--message)\n-\t\t\tshift\n-\t\t\tstash_msg=\"$1\"\n-\t\t\t;;\n-\t\t-m*)\n-\t\t\tstash_msg=${1#-m}\n-\t\t\t;;\n-\t\t--message=*)\n-\t\t\tstash_msg=${1#--message=}\n-\t\t\t;;\n-\t\t-q|--quiet)\n-\t\t\tquiet=t\n-\t\t\t;;\n-\t\t*)\n-\t\t\tbreak\n-\t\t\t;;\n-\t\tesac\n-\t\tshift\n-\tdone\n-\ttest $# = 1 ||\n-\tdie \"$(eval_gettext \"\\\"$dashless store\\\" requires one <commit> argument\")\"\n-\n-\tw_commit=\"$1\"\n-\tif test -z \"$stash_msg\"\n-\tthen\n-\t\tstash_msg=\"Created via \\\"git stash store\\\".\"\n-\tfi\n-\n-\tgit update-ref --create-reflog -m \"$stash_msg\" $ref_stash $w_commit\n-\tret=$?\n-\ttest $ret != 0 && test -z \"$quiet\" &&\n-\tdie \"$(eval_gettext \"Cannot update \\$ref_stash with \\$w_commit\")\"\n-\treturn $ret\n-}\n-\n-push_stash () {\n-\tkeep_index=\n-\tpatch_mode=\n-\tuntracked=\n-\tstash_msg=\n-\twhile test $# != 0\n-\tdo\n-\t\tcase \"$1\" in\n-\t\t-k|--keep-index)\n-\t\t\tkeep_index=t\n-\t\t\t;;\n-\t\t--no-keep-index)\n-\t\t\tkeep_index=n\n-\t\t\t;;\n-\t\t-p|--patch)\n-\t\t\tpatch_mode=t\n-\t\t\t# only default to keep if we don't already have an override\n-\t\t\ttest -z \"$keep_index\" && keep_index=t\n-\t\t\t;;\n-\t\t-q|--quiet)\n-\t\t\tGIT_QUIET=t\n-\t\t\t;;\n-\t\t-u|--include-untracked)\n-\t\t\tuntracked=untracked\n-\t\t\t;;\n-\t\t-a|--all)\n-\t\t\tuntracked=all\n-\t\t\t;;\n-\t\t-m|--message)\n-\t\t\tshift\n-\t\t\ttest -z ${1+x} && usage\n-\t\t\tstash_msg=$1\n-\t\t\t;;\n-\t\t-m*)\n-\t\t\tstash_msg=${1#-m}\n-\t\t\t;;\n-\t\t--message=*)\n-\t\t\tstash_msg=${1#--message=}\n-\t\t\t;;\n-\t\t--help)\n-\t\t\tshow_help\n-\t\t\t;;\n-\t\t--)\n-\t\t\tshift\n-\t\t\tbreak\n-\t\t\t;;\n-\t\t-*)\n-\t\t\toption=\"$1\"\n-\t\t\teval_gettextln \"error: unknown option for 'stash push': \\$option\"\n-\t\t\tusage\n-\t\t\t;;\n-\t\t*)\n-\t\t\tbreak\n-\t\t\t;;\n-\t\tesac\n-\t\tshift\n-\tdone\n-\n-\teval \"set $(git rev-parse --sq --prefix \"$prefix\" -- \"$@\")\"\n-\n-\tif test -n \"$patch_mode\" && test -n \"$untracked\"\n-\tthen\n-\t\tdie \"$(gettext \"Can't use --patch and --include-untracked or --all at the same time\")\"\n-\tfi\n-\n-\ttest -n \"$untracked\" || git ls-files --error-unmatch -- \"$@\" >/dev/null || exit 1\n-\n-\tgit update-index -q --refresh\n-\tif maybe_quiet no_changes \"$@\"\n-\tthen\n-\t\tsay \"$(gettext \"No local changes to save\")\"\n-\t\texit 0\n-\tfi\n-\n-\tgit reflog exists $ref_stash ||\n-\t\tclear_stash || die \"$(gettext \"Cannot initialize stash\")\"\n-\n-\tcreate_stash -m \"$stash_msg\" -u \"$untracked\" -- \"$@\"\n-\tstore_stash -m \"$stash_msg\" -q $w_commit ||\n-\tdie \"$(gettext \"Cannot save the current status\")\"\n-\tsay \"$(eval_gettext \"Saved working directory and index state \\$stash_msg\")\"\n-\n-\tif test -z \"$patch_mode\"\n-\tthen\n-\t\ttest \"$untracked\" = \"all\" && CLEAN_X_OPTION=-x || CLEAN_X_OPTION=\n-\t\tif test -n \"$untracked\" && test $# = 0\n-\t\tthen\n-\t\t\tgit clean --force --quiet -d $CLEAN_X_OPTION\n-\t\tfi\n-\n-\t\tif test $# != 0\n-\t\tthen\n-\t\t\ttest -z \"$untracked\" && UPDATE_OPTION=\"-u\" || UPDATE_OPTION=\n-\t\t\ttest \"$untracked\" = \"all\" && FORCE_OPTION=\"--force\" || FORCE_OPTION=\n-\t\t\tgit add $UPDATE_OPTION $FORCE_OPTION -- \"$@\"\n-\t\t\tgit diff-index -p --cached --binary HEAD -- \"$@\" |\n-\t\t\tgit apply --index -R\n-\t\telse\n-\t\t\tgit reset --hard -q --no-recurse-submodules\n-\t\tfi\n-\n-\t\tif test \"$keep_index\" = \"t\" && test -n \"$i_tree\"\n-\t\tthen\n-\t\t\tgit read-tree --reset $i_tree\n-\t\t\tgit ls-files -z --modified -- \"$@\" |\n-\t\t\tgit checkout-index -z --force --stdin\n-\t\tfi\n-\telse\n-\t\tgit apply -R < \"$TMP-patch\" ||\n-\t\tdie \"$(gettext \"Cannot remove worktree changes\")\"\n-\n-\t\tif test \"$keep_index\" != \"t\"\n-\t\tthen\n-\t\t\tgit reset -q -- \"$@\"\n-\t\tfi\n-\tfi\n-}\n-\n-save_stash () {\n-\tpush_options=\n-\twhile test $# != 0\n-\tdo\n-\t\tcase \"$1\" in\n-\t\t-q|--quiet)\n-\t\t\tGIT_QUIET=t\n-\t\t\t;;\n-\t\t--)\n-\t\t\tshift\n-\t\t\tbreak\n-\t\t\t;;\n-\t\t-*)\n-\t\t\t# pass all options through to push_stash\n-\t\t\tpush_options=\"$push_options $1\"\n-\t\t\t;;\n-\t\t*)\n-\t\t\tbreak\n-\t\t\t;;\n-\t\tesac\n-\t\tshift\n-\tdone\n-\n-\tstash_msg=\"$*\"\n-\n-\tif test -z \"$stash_msg\"\n-\tthen\n-\t\tpush_stash $push_options\n-\telse\n-\t\tpush_stash $push_options -m \"$stash_msg\"\n-\tfi\n-}\n-\n-have_stash () {\n-\tgit rev-parse --verify --quiet $ref_stash >/dev/null\n-}\n-\n-list_stash () {\n-\thave_stash || return 0\n-\tgit log --format=\"%gd: %gs\" -g --first-parent -m \"$@\" $ref_stash --\n-}\n-\n-show_stash () {\n-\tALLOW_UNKNOWN_FLAGS=t\n-\tassert_stash_like \"$@\"\n-\n-\tif test -z \"$FLAGS\"\n-\tthen\n-\t\tif test \"$(git config --bool stash.showStat || echo true)\" = \"true\"\n-\t\tthen\n-\t\t\tFLAGS=--stat\n-\t\tfi\n-\n-\t\tif test \"$(git config --bool stash.showPatch || echo false)\" = \"true\"\n-\t\tthen\n-\t\t\tFLAGS=${FLAGS}${FLAGS:+ }-p\n-\t\tfi\n-\n-\t\tif test -z \"$FLAGS\"\n-\t\tthen\n-\t\t\treturn 0\n-\t\tfi\n-\tfi\n-\n-\tgit diff ${FLAGS} $b_commit $w_commit\n-}\n-\n-show_help () {\n-\texec git help stash\n-\texit 1\n-}\n-\n-#\n-# Parses the remaining options looking for flags and\n-# at most one revision defaulting to ${ref_stash}@{0}\n-# if none found.\n-#\n-# Derives related tree and commit objects from the\n-# revision, if one is found.\n-#\n-# stash records the work tree, and is a merge between the\n-# base commit (first parent) and the index tree (second parent).\n-#\n-#   REV is set to the symbolic version of the specified stash-like commit\n-#   IS_STASH_LIKE is non-blank if ${REV} looks like a stash\n-#   IS_STASH_REF is non-blank if the ${REV} looks like a stash ref\n-#   s is set to the SHA1 of the stash commit\n-#   w_commit is set to the commit containing the working tree\n-#   b_commit is set to the base commit\n-#   i_commit is set to the commit containing the index tree\n-#   u_commit is set to the commit containing the untracked files tree\n-#   w_tree is set to the working tree\n-#   b_tree is set to the base tree\n-#   i_tree is set to the index tree\n-#   u_tree is set to the untracked files tree\n-#\n-#   GIT_QUIET is set to t if -q is specified\n-#   INDEX_OPTION is set to --index if --index is specified.\n-#   FLAGS is set to the remaining flags (if allowed)\n-#\n-# dies if:\n-#   * too many revisions specified\n-#   * no revision is specified and there is no stash stack\n-#   * a revision is specified which cannot be resolve to a SHA1\n-#   * a non-existent stash reference is specified\n-#   * unknown flags were set and ALLOW_UNKNOWN_FLAGS is not \"t\"\n-#\n-\n-parse_flags_and_rev()\n-{\n-\ttest \"$PARSE_CACHE\" = \"$*\" && return 0 # optimisation\n-\tPARSE_CACHE=\"$*\"\n-\n-\tIS_STASH_LIKE=\n-\tIS_STASH_REF=\n-\tINDEX_OPTION=\n-\ts=\n-\tw_commit=\n-\tb_commit=\n-\ti_commit=\n-\tu_commit=\n-\tw_tree=\n-\tb_tree=\n-\ti_tree=\n-\tu_tree=\n-\n-\tFLAGS=\n-\tREV=\n-\tfor opt\n-\tdo\n-\t\tcase \"$opt\" in\n-\t\t\t-q|--quiet)\n-\t\t\t\tGIT_QUIET=-t\n-\t\t\t;;\n-\t\t\t--index)\n-\t\t\t\tINDEX_OPTION=--index\n-\t\t\t;;\n-\t\t\t--help)\n-\t\t\t\tshow_help\n-\t\t\t;;\n-\t\t\t-*)\n-\t\t\t\ttest \"$ALLOW_UNKNOWN_FLAGS\" = t ||\n-\t\t\t\t\tdie \"$(eval_gettext \"unknown option: \\$opt\")\"\n-\t\t\t\tFLAGS=\"${FLAGS}${FLAGS:+ }$opt\"\n-\t\t\t;;\n-\t\t\t*)\n-\t\t\t\tREV=\"${REV}${REV:+ }'$opt'\"\n-\t\t\t;;\n-\t\tesac\n-\tdone\n-\n-\teval set -- $REV\n-\n-\tcase $# in\n-\t\t0)\n-\t\t\thave_stash || die \"$(gettext \"No stash entries found.\")\"\n-\t\t\tset -- ${ref_stash}@{0}\n-\t\t;;\n-\t\t1)\n-\t\t\t:\n-\t\t;;\n-\t\t*)\n-\t\t\tdie \"$(eval_gettext \"Too many revisions specified: \\$REV\")\"\n-\t\t;;\n-\tesac\n-\n-\tcase \"$1\" in\n-\t\t*[!0-9]*)\n-\t\t\t:\n-\t\t;;\n-\t\t*)\n-\t\t\tset -- \"${ref_stash}@{$1}\"\n-\t\t;;\n-\tesac\n-\n-\tREV=$(git rev-parse --symbolic --verify --quiet \"$1\") || {\n-\t\treference=\"$1\"\n-\t\tdie \"$(eval_gettext \"\\$reference is not a valid reference\")\"\n-\t}\n-\n-\ti_commit=$(git rev-parse --verify --quiet \"$REV^2\") &&\n-\tset -- $(git rev-parse \"$REV\" \"$REV^1\" \"$REV:\" \"$REV^1:\" \"$REV^2:\" 2>/dev/null) &&\n-\ts=$1 &&\n-\tw_commit=$1 &&\n-\tb_commit=$2 &&\n-\tw_tree=$3 &&\n-\tb_tree=$4 &&\n-\ti_tree=$5 &&\n-\tIS_STASH_LIKE=t &&\n-\ttest \"$ref_stash\" = \"$(git rev-parse --symbolic-full-name \"${REV%@*}\")\" &&\n-\tIS_STASH_REF=t\n-\n-\tu_commit=$(git rev-parse --verify --quiet \"$REV^3\") &&\n-\tu_tree=$(git rev-parse \"$REV^3:\" 2>/dev/null)\n-}\n-\n-is_stash_like()\n-{\n-\tparse_flags_and_rev \"$@\"\n-\ttest -n \"$IS_STASH_LIKE\"\n-}\n-\n-assert_stash_like() {\n-\tis_stash_like \"$@\" || {\n-\t\targs=\"$*\"\n-\t\tdie \"$(eval_gettext \"'\\$args' is not a stash-like commit\")\"\n-\t}\n-}\n-\n-is_stash_ref() {\n-\tis_stash_like \"$@\" && test -n \"$IS_STASH_REF\"\n-}\n-\n-assert_stash_ref() {\n-\tis_stash_ref \"$@\" || {\n-\t\targs=\"$*\"\n-\t\tdie \"$(eval_gettext \"'\\$args' is not a stash reference\")\"\n-\t}\n-}\n-\n-apply_stash () {\n-\n-\tassert_stash_like \"$@\"\n-\n-\tgit update-index -q --refresh || die \"$(gettext \"unable to refresh index\")\"\n-\n-\t# current index state\n-\tc_tree=$(git write-tree) ||\n-\t\tdie \"$(gettext \"Cannot apply a stash in the middle of a merge\")\"\n-\n-\tunstashed_index_tree=\n-\tif test -n \"$INDEX_OPTION\" && test \"$b_tree\" != \"$i_tree\" &&\n-\t\t\ttest \"$c_tree\" != \"$i_tree\"\n-\tthen\n-\t\tgit diff-tree --binary $s^2^..$s^2 | git apply --cached\n-\t\ttest $? -ne 0 &&\n-\t\t\tdie \"$(gettext \"Conflicts in index. Try without --index.\")\"\n-\t\tunstashed_index_tree=$(git write-tree) ||\n-\t\t\tdie \"$(gettext \"Could not save index tree\")\"\n-\t\tgit reset\n-\tfi\n-\n-\tif test -n \"$u_tree\"\n-\tthen\n-\t\tGIT_INDEX_FILE=\"$TMPindex\" git read-tree \"$u_tree\" &&\n-\t\tGIT_INDEX_FILE=\"$TMPindex\" git checkout-index --all &&\n-\t\trm -f \"$TMPindex\" ||\n-\t\tdie \"$(gettext \"Could not restore untracked files from stash entry\")\"\n-\tfi\n-\n-\teval \"\n-\t\tGITHEAD_$w_tree='Stashed changes' &&\n-\t\tGITHEAD_$c_tree='Updated upstream' &&\n-\t\tGITHEAD_$b_tree='Version stash was based on' &&\n-\t\texport GITHEAD_$w_tree GITHEAD_$c_tree GITHEAD_$b_tree\n-\t\"\n-\n-\tif test -n \"$GIT_QUIET\"\n-\tthen\n-\t\tGIT_MERGE_VERBOSITY=0 && export GIT_MERGE_VERBOSITY\n-\tfi\n-\tif git merge-recursive $b_tree -- $c_tree $w_tree\n-\tthen\n-\t\t# No conflict\n-\t\tif test -n \"$unstashed_index_tree\"\n-\t\tthen\n-\t\t\tgit read-tree \"$unstashed_index_tree\"\n-\t\telse\n-\t\t\ta=\"$TMP-added\" &&\n-\t\t\tgit diff-index --cached --name-only --diff-filter=A $c_tree >\"$a\" &&\n-\t\t\tgit read-tree --reset $c_tree &&\n-\t\t\tgit update-index --add --stdin <\"$a\" ||\n-\t\t\t\tdie \"$(gettext \"Cannot unstage modified files\")\"\n-\t\t\trm -f \"$a\"\n-\t\tfi\n-\t\tsquelch=\n-\t\tif test -n \"$GIT_QUIET\"\n-\t\tthen\n-\t\t\tsquelch='>/dev/null 2>&1'\n-\t\tfi\n-\t\t(cd \"$START_DIR\" && eval \"git status $squelch\") || :\n-\telse\n-\t\t# Merge conflict; keep the exit status from merge-recursive\n-\t\tstatus=$?\n-\t\tgit rerere\n-\t\tif test -n \"$INDEX_OPTION\"\n-\t\tthen\n-\t\t\tgettextln \"Index was not unstashed.\" >&2\n-\t\tfi\n-\t\texit $status\n-\tfi\n-}\n-\n-pop_stash() {\n-\tassert_stash_ref \"$@\"\n-\n-\tif apply_stash \"$@\"\n-\tthen\n-\t\tdrop_stash \"$@\"\n-\telse\n-\t\tstatus=$?\n-\t\tsay \"$(gettext \"The stash entry is kept in case you need it again.\")\"\n-\t\texit $status\n-\tfi\n-}\n-\n-drop_stash () {\n-\tassert_stash_ref \"$@\"\n-\n-\tgit reflog delete --updateref --rewrite \"${REV}\" &&\n-\t\tsay \"$(eval_gettext \"Dropped \\${REV} (\\$s)\")\" ||\n-\t\tdie \"$(eval_gettext \"\\${REV}: Could not drop stash entry\")\"\n-\n-\t# clear_stash if we just dropped the last stash entry\n-\tgit rev-parse --verify --quiet \"$ref_stash@{0}\" >/dev/null ||\n-\tclear_stash\n-}\n-\n-apply_to_branch () {\n-\ttest -n \"$1\" || die \"$(gettext \"No branch name specified\")\"\n-\tbranch=$1\n-\tshift 1\n-\n-\tset -- --index \"$@\"\n-\tassert_stash_like \"$@\"\n-\n-\tgit checkout -b $branch $REV^ &&\n-\tapply_stash \"$@\" && {\n-\t\ttest -z \"$IS_STASH_REF\" || drop_stash \"$@\"\n-\t}\n-}\n-\n-test \"$1\" = \"-p\" && set \"push\" \"$@\"\n-\n-PARSE_CACHE='--not-parsed'\n-# The default command is \"push\" if nothing but options are given\n-seen_non_option=\n-for opt\n-do\n-\tcase \"$opt\" in\n-\t--) break ;;\n-\t-*) ;;\n-\t*) seen_non_option=t; break ;;\n-\tesac\n-done\n-\n-test -n \"$seen_non_option\" || set \"push\" \"$@\"\n-\n-# Main command set\n-case \"$1\" in\n-list)\n-\tshift\n-\tlist_stash \"$@\"\n-\t;;\n-show)\n-\tshift\n-\tshow_stash \"$@\"\n-\t;;\n-save)\n-\tshift\n-\tsave_stash \"$@\"\n-\t;;\n-push)\n-\tshift\n-\tpush_stash \"$@\"\n-\t;;\n-apply)\n-\tshift\n-\tapply_stash \"$@\"\n-\t;;\n-clear)\n-\tshift\n-\tclear_stash \"$@\"\n-\t;;\n-create)\n-\tshift\n-\tcreate_stash -m \"$*\" && echo \"$w_commit\"\n-\t;;\n-store)\n-\tshift\n-\tstore_stash \"$@\"\n-\t;;\n-drop)\n-\tshift\n-\tdrop_stash \"$@\"\n-\t;;\n-pop)\n-\tshift\n-\tpop_stash \"$@\"\n-\t;;\n-branch)\n-\tshift\n-\tapply_to_branch \"$@\"\n-\t;;\n-*)\n-\tcase $# in\n-\t0)\n-\t\tpush_stash &&\n-\t\tsay \"$(gettext \"(To restore them type \\\"git stash apply\\\")\")\"\n-\t\t;;\n-\t*)\n-\t\tusage\n-\tesac\n-\t;;\n-esac\ndiff --git a/t/README b/t/README\nindex 9afd61e3ca..369e3a9ded 100644\n--- a/t/README\n+++ b/t/README\n@@ -393,10 +393,6 @@ the --no-sparse command-line argument.\n GIT_TEST_PRELOAD_INDEX=<boolean> exercises the preload-index code path\n by overriding the minimum number of cache entries required per thread.\n \n-GIT_TEST_STASH_USE_BUILTIN=<boolean>, when false, disables the\n-built-in version of git-stash. See 'stash.useBuiltin' in\n-git-config(1).\n-\n GIT_TEST_ADD_I_USE_BUILTIN=<boolean>, when true, enables the\n built-in version of git add -i. See 'add.interactive.useBuiltin' in\n git-config(1).\ndiff --git a/t/t3903-stash.sh b/t/t3903-stash.sh\nindex ea56e85e70..b84d55a832 100755\n--- a/t/t3903-stash.sh\n+++ b/t/t3903-stash.sh\n@@ -1285,4 +1285,18 @@ test_expect_success 'stash handles skip-worktree entries nicely' '\n \tgit rev-parse --verify refs/stash:A.t\n '\n \n+test_expect_success 'stash -c stash.useBuiltin=false warning ' '\n+\texpected=\"stash.useBuiltin support has been removed\" &&\n+\n+\tgit -c stash.useBuiltin=false stash 2>err &&\n+\ttest_i18ngrep \"$expected\" err &&\n+\tenv GIT_TEST_STASH_USE_BUILTIN=false git stash 2>err &&\n+\ttest_i18ngrep \"$expected\" err &&\n+\n+\tgit -c stash.useBuiltin=true stash 2>err &&\n+\ttest_must_be_empty err &&\n+\tenv GIT_TEST_STASH_USE_BUILTIN=true git stash 2>err &&\n+\ttest_must_be_empty err\n+'\n+\n test_done\n-- \n2.25.1.377.g2d2118b814\n\n"},{"id":"392757","messageId":"xmqq7e02bg1g.fsf@gitster-ct.c.googlers.com","threadId":"52879","inReplyTo":"20200302181924.GB1571684@cat","subject":"Re: [PATCH 2/2] stash: remove the stash.useBuiltin setting","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-03-02T21:30:51Z","receivedAt":"2020-03-02T21:31:02Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thomas Gummerer <t.gummerer@gmail.com> writes:\n\n> -\tif (!use_builtin_stash()) {\n> -\t\tconst char *path = mkpath(\"%s/git-legacy-stash\",\n> -\t\t\t\t\t  git_exec_path());\n> -\n> -\t\tif (sane_execvp(path, (char **)argv) < 0)\n> -\t\t\tdie_errno(_(\"could not exec %s\"), path);\n> -\t\telse\n> -\t\t\tBUG(\"sane_execvp() returned???\");\n> -\t}\n> -\n>  \tprefix = setup_git_directory();\n>  \ttrace_repo_setup(prefix);\n>  \tsetup_work_tree();\n>  \n>  \tgit_config(git_stash_config, NULL);\n>  \n> +\tif (use_legacy_stash ||\n> +\t    !git_env_bool(\"GIT_TEST_STASH_USE_BUILTIN\", -1))\n> +\t\twarning(_(\"the stash.useBuiltin support has been removed!\\n\"\n> +\t\t\t  \"See its entry in 'git help config' for details.\"));\n\nMakes sense.\n"},{"id":"392759","messageId":"xmqqy2si9z4x.fsf_-_@gitster-ct.c.googlers.com","threadId":"52879","inReplyTo":"20200302181924.GB1571684@cat","subject":"non-regression bug in 'git merge' (really, xdiff/xmerge, I think)","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-03-02T22:21:18Z","receivedAt":"2020-03-02T22:21:28Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thomas Gummerer <t.gummerer@gmail.com> writes:\n\n> diff --git a/Makefile b/Makefile\n> index 9804a0758b..096c6d1fbb 100644\n> --- a/Makefile\n> +++ b/Makefile\n> @@ -609,7 +609,6 @@ SCRIPT_SH += git-merge-one-file.sh\n>  SCRIPT_SH += git-merge-resolve.sh\n>  SCRIPT_SH += git-mergetool.sh\n>  SCRIPT_SH += git-quiltimport.sh\n> -SCRIPT_SH += git-legacy-stash.sh\n>  SCRIPT_SH += git-request-pull.sh\n>  SCRIPT_SH += git-submodule.sh\n>  SCRIPT_SH += git-web--browse.sh\n\nMerging this topic to 'pu', which has dl/merge-autostash topic\nalready merged, breaks the build and it is not fault of Thomas's\ntopic.  dl/merge-autostash has the following bit:\n\ncommit 4b981afaa03c00524f1d4986271a3f4cc119f4cd\nMerge: 06928448f7 de4db86ff2\nAuthor: Junio C Hamano <gitster@pobox.com>\nDate:   Mon Mar 2 13:23:26 2020 -0800\n\n    Merge branch 'dl/merge-autostash' into pu\n    \n    \"git merge\" learns the \"--autostash\" option.\n    \n    * dl/merge-autostash:\n      ...\n      Makefile: alphabetically sort += lists\n\ndiff --git a/Makefile b/Makefile\nindex a5961113d8..c0793ac75b 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -604,12 +604,12 @@ unexport CDPATH\n SCRIPT_SH += git-bisect.sh\n SCRIPT_SH += git-difftool--helper.sh\n SCRIPT_SH += git-filter-branch.sh\n+SCRIPT_SH += git-legacy-stash.sh\n SCRIPT_SH += git-merge-octopus.sh\n SCRIPT_SH += git-merge-one-file.sh\n SCRIPT_SH += git-merge-resolve.sh\n SCRIPT_SH += git-mergetool.sh\n SCRIPT_SH += git-quiltimport.sh\n-SCRIPT_SH += git-legacy-stash.sh\n SCRIPT_SH += git-request-pull.sh\n SCRIPT_SH += git-submodule.sh\n SCRIPT_SH += git-web--browse.sh\n@@ -617,8 +617,8 @@ SCRIPT_SH += git-web--browse.sh\n\nwhich makes it appear to the xmerge code that legacy-status that\nused to exist in between quiltimport and request-pull has already\nbeen removed.\n\nAs Thomas's above patch exactly wants to do that (i.e. we want to\nremove legacy-stash between quiltimport and request-pull), the\nxmerge code seems to think incorrectly that the requested change has\nalready been applied.  And as a result of that, there remains\nlegacy-stash between fliter-branch and merge-octopus, breaking the\nbuild by having one unbuildable build target X-<.\n\n\n\n"},{"id":"392777","messageId":"nycvar.QRO.7.76.6.2003031430180.46@tvgsbejvaqbjf.bet","threadId":"52879","inReplyTo":"20200302181924.GB1571684@cat","subject":"Re: [PATCH 2/2] stash: remove the stash.useBuiltin setting","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2020-03-03T13:33:33Z","receivedAt":"2020-03-03T13:33:42Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Thomas,\n\nOn Mon, 2 Mar 2020, Thomas Gummerer wrote:\n\n> Remove the stash.useBuiltin setting which was added as an escape hatch\n> to disable the builtin version of stash first released with Git 2.22.\n\nGreat!\n\n> diff --git a/builtin/stash.c b/builtin/stash.c\n> index f371db270c..5f4bd693df 100644\n> --- a/builtin/stash.c\n> +++ b/builtin/stash.c\n> @@ -1558,22 +1540,18 @@ int cmd_stash(int argc, const char **argv, const char *prefix)\n>  \t\tOPT_END()\n>  \t};\n>\n> -\tif (!use_builtin_stash()) {\n> -\t\tconst char *path = mkpath(\"%s/git-legacy-stash\",\n> -\t\t\t\t\t  git_exec_path());\n> -\n> -\t\tif (sane_execvp(path, (char **)argv) < 0)\n> -\t\t\tdie_errno(_(\"could not exec %s\"), path);\n> -\t\telse\n> -\t\t\tBUG(\"sane_execvp() returned???\");\n> -\t}\n> -\n>  \tprefix = setup_git_directory();\n>  \ttrace_repo_setup(prefix);\n>  \tsetup_work_tree();\n\nHowever, this is only needed because we did not change `git.c` at the same\ntime (as I had done for `rebase` in 80dfc9242eb (git: mark cmd_rebase as\nrequiring a worktree, 2019-07-24)). In other words, I think we will also\nwant to address this part of `git.c`:\n\n        /*\n         * NEEDSWORK: Until the builtin stash is thoroughly robust and no\n         * longer needs redirection to the stash shell script this is kept as\n         * is, then should be changed to RUN_SETUP | NEED_WORK_TREE\n         */\n        { \"stash\", cmd_stash },\n\nOther than that, I think your patch pair is good to go!\n\nCiao,\nDscho\n"},{"id":"392792","messageId":"xmqq8skh9yhj.fsf@gitster-ct.c.googlers.com","threadId":"52879","inReplyTo":"nycvar.QRO.7.76.6.2003031430180.46@tvgsbejvaqbjf.bet","subject":"Re: [PATCH 2/2] stash: remove the stash.useBuiltin setting","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-03-03T16:47:36Z","receivedAt":"2020-03-03T16:47:43Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n>>  \tprefix = setup_git_directory();\n>>  \ttrace_repo_setup(prefix);\n>>  \tsetup_work_tree();\n>\n> However, this is only needed because we did not change `git.c` at the same\n> time (as I had done for `rebase` in 80dfc9242eb (git: mark cmd_rebase as\n> requiring a worktree, 2019-07-24)). In other words, I think we will also\n> want to address this part of `git.c`:\n>\n>         /*\n>          * NEEDSWORK: Until the builtin stash is thoroughly robust and no\n>          * longer needs redirection to the stash shell script this is kept as\n>          * is, then should be changed to RUN_SETUP | NEED_WORK_TREE\n>          */\n>         { \"stash\", cmd_stash },\n\nAh, I missed that part; thanks for chiming in.\n"},{"id":"392802","messageId":"20200303173625.GC1571684@cat","threadId":"52879","inReplyTo":"nycvar.QRO.7.76.6.2003031430180.46@tvgsbejvaqbjf.bet","subject":"Re: [PATCH 2/2] stash: remove the stash.useBuiltin setting","fromName":"Thomas Gummerer","fromEmail":"t.gummerer@gmail.com","sentAt":"2020-03-03T17:36:25Z","receivedAt":"2020-03-03T17:36:33Z","isPatch":true,"sender":{"key":"t.gummerer@gmail.com","avatar":"https://avatars.githubusercontent.com/u/191004?v=4"},"body":"On 03/03, Johannes Schindelin wrote:\n> Hi Thomas,\n> \n> On Mon, 2 Mar 2020, Thomas Gummerer wrote:\n> \n> > Remove the stash.useBuiltin setting which was added as an escape hatch\n> > to disable the builtin version of stash first released with Git 2.22.\n> \n> Great!\n> \n> > diff --git a/builtin/stash.c b/builtin/stash.c\n> > index f371db270c..5f4bd693df 100644\n> > --- a/builtin/stash.c\n> > +++ b/builtin/stash.c\n> > @@ -1558,22 +1540,18 @@ int cmd_stash(int argc, const char **argv, const char *prefix)\n> >  \t\tOPT_END()\n> >  \t};\n> >\n> > -\tif (!use_builtin_stash()) {\n> > -\t\tconst char *path = mkpath(\"%s/git-legacy-stash\",\n> > -\t\t\t\t\t  git_exec_path());\n> > -\n> > -\t\tif (sane_execvp(path, (char **)argv) < 0)\n> > -\t\t\tdie_errno(_(\"could not exec %s\"), path);\n> > -\t\telse\n> > -\t\t\tBUG(\"sane_execvp() returned???\");\n> > -\t}\n> > -\n> >  \tprefix = setup_git_directory();\n> >  \ttrace_repo_setup(prefix);\n> >  \tsetup_work_tree();\n> \n> However, this is only needed because we did not change `git.c` at the same\n> time (as I had done for `rebase` in 80dfc9242eb (git: mark cmd_rebase as\n> requiring a worktree, 2019-07-24)). In other words, I think we will also\n> want to address this part of `git.c`:\n> \n>         /*\n>          * NEEDSWORK: Until the builtin stash is thoroughly robust and no\n>          * longer needs redirection to the stash shell script this is kept as\n>          * is, then should be changed to RUN_SETUP | NEED_WORK_TREE\n>          */\n>         { \"stash\", cmd_stash },\n> \n> Other than that, I think your patch pair is good to go!\n\nAh I had completely missed that, thanks for catching it!  Will send\nthe updated patches shortly.\n"},{"id":"392804","messageId":"20200303174613.3557960-2-t.gummerer@gmail.com","threadId":"52879","inReplyTo":"20200303174613.3557960-1-t.gummerer@gmail.com","subject":"[PATCH v2 2/2] stash: remove the stash.useBuiltin setting","fromName":"Thomas Gummerer","fromEmail":"t.gummerer@gmail.com","sentAt":"2020-03-03T17:46:13Z","receivedAt":"2020-03-03T17:46:32Z","isPatch":true,"sender":{"key":"t.gummerer@gmail.com","avatar":"https://avatars.githubusercontent.com/u/191004?v=4"},"body":"Remove the stash.useBuiltin setting which was added as an escape hatch\nto disable the builtin version of stash first released with Git 2.22.\n\nCarrying the legacy version is a maintenance burden, and has in fact\nbecome out of date failing a test since the 2.23 release, without\nanyone noticing until now.  So users would be getting a hint to fall\nback to a potentially buggy version of the tool.\n\nWe used to shell out to git config to get the useBuiltin configuration\nto avoid changing any global state before spawning legacy-stash.\nHowever that is no longer necessary, so just use the 'git_config'\nfunction to get the setting instead.\n\nSimilar to what we've done in d03ebd411c (\"rebase: remove the\nrebase.useBuiltin setting\", 2019-03-18), where we remove the\ncorresponding setting for rebase, we leave the documentation in place,\nso people can refer back to it when searching for it online, and so we\ncan refer to it in the commit message.\n\nSigned-off-by: Thomas Gummerer <t.gummerer@gmail.com>\n---\n .gitignore                     |   1 -\n Documentation/config/stash.txt |  18 +-\n Makefile                       |   1 -\n builtin/stash.c                |  47 +-\n git-legacy-stash.sh            | 798 ---------------------------------\n git.c                          |   7 +-\n t/README                       |   4 -\n t/t3903-stash.sh               |  14 +\n 8 files changed, 30 insertions(+), 860 deletions(-)\n delete mode 100755 git-legacy-stash.sh\n\ndiff --git a/.gitignore b/.gitignore\nindex aebe7c0908..188bd1c3de 100644\n--- a/.gitignore\n+++ b/.gitignore\n@@ -83,7 +83,6 @@\n /git-init-db\n /git-interpret-trailers\n /git-instaweb\n-/git-legacy-stash\n /git-log\n /git-ls-files\n /git-ls-remote\ndiff --git a/Documentation/config/stash.txt b/Documentation/config/stash.txt\nindex abc7ef4a3a..0f3db821f6 100644\n--- a/Documentation/config/stash.txt\n+++ b/Documentation/config/stash.txt\n@@ -1,17 +1,9 @@\n stash.useBuiltin::\n-       Set to `false` to use the legacy shell script implementation of\n-       linkgit:git-stash[1]. Is `true` by default, which means use\n-       the built-in rewrite of it in C.\n-+\n-The C rewrite is first included with Git version 2.22 (and Git for Windows\n-version 2.19). This option serves as an escape hatch to re-enable the\n-legacy version in case any bugs are found in the rewrite. This option and\n-the shell script version of linkgit:git-stash[1] will be removed in some\n-future release.\n-+\n-If you find some reason to set this option to `false`, other than\n-one-off testing, you should report the behavior difference as a bug in\n-Git (see https://git-scm.com/community for details).\n+\tUnused configuration Variable.  Used in Git versions 2.22 to\n+\t2.26 as an escape hatch to enable the legacy shellscript\n+\timplementation of rebase. Now the built-in rewrite of it in C\n+\tis always used. Setting this will emit a warning, to alert any\n+\tremaining users that setting this now does nothing.\n \n stash.showPatch::\n \tIf this is set to true, the `git stash show` command without an\ndiff --git a/Makefile b/Makefile\nindex 9804a0758b..096c6d1fbb 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -609,7 +609,6 @@ SCRIPT_SH += git-merge-one-file.sh\n SCRIPT_SH += git-merge-resolve.sh\n SCRIPT_SH += git-mergetool.sh\n SCRIPT_SH += git-quiltimport.sh\n-SCRIPT_SH += git-legacy-stash.sh\n SCRIPT_SH += git-request-pull.sh\n SCRIPT_SH += git-submodule.sh\n SCRIPT_SH += git-web--browse.sh\ndiff --git a/builtin/stash.c b/builtin/stash.c\nindex f371db270c..ba908a6834 100644\n--- a/builtin/stash.c\n+++ b/builtin/stash.c\n@@ -701,6 +701,7 @@ static int list_stash(int argc, const char **argv, const char *prefix)\n \n static int show_stat = 1;\n static int show_patch;\n+static int use_legacy_stash;\n \n static int git_stash_config(const char *var, const char *value, void *cb)\n {\n@@ -712,6 +713,10 @@ static int git_stash_config(const char *var, const char *value, void *cb)\n \t\tshow_patch = git_config_bool(var, value);\n \t\treturn 0;\n \t}\n+\tif (!strcmp(var, \"stash.usebuiltin\")) {\n+\t\tuse_legacy_stash = !git_config_bool(var, value);\n+\t\treturn 0;\n+\t}\n \treturn git_diff_basic_config(var, value, cb);\n }\n \n@@ -1524,29 +1529,6 @@ static int save_stash(int argc, const char **argv, const char *prefix)\n \treturn ret;\n }\n \n-static int use_builtin_stash(void)\n-{\n-\tstruct child_process cp = CHILD_PROCESS_INIT;\n-\tstruct strbuf out = STRBUF_INIT;\n-\tint ret, env = git_env_bool(\"GIT_TEST_STASH_USE_BUILTIN\", -1);\n-\n-\tif (env != -1)\n-\t\treturn env;\n-\n-\targv_array_pushl(&cp.args,\n-\t\t\t \"config\", \"--bool\", \"stash.usebuiltin\", NULL);\n-\tcp.git_cmd = 1;\n-\tif (capture_command(&cp, &out, 6)) {\n-\t\tstrbuf_release(&out);\n-\t\treturn 1;\n-\t}\n-\n-\tstrbuf_trim(&out);\n-\tret = !strcmp(\"true\", out.buf);\n-\tstrbuf_release(&out);\n-\treturn ret;\n-}\n-\n int cmd_stash(int argc, const char **argv, const char *prefix)\n {\n \tint i = -1;\n@@ -1558,22 +1540,13 @@ int cmd_stash(int argc, const char **argv, const char *prefix)\n \t\tOPT_END()\n \t};\n \n-\tif (!use_builtin_stash()) {\n-\t\tconst char *path = mkpath(\"%s/git-legacy-stash\",\n-\t\t\t\t\t  git_exec_path());\n-\n-\t\tif (sane_execvp(path, (char **)argv) < 0)\n-\t\t\tdie_errno(_(\"could not exec %s\"), path);\n-\t\telse\n-\t\t\tBUG(\"sane_execvp() returned???\");\n-\t}\n-\n-\tprefix = setup_git_directory();\n-\ttrace_repo_setup(prefix);\n-\tsetup_work_tree();\n-\n \tgit_config(git_stash_config, NULL);\n \n+\tif (use_legacy_stash ||\n+\t    !git_env_bool(\"GIT_TEST_STASH_USE_BUILTIN\", -1))\n+\t\twarning(_(\"the stash.useBuiltin support has been removed!\\n\"\n+\t\t\t  \"See its entry in 'git help config' for details.\"));\n+\n \targc = parse_options(argc, argv, prefix, options, git_stash_usage,\n \t\t\t     PARSE_OPT_KEEP_UNKNOWN | PARSE_OPT_KEEP_DASHDASH);\n \ndiff --git a/git-legacy-stash.sh b/git-legacy-stash.sh\ndeleted file mode 100755\nindex 4d4ebb4f2b..0000000000\n--- a/git-legacy-stash.sh\n+++ /dev/null\n@@ -1,798 +0,0 @@\n-#!/bin/sh\n-# Copyright (c) 2007, Nanako Shiraishi\n-\n-dashless=$(basename \"$0\" | sed -e 's/-/ /')\n-USAGE=\"list [<options>]\n-   or: $dashless show [<stash>]\n-   or: $dashless drop [-q|--quiet] [<stash>]\n-   or: $dashless ( pop | apply ) [--index] [-q|--quiet] [<stash>]\n-   or: $dashless branch <branchname> [<stash>]\n-   or: $dashless save [--patch] [-k|--[no-]keep-index] [-q|--quiet]\n-\t\t      [-u|--include-untracked] [-a|--all] [<message>]\n-   or: $dashless [push [--patch] [-k|--[no-]keep-index] [-q|--quiet]\n-\t\t       [-u|--include-untracked] [-a|--all] [-m <message>]\n-\t\t       [-- <pathspec>...]]\n-   or: $dashless clear\"\n-\n-SUBDIRECTORY_OK=Yes\n-OPTIONS_SPEC=\n-START_DIR=$(pwd)\n-. git-sh-setup\n-require_work_tree\n-prefix=$(git rev-parse --show-prefix) || exit 1\n-cd_to_toplevel\n-\n-TMP=\"$GIT_DIR/.git-stash.$$\"\n-TMPindex=${GIT_INDEX_FILE-\"$(git rev-parse --git-path index)\"}.stash.$$\n-trap 'rm -f \"$TMP-\"* \"$TMPindex\"' 0\n-\n-ref_stash=refs/stash\n-\n-if git config --get-colorbool color.interactive; then\n-       help_color=\"$(git config --get-color color.interactive.help 'red bold')\"\n-       reset_color=\"$(git config --get-color '' reset)\"\n-else\n-       help_color=\n-       reset_color=\n-fi\n-\n-no_changes () {\n-\tgit diff-index --quiet --cached HEAD --ignore-submodules -- \"$@\" &&\n-\tgit diff-files --quiet --ignore-submodules -- \"$@\" &&\n-\t(test -z \"$untracked\" || test -z \"$(untracked_files \"$@\")\")\n-}\n-\n-untracked_files () {\n-\tif test \"$1\" = \"-z\"\n-\tthen\n-\t\tshift\n-\t\tz=-z\n-\telse\n-\t\tz=\n-\tfi\n-\texcl_opt=--exclude-standard\n-\ttest \"$untracked\" = \"all\" && excl_opt=\n-\tgit ls-files -o $z $excl_opt -- \"$@\"\n-}\n-\n-prepare_fallback_ident () {\n-\tif ! git -c user.useconfigonly=yes var GIT_COMMITTER_IDENT >/dev/null 2>&1\n-\tthen\n-\t\tGIT_AUTHOR_NAME=\"git stash\"\n-\t\tGIT_AUTHOR_EMAIL=git@stash\n-\t\tGIT_COMMITTER_NAME=\"git stash\"\n-\t\tGIT_COMMITTER_EMAIL=git@stash\n-\t\texport GIT_AUTHOR_NAME\n-\t\texport GIT_AUTHOR_EMAIL\n-\t\texport GIT_COMMITTER_NAME\n-\t\texport GIT_COMMITTER_EMAIL\n-\tfi\n-}\n-\n-clear_stash () {\n-\tif test $# != 0\n-\tthen\n-\t\tdie \"$(gettext \"git stash clear with parameters is unimplemented\")\"\n-\tfi\n-\tif current=$(git rev-parse --verify --quiet $ref_stash)\n-\tthen\n-\t\tgit update-ref -d $ref_stash $current\n-\tfi\n-}\n-\n-maybe_quiet () {\n-\tcase \"$1\" in\n-\t--keep-stdout)\n-\t\tshift\n-\t\tif test -n \"$GIT_QUIET\"\n-\t\tthen\n-\t\t\t\"$@\" 2>/dev/null\n-\t\telse\n-\t\t\t\"$@\"\n-\t\tfi\n-\t\t;;\n-\t*)\n-\t\tif test -n \"$GIT_QUIET\"\n-\t\tthen\n-\t\t\t\"$@\" >/dev/null 2>&1\n-\t\telse\n-\t\t\t\"$@\"\n-\t\tfi\n-\t\t;;\n-\tesac\n-}\n-\n-create_stash () {\n-\n-\tprepare_fallback_ident\n-\n-\tstash_msg=\n-\tuntracked=\n-\twhile test $# != 0\n-\tdo\n-\t\tcase \"$1\" in\n-\t\t-m|--message)\n-\t\t\tshift\n-\t\t\tstash_msg=${1?\"BUG: create_stash () -m requires an argument\"}\n-\t\t\t;;\n-\t\t-m*)\n-\t\t\tstash_msg=${1#-m}\n-\t\t\t;;\n-\t\t--message=*)\n-\t\t\tstash_msg=${1#--message=}\n-\t\t\t;;\n-\t\t-u|--include-untracked)\n-\t\t\tshift\n-\t\t\tuntracked=${1?\"BUG: create_stash () -u requires an argument\"}\n-\t\t\t;;\n-\t\t--)\n-\t\t\tshift\n-\t\t\tbreak\n-\t\t\t;;\n-\t\tesac\n-\t\tshift\n-\tdone\n-\n-\tgit update-index -q --refresh\n-\tif maybe_quiet no_changes \"$@\"\n-\tthen\n-\t\texit 0\n-\tfi\n-\n-\t# state of the base commit\n-\tif b_commit=$(maybe_quiet --keep-stdout git rev-parse --verify HEAD)\n-\tthen\n-\t\thead=$(git rev-list --oneline -n 1 HEAD --)\n-\telif test -n \"$GIT_QUIET\"\n-\tthen\n-\t\texit 1\n-\telse\n-\t\tdie \"$(gettext \"You do not have the initial commit yet\")\"\n-\tfi\n-\n-\tif branch=$(git symbolic-ref -q HEAD)\n-\tthen\n-\t\tbranch=${branch#refs/heads/}\n-\telse\n-\t\tbranch='(no branch)'\n-\tfi\n-\tmsg=$(printf '%s: %s' \"$branch\" \"$head\")\n-\n-\t# state of the index\n-\ti_tree=$(git write-tree) &&\n-\ti_commit=$(printf 'index on %s\\n' \"$msg\" |\n-\t\tgit commit-tree $i_tree -p $b_commit) ||\n-\t\tdie \"$(gettext \"Cannot save the current index state\")\"\n-\n-\tif test -n \"$untracked\"\n-\tthen\n-\t\t# Untracked files are stored by themselves in a parentless commit, for\n-\t\t# ease of unpacking later.\n-\t\tu_commit=$(\n-\t\t\tuntracked_files -z \"$@\" | (\n-\t\t\t\tGIT_INDEX_FILE=\"$TMPindex\" &&\n-\t\t\t\texport GIT_INDEX_FILE &&\n-\t\t\t\trm -f \"$TMPindex\" &&\n-\t\t\t\tgit update-index -z --add --remove --stdin &&\n-\t\t\t\tu_tree=$(git write-tree) &&\n-\t\t\t\tprintf 'untracked files on %s\\n' \"$msg\" | git commit-tree $u_tree  &&\n-\t\t\t\trm -f \"$TMPindex\"\n-\t\t) ) || die \"$(gettext \"Cannot save the untracked files\")\"\n-\n-\t\tuntracked_commit_option=\"-p $u_commit\";\n-\telse\n-\t\tuntracked_commit_option=\n-\tfi\n-\n-\tif test -z \"$patch_mode\"\n-\tthen\n-\n-\t\t# state of the working tree\n-\t\tw_tree=$( (\n-\t\t\tgit read-tree --index-output=\"$TMPindex\" -m $i_tree &&\n-\t\t\tGIT_INDEX_FILE=\"$TMPindex\" &&\n-\t\t\texport GIT_INDEX_FILE &&\n-\t\t\tgit diff-index --name-only -z HEAD -- \"$@\" >\"$TMP-stagenames\" &&\n-\t\t\tgit update-index --ignore-skip-worktree-entries \\\n-\t\t\t\t-z --add --remove --stdin <\"$TMP-stagenames\" &&\n-\t\t\tgit write-tree &&\n-\t\t\trm -f \"$TMPindex\"\n-\t\t) ) ||\n-\t\t\tdie \"$(gettext \"Cannot save the current worktree state\")\"\n-\n-\telse\n-\n-\t\trm -f \"$TMP-index\" &&\n-\t\tGIT_INDEX_FILE=\"$TMP-index\" git read-tree HEAD &&\n-\n-\t\t# find out what the user wants\n-\t\tGIT_INDEX_FILE=\"$TMP-index\" \\\n-\t\t\tgit add --legacy-stash-p -- \"$@\" &&\n-\n-\t\t# state of the working tree\n-\t\tw_tree=$(GIT_INDEX_FILE=\"$TMP-index\" git write-tree) ||\n-\t\tdie \"$(gettext \"Cannot save the current worktree state\")\"\n-\n-\t\tgit diff-tree -p HEAD $w_tree -- >\"$TMP-patch\" &&\n-\t\ttest -s \"$TMP-patch\" ||\n-\t\tdie \"$(gettext \"No changes selected\")\"\n-\n-\t\trm -f \"$TMP-index\" ||\n-\t\tdie \"$(gettext \"Cannot remove temporary index (can't happen)\")\"\n-\n-\tfi\n-\n-\t# create the stash\n-\tif test -z \"$stash_msg\"\n-\tthen\n-\t\tstash_msg=$(printf 'WIP on %s' \"$msg\")\n-\telse\n-\t\tstash_msg=$(printf 'On %s: %s' \"$branch\" \"$stash_msg\")\n-\tfi\n-\tw_commit=$(printf '%s\\n' \"$stash_msg\" |\n-\tgit commit-tree $w_tree -p $b_commit -p $i_commit $untracked_commit_option) ||\n-\tdie \"$(gettext \"Cannot record working tree state\")\"\n-}\n-\n-store_stash () {\n-\twhile test $# != 0\n-\tdo\n-\t\tcase \"$1\" in\n-\t\t-m|--message)\n-\t\t\tshift\n-\t\t\tstash_msg=\"$1\"\n-\t\t\t;;\n-\t\t-m*)\n-\t\t\tstash_msg=${1#-m}\n-\t\t\t;;\n-\t\t--message=*)\n-\t\t\tstash_msg=${1#--message=}\n-\t\t\t;;\n-\t\t-q|--quiet)\n-\t\t\tquiet=t\n-\t\t\t;;\n-\t\t*)\n-\t\t\tbreak\n-\t\t\t;;\n-\t\tesac\n-\t\tshift\n-\tdone\n-\ttest $# = 1 ||\n-\tdie \"$(eval_gettext \"\\\"$dashless store\\\" requires one <commit> argument\")\"\n-\n-\tw_commit=\"$1\"\n-\tif test -z \"$stash_msg\"\n-\tthen\n-\t\tstash_msg=\"Created via \\\"git stash store\\\".\"\n-\tfi\n-\n-\tgit update-ref --create-reflog -m \"$stash_msg\" $ref_stash $w_commit\n-\tret=$?\n-\ttest $ret != 0 && test -z \"$quiet\" &&\n-\tdie \"$(eval_gettext \"Cannot update \\$ref_stash with \\$w_commit\")\"\n-\treturn $ret\n-}\n-\n-push_stash () {\n-\tkeep_index=\n-\tpatch_mode=\n-\tuntracked=\n-\tstash_msg=\n-\twhile test $# != 0\n-\tdo\n-\t\tcase \"$1\" in\n-\t\t-k|--keep-index)\n-\t\t\tkeep_index=t\n-\t\t\t;;\n-\t\t--no-keep-index)\n-\t\t\tkeep_index=n\n-\t\t\t;;\n-\t\t-p|--patch)\n-\t\t\tpatch_mode=t\n-\t\t\t# only default to keep if we don't already have an override\n-\t\t\ttest -z \"$keep_index\" && keep_index=t\n-\t\t\t;;\n-\t\t-q|--quiet)\n-\t\t\tGIT_QUIET=t\n-\t\t\t;;\n-\t\t-u|--include-untracked)\n-\t\t\tuntracked=untracked\n-\t\t\t;;\n-\t\t-a|--all)\n-\t\t\tuntracked=all\n-\t\t\t;;\n-\t\t-m|--message)\n-\t\t\tshift\n-\t\t\ttest -z ${1+x} && usage\n-\t\t\tstash_msg=$1\n-\t\t\t;;\n-\t\t-m*)\n-\t\t\tstash_msg=${1#-m}\n-\t\t\t;;\n-\t\t--message=*)\n-\t\t\tstash_msg=${1#--message=}\n-\t\t\t;;\n-\t\t--help)\n-\t\t\tshow_help\n-\t\t\t;;\n-\t\t--)\n-\t\t\tshift\n-\t\t\tbreak\n-\t\t\t;;\n-\t\t-*)\n-\t\t\toption=\"$1\"\n-\t\t\teval_gettextln \"error: unknown option for 'stash push': \\$option\"\n-\t\t\tusage\n-\t\t\t;;\n-\t\t*)\n-\t\t\tbreak\n-\t\t\t;;\n-\t\tesac\n-\t\tshift\n-\tdone\n-\n-\teval \"set $(git rev-parse --sq --prefix \"$prefix\" -- \"$@\")\"\n-\n-\tif test -n \"$patch_mode\" && test -n \"$untracked\"\n-\tthen\n-\t\tdie \"$(gettext \"Can't use --patch and --include-untracked or --all at the same time\")\"\n-\tfi\n-\n-\ttest -n \"$untracked\" || git ls-files --error-unmatch -- \"$@\" >/dev/null || exit 1\n-\n-\tgit update-index -q --refresh\n-\tif maybe_quiet no_changes \"$@\"\n-\tthen\n-\t\tsay \"$(gettext \"No local changes to save\")\"\n-\t\texit 0\n-\tfi\n-\n-\tgit reflog exists $ref_stash ||\n-\t\tclear_stash || die \"$(gettext \"Cannot initialize stash\")\"\n-\n-\tcreate_stash -m \"$stash_msg\" -u \"$untracked\" -- \"$@\"\n-\tstore_stash -m \"$stash_msg\" -q $w_commit ||\n-\tdie \"$(gettext \"Cannot save the current status\")\"\n-\tsay \"$(eval_gettext \"Saved working directory and index state \\$stash_msg\")\"\n-\n-\tif test -z \"$patch_mode\"\n-\tthen\n-\t\ttest \"$untracked\" = \"all\" && CLEAN_X_OPTION=-x || CLEAN_X_OPTION=\n-\t\tif test -n \"$untracked\" && test $# = 0\n-\t\tthen\n-\t\t\tgit clean --force --quiet -d $CLEAN_X_OPTION\n-\t\tfi\n-\n-\t\tif test $# != 0\n-\t\tthen\n-\t\t\ttest -z \"$untracked\" && UPDATE_OPTION=\"-u\" || UPDATE_OPTION=\n-\t\t\ttest \"$untracked\" = \"all\" && FORCE_OPTION=\"--force\" || FORCE_OPTION=\n-\t\t\tgit add $UPDATE_OPTION $FORCE_OPTION -- \"$@\"\n-\t\t\tgit diff-index -p --cached --binary HEAD -- \"$@\" |\n-\t\t\tgit apply --index -R\n-\t\telse\n-\t\t\tgit reset --hard -q --no-recurse-submodules\n-\t\tfi\n-\n-\t\tif test \"$keep_index\" = \"t\" && test -n \"$i_tree\"\n-\t\tthen\n-\t\t\tgit read-tree --reset $i_tree\n-\t\t\tgit ls-files -z --modified -- \"$@\" |\n-\t\t\tgit checkout-index -z --force --stdin\n-\t\tfi\n-\telse\n-\t\tgit apply -R < \"$TMP-patch\" ||\n-\t\tdie \"$(gettext \"Cannot remove worktree changes\")\"\n-\n-\t\tif test \"$keep_index\" != \"t\"\n-\t\tthen\n-\t\t\tgit reset -q -- \"$@\"\n-\t\tfi\n-\tfi\n-}\n-\n-save_stash () {\n-\tpush_options=\n-\twhile test $# != 0\n-\tdo\n-\t\tcase \"$1\" in\n-\t\t-q|--quiet)\n-\t\t\tGIT_QUIET=t\n-\t\t\t;;\n-\t\t--)\n-\t\t\tshift\n-\t\t\tbreak\n-\t\t\t;;\n-\t\t-*)\n-\t\t\t# pass all options through to push_stash\n-\t\t\tpush_options=\"$push_options $1\"\n-\t\t\t;;\n-\t\t*)\n-\t\t\tbreak\n-\t\t\t;;\n-\t\tesac\n-\t\tshift\n-\tdone\n-\n-\tstash_msg=\"$*\"\n-\n-\tif test -z \"$stash_msg\"\n-\tthen\n-\t\tpush_stash $push_options\n-\telse\n-\t\tpush_stash $push_options -m \"$stash_msg\"\n-\tfi\n-}\n-\n-have_stash () {\n-\tgit rev-parse --verify --quiet $ref_stash >/dev/null\n-}\n-\n-list_stash () {\n-\thave_stash || return 0\n-\tgit log --format=\"%gd: %gs\" -g --first-parent -m \"$@\" $ref_stash --\n-}\n-\n-show_stash () {\n-\tALLOW_UNKNOWN_FLAGS=t\n-\tassert_stash_like \"$@\"\n-\n-\tif test -z \"$FLAGS\"\n-\tthen\n-\t\tif test \"$(git config --bool stash.showStat || echo true)\" = \"true\"\n-\t\tthen\n-\t\t\tFLAGS=--stat\n-\t\tfi\n-\n-\t\tif test \"$(git config --bool stash.showPatch || echo false)\" = \"true\"\n-\t\tthen\n-\t\t\tFLAGS=${FLAGS}${FLAGS:+ }-p\n-\t\tfi\n-\n-\t\tif test -z \"$FLAGS\"\n-\t\tthen\n-\t\t\treturn 0\n-\t\tfi\n-\tfi\n-\n-\tgit diff ${FLAGS} $b_commit $w_commit\n-}\n-\n-show_help () {\n-\texec git help stash\n-\texit 1\n-}\n-\n-#\n-# Parses the remaining options looking for flags and\n-# at most one revision defaulting to ${ref_stash}@{0}\n-# if none found.\n-#\n-# Derives related tree and commit objects from the\n-# revision, if one is found.\n-#\n-# stash records the work tree, and is a merge between the\n-# base commit (first parent) and the index tree (second parent).\n-#\n-#   REV is set to the symbolic version of the specified stash-like commit\n-#   IS_STASH_LIKE is non-blank if ${REV} looks like a stash\n-#   IS_STASH_REF is non-blank if the ${REV} looks like a stash ref\n-#   s is set to the SHA1 of the stash commit\n-#   w_commit is set to the commit containing the working tree\n-#   b_commit is set to the base commit\n-#   i_commit is set to the commit containing the index tree\n-#   u_commit is set to the commit containing the untracked files tree\n-#   w_tree is set to the working tree\n-#   b_tree is set to the base tree\n-#   i_tree is set to the index tree\n-#   u_tree is set to the untracked files tree\n-#\n-#   GIT_QUIET is set to t if -q is specified\n-#   INDEX_OPTION is set to --index if --index is specified.\n-#   FLAGS is set to the remaining flags (if allowed)\n-#\n-# dies if:\n-#   * too many revisions specified\n-#   * no revision is specified and there is no stash stack\n-#   * a revision is specified which cannot be resolve to a SHA1\n-#   * a non-existent stash reference is specified\n-#   * unknown flags were set and ALLOW_UNKNOWN_FLAGS is not \"t\"\n-#\n-\n-parse_flags_and_rev()\n-{\n-\ttest \"$PARSE_CACHE\" = \"$*\" && return 0 # optimisation\n-\tPARSE_CACHE=\"$*\"\n-\n-\tIS_STASH_LIKE=\n-\tIS_STASH_REF=\n-\tINDEX_OPTION=\n-\ts=\n-\tw_commit=\n-\tb_commit=\n-\ti_commit=\n-\tu_commit=\n-\tw_tree=\n-\tb_tree=\n-\ti_tree=\n-\tu_tree=\n-\n-\tFLAGS=\n-\tREV=\n-\tfor opt\n-\tdo\n-\t\tcase \"$opt\" in\n-\t\t\t-q|--quiet)\n-\t\t\t\tGIT_QUIET=-t\n-\t\t\t;;\n-\t\t\t--index)\n-\t\t\t\tINDEX_OPTION=--index\n-\t\t\t;;\n-\t\t\t--help)\n-\t\t\t\tshow_help\n-\t\t\t;;\n-\t\t\t-*)\n-\t\t\t\ttest \"$ALLOW_UNKNOWN_FLAGS\" = t ||\n-\t\t\t\t\tdie \"$(eval_gettext \"unknown option: \\$opt\")\"\n-\t\t\t\tFLAGS=\"${FLAGS}${FLAGS:+ }$opt\"\n-\t\t\t;;\n-\t\t\t*)\n-\t\t\t\tREV=\"${REV}${REV:+ }'$opt'\"\n-\t\t\t;;\n-\t\tesac\n-\tdone\n-\n-\teval set -- $REV\n-\n-\tcase $# in\n-\t\t0)\n-\t\t\thave_stash || die \"$(gettext \"No stash entries found.\")\"\n-\t\t\tset -- ${ref_stash}@{0}\n-\t\t;;\n-\t\t1)\n-\t\t\t:\n-\t\t;;\n-\t\t*)\n-\t\t\tdie \"$(eval_gettext \"Too many revisions specified: \\$REV\")\"\n-\t\t;;\n-\tesac\n-\n-\tcase \"$1\" in\n-\t\t*[!0-9]*)\n-\t\t\t:\n-\t\t;;\n-\t\t*)\n-\t\t\tset -- \"${ref_stash}@{$1}\"\n-\t\t;;\n-\tesac\n-\n-\tREV=$(git rev-parse --symbolic --verify --quiet \"$1\") || {\n-\t\treference=\"$1\"\n-\t\tdie \"$(eval_gettext \"\\$reference is not a valid reference\")\"\n-\t}\n-\n-\ti_commit=$(git rev-parse --verify --quiet \"$REV^2\") &&\n-\tset -- $(git rev-parse \"$REV\" \"$REV^1\" \"$REV:\" \"$REV^1:\" \"$REV^2:\" 2>/dev/null) &&\n-\ts=$1 &&\n-\tw_commit=$1 &&\n-\tb_commit=$2 &&\n-\tw_tree=$3 &&\n-\tb_tree=$4 &&\n-\ti_tree=$5 &&\n-\tIS_STASH_LIKE=t &&\n-\ttest \"$ref_stash\" = \"$(git rev-parse --symbolic-full-name \"${REV%@*}\")\" &&\n-\tIS_STASH_REF=t\n-\n-\tu_commit=$(git rev-parse --verify --quiet \"$REV^3\") &&\n-\tu_tree=$(git rev-parse \"$REV^3:\" 2>/dev/null)\n-}\n-\n-is_stash_like()\n-{\n-\tparse_flags_and_rev \"$@\"\n-\ttest -n \"$IS_STASH_LIKE\"\n-}\n-\n-assert_stash_like() {\n-\tis_stash_like \"$@\" || {\n-\t\targs=\"$*\"\n-\t\tdie \"$(eval_gettext \"'\\$args' is not a stash-like commit\")\"\n-\t}\n-}\n-\n-is_stash_ref() {\n-\tis_stash_like \"$@\" && test -n \"$IS_STASH_REF\"\n-}\n-\n-assert_stash_ref() {\n-\tis_stash_ref \"$@\" || {\n-\t\targs=\"$*\"\n-\t\tdie \"$(eval_gettext \"'\\$args' is not a stash reference\")\"\n-\t}\n-}\n-\n-apply_stash () {\n-\n-\tassert_stash_like \"$@\"\n-\n-\tgit update-index -q --refresh || die \"$(gettext \"unable to refresh index\")\"\n-\n-\t# current index state\n-\tc_tree=$(git write-tree) ||\n-\t\tdie \"$(gettext \"Cannot apply a stash in the middle of a merge\")\"\n-\n-\tunstashed_index_tree=\n-\tif test -n \"$INDEX_OPTION\" && test \"$b_tree\" != \"$i_tree\" &&\n-\t\t\ttest \"$c_tree\" != \"$i_tree\"\n-\tthen\n-\t\tgit diff-tree --binary $s^2^..$s^2 | git apply --cached\n-\t\ttest $? -ne 0 &&\n-\t\t\tdie \"$(gettext \"Conflicts in index. Try without --index.\")\"\n-\t\tunstashed_index_tree=$(git write-tree) ||\n-\t\t\tdie \"$(gettext \"Could not save index tree\")\"\n-\t\tgit reset\n-\tfi\n-\n-\tif test -n \"$u_tree\"\n-\tthen\n-\t\tGIT_INDEX_FILE=\"$TMPindex\" git read-tree \"$u_tree\" &&\n-\t\tGIT_INDEX_FILE=\"$TMPindex\" git checkout-index --all &&\n-\t\trm -f \"$TMPindex\" ||\n-\t\tdie \"$(gettext \"Could not restore untracked files from stash entry\")\"\n-\tfi\n-\n-\teval \"\n-\t\tGITHEAD_$w_tree='Stashed changes' &&\n-\t\tGITHEAD_$c_tree='Updated upstream' &&\n-\t\tGITHEAD_$b_tree='Version stash was based on' &&\n-\t\texport GITHEAD_$w_tree GITHEAD_$c_tree GITHEAD_$b_tree\n-\t\"\n-\n-\tif test -n \"$GIT_QUIET\"\n-\tthen\n-\t\tGIT_MERGE_VERBOSITY=0 && export GIT_MERGE_VERBOSITY\n-\tfi\n-\tif git merge-recursive $b_tree -- $c_tree $w_tree\n-\tthen\n-\t\t# No conflict\n-\t\tif test -n \"$unstashed_index_tree\"\n-\t\tthen\n-\t\t\tgit read-tree \"$unstashed_index_tree\"\n-\t\telse\n-\t\t\ta=\"$TMP-added\" &&\n-\t\t\tgit diff-index --cached --name-only --diff-filter=A $c_tree >\"$a\" &&\n-\t\t\tgit read-tree --reset $c_tree &&\n-\t\t\tgit update-index --add --stdin <\"$a\" ||\n-\t\t\t\tdie \"$(gettext \"Cannot unstage modified files\")\"\n-\t\t\trm -f \"$a\"\n-\t\tfi\n-\t\tsquelch=\n-\t\tif test -n \"$GIT_QUIET\"\n-\t\tthen\n-\t\t\tsquelch='>/dev/null 2>&1'\n-\t\tfi\n-\t\t(cd \"$START_DIR\" && eval \"git status $squelch\") || :\n-\telse\n-\t\t# Merge conflict; keep the exit status from merge-recursive\n-\t\tstatus=$?\n-\t\tgit rerere\n-\t\tif test -n \"$INDEX_OPTION\"\n-\t\tthen\n-\t\t\tgettextln \"Index was not unstashed.\" >&2\n-\t\tfi\n-\t\texit $status\n-\tfi\n-}\n-\n-pop_stash() {\n-\tassert_stash_ref \"$@\"\n-\n-\tif apply_stash \"$@\"\n-\tthen\n-\t\tdrop_stash \"$@\"\n-\telse\n-\t\tstatus=$?\n-\t\tsay \"$(gettext \"The stash entry is kept in case you need it again.\")\"\n-\t\texit $status\n-\tfi\n-}\n-\n-drop_stash () {\n-\tassert_stash_ref \"$@\"\n-\n-\tgit reflog delete --updateref --rewrite \"${REV}\" &&\n-\t\tsay \"$(eval_gettext \"Dropped \\${REV} (\\$s)\")\" ||\n-\t\tdie \"$(eval_gettext \"\\${REV}: Could not drop stash entry\")\"\n-\n-\t# clear_stash if we just dropped the last stash entry\n-\tgit rev-parse --verify --quiet \"$ref_stash@{0}\" >/dev/null ||\n-\tclear_stash\n-}\n-\n-apply_to_branch () {\n-\ttest -n \"$1\" || die \"$(gettext \"No branch name specified\")\"\n-\tbranch=$1\n-\tshift 1\n-\n-\tset -- --index \"$@\"\n-\tassert_stash_like \"$@\"\n-\n-\tgit checkout -b $branch $REV^ &&\n-\tapply_stash \"$@\" && {\n-\t\ttest -z \"$IS_STASH_REF\" || drop_stash \"$@\"\n-\t}\n-}\n-\n-test \"$1\" = \"-p\" && set \"push\" \"$@\"\n-\n-PARSE_CACHE='--not-parsed'\n-# The default command is \"push\" if nothing but options are given\n-seen_non_option=\n-for opt\n-do\n-\tcase \"$opt\" in\n-\t--) break ;;\n-\t-*) ;;\n-\t*) seen_non_option=t; break ;;\n-\tesac\n-done\n-\n-test -n \"$seen_non_option\" || set \"push\" \"$@\"\n-\n-# Main command set\n-case \"$1\" in\n-list)\n-\tshift\n-\tlist_stash \"$@\"\n-\t;;\n-show)\n-\tshift\n-\tshow_stash \"$@\"\n-\t;;\n-save)\n-\tshift\n-\tsave_stash \"$@\"\n-\t;;\n-push)\n-\tshift\n-\tpush_stash \"$@\"\n-\t;;\n-apply)\n-\tshift\n-\tapply_stash \"$@\"\n-\t;;\n-clear)\n-\tshift\n-\tclear_stash \"$@\"\n-\t;;\n-create)\n-\tshift\n-\tcreate_stash -m \"$*\" && echo \"$w_commit\"\n-\t;;\n-store)\n-\tshift\n-\tstore_stash \"$@\"\n-\t;;\n-drop)\n-\tshift\n-\tdrop_stash \"$@\"\n-\t;;\n-pop)\n-\tshift\n-\tpop_stash \"$@\"\n-\t;;\n-branch)\n-\tshift\n-\tapply_to_branch \"$@\"\n-\t;;\n-*)\n-\tcase $# in\n-\t0)\n-\t\tpush_stash &&\n-\t\tsay \"$(gettext \"(To restore them type \\\"git stash apply\\\")\")\"\n-\t\t;;\n-\t*)\n-\t\tusage\n-\tesac\n-\t;;\n-esac\ndiff --git a/git.c b/git.c\nindex 7be7ad34bd..b07198fe03 100644\n--- a/git.c\n+++ b/git.c\n@@ -574,12 +574,7 @@ static struct cmd_struct commands[] = {\n \t{ \"show-ref\", cmd_show_ref, RUN_SETUP },\n \t{ \"sparse-checkout\", cmd_sparse_checkout, RUN_SETUP | NEED_WORK_TREE },\n \t{ \"stage\", cmd_add, RUN_SETUP | NEED_WORK_TREE },\n-\t/*\n-\t * NEEDSWORK: Until the builtin stash is thoroughly robust and no\n-\t * longer needs redirection to the stash shell script this is kept as\n-\t * is, then should be changed to RUN_SETUP | NEED_WORK_TREE\n-\t */\n-\t{ \"stash\", cmd_stash },\n+\t{ \"stash\", cmd_stash, RUN_SETUP | NEED_WORK_TREE },\n \t{ \"status\", cmd_status, RUN_SETUP | NEED_WORK_TREE },\n \t{ \"stripspace\", cmd_stripspace },\n \t{ \"submodule--helper\", cmd_submodule__helper, RUN_SETUP | SUPPORT_SUPER_PREFIX | NO_PARSEOPT },\ndiff --git a/t/README b/t/README\nindex 9afd61e3ca..369e3a9ded 100644\n--- a/t/README\n+++ b/t/README\n@@ -393,10 +393,6 @@ the --no-sparse command-line argument.\n GIT_TEST_PRELOAD_INDEX=<boolean> exercises the preload-index code path\n by overriding the minimum number of cache entries required per thread.\n \n-GIT_TEST_STASH_USE_BUILTIN=<boolean>, when false, disables the\n-built-in version of git-stash. See 'stash.useBuiltin' in\n-git-config(1).\n-\n GIT_TEST_ADD_I_USE_BUILTIN=<boolean>, when true, enables the\n built-in version of git add -i. See 'add.interactive.useBuiltin' in\n git-config(1).\ndiff --git a/t/t3903-stash.sh b/t/t3903-stash.sh\nindex ea56e85e70..b84d55a832 100755\n--- a/t/t3903-stash.sh\n+++ b/t/t3903-stash.sh\n@@ -1285,4 +1285,18 @@ test_expect_success 'stash handles skip-worktree entries nicely' '\n \tgit rev-parse --verify refs/stash:A.t\n '\n \n+test_expect_success 'stash -c stash.useBuiltin=false warning ' '\n+\texpected=\"stash.useBuiltin support has been removed\" &&\n+\n+\tgit -c stash.useBuiltin=false stash 2>err &&\n+\ttest_i18ngrep \"$expected\" err &&\n+\tenv GIT_TEST_STASH_USE_BUILTIN=false git stash 2>err &&\n+\ttest_i18ngrep \"$expected\" err &&\n+\n+\tgit -c stash.useBuiltin=true stash 2>err &&\n+\ttest_must_be_empty err &&\n+\tenv GIT_TEST_STASH_USE_BUILTIN=true git stash 2>err &&\n+\ttest_must_be_empty err\n+'\n+\n test_done\n-- \n2.25.1.460.g2f268890c2\n\n"},{"id":"392806","messageId":"20200303174613.3557960-1-t.gummerer@gmail.com","threadId":"52879","inReplyTo":"20200302181832.GA1571684@cat","subject":"[PATCH v2 1/2] stash: get git_stash_config at the top level","fromName":"Thomas Gummerer","fromEmail":"t.gummerer@gmail.com","sentAt":"2020-03-03T17:46:12Z","receivedAt":"2020-03-03T18:13:29Z","isPatch":true,"sender":{"key":"t.gummerer@gmail.com","avatar":"https://avatars.githubusercontent.com/u/191004?v=4"},"body":"In the next commit we're adding another config variable to be read\nfrom 'git_stash_config', that is valid for the top level command\ninstead of just a subset.  Move the 'git_config' invocation for\n'git_stash_config' to the top-level to prepare for that.\n\nSigned-off-by: Thomas Gummerer <t.gummerer@gmail.com>\n---\n builtin/stash.c | 5 ++---\n 1 file changed, 2 insertions(+), 3 deletions(-)\n\ndiff --git a/builtin/stash.c b/builtin/stash.c\nindex 879fc5f368..f371db270c 100644\n--- a/builtin/stash.c\n+++ b/builtin/stash.c\n@@ -712,7 +712,7 @@ static int git_stash_config(const char *var, const char *value, void *cb)\n \t\tshow_patch = git_config_bool(var, value);\n \t\treturn 0;\n \t}\n-\treturn git_default_config(var, value, cb);\n+\treturn git_diff_basic_config(var, value, cb);\n }\n \n static int show_stash(int argc, const char **argv, const char *prefix)\n@@ -749,7 +749,6 @@ static int show_stash(int argc, const char **argv, const char *prefix)\n \t * any options.\n \t */\n \tif (revision_args.argc == 1) {\n-\t\tgit_config(git_stash_config, NULL);\n \t\tif (show_stat)\n \t\t\trev.diffopt.output_format = DIFF_FORMAT_DIFFSTAT;\n \n@@ -1573,7 +1572,7 @@ int cmd_stash(int argc, const char **argv, const char *prefix)\n \ttrace_repo_setup(prefix);\n \tsetup_work_tree();\n \n-\tgit_config(git_diff_basic_config, NULL);\n+\tgit_config(git_stash_config, NULL);\n \n \targc = parse_options(argc, argv, prefix, options, git_stash_usage,\n \t\t\t     PARSE_OPT_KEEP_UNKNOWN | PARSE_OPT_KEEP_DASHDASH);\n-- \n2.25.1.460.g2f268890c2\n\n"},{"id":"392809","messageId":"xmqqeeu98egp.fsf@gitster-ct.c.googlers.com","threadId":"52879","inReplyTo":"20200303174613.3557960-2-t.gummerer@gmail.com","subject":"Re: [PATCH v2 2/2] stash: remove the stash.useBuiltin setting","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-03-03T18:45:26Z","receivedAt":"2020-03-03T18:45:34Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thomas Gummerer <t.gummerer@gmail.com> writes:\n\n> +\tUnused configuration Variable.  Used in Git versions 2.22 to\n\ns/Variable/variable/;\n\n> +\t2.26 as an escape hatch to enable the legacy shellscript\n> +\timplementation of rebase. Now the built-in rewrite of it in C\n> +\tis always used. Setting this will emit a warning, to alert any\n> +\tremaining users that setting this now does nothing.\n\nI am a bit torn between \"just document it here as a stale variable\nthat can safely be removed from your configuration, and do not warn\"\nand what you did here.  Even if we warn for a few releases, this\nentry cannot be removed from the documentation for a lot longer\ntime, if ever, anyway.  It's not like having an extra entry that is\nunused in the configuration file would hurt users, anyway, and it is\nnot obvious that the warning helps more than it disrupts them by\nbugging users to remove it from their configuration file.\n"},{"id":"392853","messageId":"20200304114909.GD1571684@cat","threadId":"52879","inReplyTo":"xmqqeeu98egp.fsf@gitster-ct.c.googlers.com","subject":"Re: [PATCH v2 2/2] stash: remove the stash.useBuiltin setting","fromName":"Thomas Gummerer","fromEmail":"t.gummerer@gmail.com","sentAt":"2020-03-04T11:49:09Z","receivedAt":"2020-03-04T11:49:14Z","isPatch":true,"sender":{"key":"t.gummerer@gmail.com","avatar":"https://avatars.githubusercontent.com/u/191004?v=4"},"body":"On 03/03, Junio C Hamano wrote:\n> Thomas Gummerer <t.gummerer@gmail.com> writes:\n> \n> > +\tUnused configuration Variable.  Used in Git versions 2.22 to\n> \n> s/Variable/variable/;\n\nWhoops.  Do you want me to re-send an updated version, or could you\nfix this up locally?\n\n> > +\t2.26 as an escape hatch to enable the legacy shellscript\n> > +\timplementation of rebase. Now the built-in rewrite of it in C\n> > +\tis always used. Setting this will emit a warning, to alert any\n> > +\tremaining users that setting this now does nothing.\n> \n> I am a bit torn between \"just document it here as a stale variable\n> that can safely be removed from your configuration, and do not warn\"\n> and what you did here.  Even if we warn for a few releases, this\n> entry cannot be removed from the documentation for a lot longer\n> time, if ever, anyway.  It's not like having an extra entry that is\n> unused in the configuration file would hurt users, anyway, and it is\n> not obvious that the warning helps more than it disrupts them by\n> bugging users to remove it from their configuration file.\n\nHmm I'm thinking of the warning mostly as preventing the \"I have\nlegacy stash enabled, why do I see a new bug all of a sudden?\"\nquestion, as opposed to it helping removing this from the docs.  I\nsuspect we have very few people in the wild that did enable legacy\nstash, but if they did it might be better for them to know about the\nconfig variable not having any effect anymore.\n\nFWIW we went with this same approach with removing the\n'rebase.useBuiltin' config, and I don't think we heard any complaints\nabout it in that transition. \n"},{"id":"392862","messageId":"xmqqh7z45bph.fsf@gitster-ct.c.googlers.com","threadId":"52879","inReplyTo":"20200304114909.GD1571684@cat","subject":"Re: [PATCH v2 2/2] stash: remove the stash.useBuiltin setting","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-03-04T16:25:30Z","receivedAt":"2020-03-04T16:25:38Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thomas Gummerer <t.gummerer@gmail.com> writes:\n\n> On 03/03, Junio C Hamano wrote:\n>> Thomas Gummerer <t.gummerer@gmail.com> writes:\n>> \n>> > +\tUnused configuration Variable.  Used in Git versions 2.22 to\n>> \n>> s/Variable/variable/;\n>\n> Whoops.  Do you want me to re-send an updated version, or could you\n> fix this up locally?\n\nAfter reading your response to the end, it appears that there is no\nother changes needed, so let me do the honors ;-)\n\n>> I am a bit torn between \"just document it here as a stale variable\n>> that can safely be removed from your configuration, and do not warn\"\n>> and what you did here.  Even if we warn for a few releases, this\n>> entry cannot be removed from the documentation for a lot longer\n>> time, if ever, anyway.  It's not like having an extra entry that is\n>> unused in the configuration file would hurt users, anyway, and it is\n>> not obvious that the warning helps more than it disrupts them by\n>> bugging users to remove it from their configuration file.\n>\n> Hmm I'm thinking of the warning mostly as preventing the \"I have\n> legacy stash enabled, why do I see a new bug all of a sudden?\"\n> question, as opposed to it helping removing this from the docs.\n\nOK.  Thanks.\n"},{"id":"392863","messageId":"nycvar.QRO.7.76.6.2003041741060.46@tvgsbejvaqbjf.bet","threadId":"52879","inReplyTo":"20200303173625.GC1571684@cat","subject":"Re: [PATCH 2/2] stash: remove the stash.useBuiltin setting","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2020-03-04T16:41:22Z","receivedAt":"2020-03-04T16:41:33Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Thomas,\n\nOn Tue, 3 Mar 2020, Thomas Gummerer wrote:\n\n> On 03/03, Johannes Schindelin wrote:\n> >\n> > On Mon, 2 Mar 2020, Thomas Gummerer wrote:\n> >\n> > > Remove the stash.useBuiltin setting which was added as an escape hatch\n> > > to disable the builtin version of stash first released with Git 2.22.\n> >\n> > Great!\n> >\n> > > diff --git a/builtin/stash.c b/builtin/stash.c\n> > > index f371db270c..5f4bd693df 100644\n> > > --- a/builtin/stash.c\n> > > +++ b/builtin/stash.c\n> > > @@ -1558,22 +1540,18 @@ int cmd_stash(int argc, const char **argv, const char *prefix)\n> > >  \t\tOPT_END()\n> > >  \t};\n> > >\n> > > -\tif (!use_builtin_stash()) {\n> > > -\t\tconst char *path = mkpath(\"%s/git-legacy-stash\",\n> > > -\t\t\t\t\t  git_exec_path());\n> > > -\n> > > -\t\tif (sane_execvp(path, (char **)argv) < 0)\n> > > -\t\t\tdie_errno(_(\"could not exec %s\"), path);\n> > > -\t\telse\n> > > -\t\t\tBUG(\"sane_execvp() returned???\");\n> > > -\t}\n> > > -\n> > >  \tprefix = setup_git_directory();\n> > >  \ttrace_repo_setup(prefix);\n> > >  \tsetup_work_tree();\n> >\n> > However, this is only needed because we did not change `git.c` at the same\n> > time (as I had done for `rebase` in 80dfc9242eb (git: mark cmd_rebase as\n> > requiring a worktree, 2019-07-24)). In other words, I think we will also\n> > want to address this part of `git.c`:\n> >\n> >         /*\n> >          * NEEDSWORK: Until the builtin stash is thoroughly robust and no\n> >          * longer needs redirection to the stash shell script this is kept as\n> >          * is, then should be changed to RUN_SETUP | NEED_WORK_TREE\n> >          */\n> >         { \"stash\", cmd_stash },\n> >\n> > Other than that, I think your patch pair is good to go!\n>\n> Ah I had completely missed that, thanks for catching it!  Will send\n> the updated patches shortly.\n\nThank you for fixing this so quickly!\n\nCiao,\nDscho\n"},{"id":"392884","messageId":"20200305170445.GE1571684@cat","threadId":"52879","inReplyTo":"xmqqh7z45bph.fsf@gitster-ct.c.googlers.com","subject":"Re: [PATCH v2 2/2] stash: remove the stash.useBuiltin setting","fromName":"Thomas Gummerer","fromEmail":"t.gummerer@gmail.com","sentAt":"2020-03-05T17:04:45Z","receivedAt":"2020-03-05T17:04:51Z","isPatch":true,"sender":{"key":"t.gummerer@gmail.com","avatar":"https://avatars.githubusercontent.com/u/191004?v=4"},"body":"On 03/04, Junio C Hamano wrote:\n> Thomas Gummerer <t.gummerer@gmail.com> writes:\n> \n> > On 03/03, Junio C Hamano wrote:\n> >> Thomas Gummerer <t.gummerer@gmail.com> writes:\n> >> \n> >> > +\tUnused configuration Variable.  Used in Git versions 2.22 to\n> >> \n> >> s/Variable/variable/;\n> >\n> > Whoops.  Do you want me to re-send an updated version, or could you\n> > fix this up locally?\n> \n> After reading your response to the end, it appears that there is no\n> other changes needed, so let me do the honors ;-)\n\nThanks!\n"},{"id":"392902","messageId":"nycvar.QRO.7.76.6.2003061509530.46@tvgsbejvaqbjf.bet","threadId":"52879","inReplyTo":"CA+P7+xqVyMnG6FiyL4hngPfEEMi5CKz1qN5Cy1TMMpLg3CmsBw@mail.gmail.com","subject":"Re: [PATCH 2/2] stash: remove the stash.useBuiltin setting","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2020-03-06T14:11:14Z","receivedAt":"2020-03-06T14:11:36Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Jacob,\n\nOn Thu, 5 Mar 2020, Jacob Keller wrote:\n\n> Sorry this is on phone and might not hit the list since Gmail forces\n> html.... but the docs say git-rebase when you meant git-stash.\n>\n> I didn't want to forget this before I got to a desktop\n\nGood point. You mean this part, right?\n\n> On Mon, Mar 2, 2020, 10:20 AM Thomas Gummerer <t.gummerer@gmail.com> wrote:\n>\n> > diff --git a/Documentation/config/stash.txt\n> > b/Documentation/config/stash.txt\n> > index abc7ef4a3a..0f3db821f6 100644\n> > --- a/Documentation/config/stash.txt\n> > +++ b/Documentation/config/stash.txt\n> > @@ -1,17 +1,9 @@\n> >  stash.useBuiltin::\n> > -       Set to `false` to use the legacy shell script implementation of\n> > -       linkgit:git-stash[1]. Is `true` by default, which means use\n> > -       the built-in rewrite of it in C.\n> > -+\n> > -The C rewrite is first included with Git version 2.22 (and Git for Windows\n> > -version 2.19). This option serves as an escape hatch to re-enable the\n> > -legacy version in case any bugs are found in the rewrite. This option and\n> > -the shell script version of linkgit:git-stash[1] will be removed in some\n> > -future release.\n> > -+\n> > -If you find some reason to set this option to `false`, other than\n> > -one-off testing, you should report the behavior difference as a bug in\n> > -Git (see https://git-scm.com/community for details).\n> > +       Unused configuration Variable.  Used in Git versions 2.22 to\n> > +       2.26 as an escape hatch to enable the legacy shellscript\n> > +       implementation of rebase. Now the built-in rewrite of it in C\n                              ^^^^^^\n\n\nIf so, I agree, that should be s/rebase/stash/.\n\nThanks for paying apparently more attention than I did!\nDscho\n\n> > +       is always used. Setting this will emit a warning, to alert any\n> > +       remaining users that setting this now does nothing.\n> >\n> >  stash.showPatch::\n> >         If this is set to true, the `git stash show` command without an\n"},{"id":"392905","messageId":"CABPp-BGtez4qjbtFT1hQoREfcJPmk9MzjhY5eEq1QhXT23tFOw@mail.gmail.com","threadId":"52879","inReplyTo":"xmqqy2si9z4x.fsf_-_@gitster-ct.c.googlers.com","subject":"Re: non-regression bug in 'git merge' (really, xdiff/xmerge, I think)","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2020-03-06T15:48:01Z","receivedAt":"2020-03-06T15:48:15Z","isPatch":false,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"On Mon, Mar 2, 2020 at 2:21 PM Junio C Hamano <gitster@pobox.com> wrote:\n>\n> Thomas Gummerer <t.gummerer@gmail.com> writes:\n>\n> > diff --git a/Makefile b/Makefile\n> > index 9804a0758b..096c6d1fbb 100644\n> > --- a/Makefile\n> > +++ b/Makefile\n> > @@ -609,7 +609,6 @@ SCRIPT_SH += git-merge-one-file.sh\n> >  SCRIPT_SH += git-merge-resolve.sh\n> >  SCRIPT_SH += git-mergetool.sh\n> >  SCRIPT_SH += git-quiltimport.sh\n> > -SCRIPT_SH += git-legacy-stash.sh\n> >  SCRIPT_SH += git-request-pull.sh\n> >  SCRIPT_SH += git-submodule.sh\n> >  SCRIPT_SH += git-web--browse.sh\n>\n> Merging this topic to 'pu', which has dl/merge-autostash topic\n> already merged, breaks the build and it is not fault of Thomas's\n> topic.  dl/merge-autostash has the following bit:\n>\n> commit 4b981afaa03c00524f1d4986271a3f4cc119f4cd\n> Merge: 06928448f7 de4db86ff2\n> Author: Junio C Hamano <gitster@pobox.com>\n> Date:   Mon Mar 2 13:23:26 2020 -0800\n>\n>     Merge branch 'dl/merge-autostash' into pu\n>\n>     \"git merge\" learns the \"--autostash\" option.\n>\n>     * dl/merge-autostash:\n>       ...\n>       Makefile: alphabetically sort += lists\n>\n> diff --git a/Makefile b/Makefile\n> index a5961113d8..c0793ac75b 100644\n> --- a/Makefile\n> +++ b/Makefile\n> @@ -604,12 +604,12 @@ unexport CDPATH\n>  SCRIPT_SH += git-bisect.sh\n>  SCRIPT_SH += git-difftool--helper.sh\n>  SCRIPT_SH += git-filter-branch.sh\n> +SCRIPT_SH += git-legacy-stash.sh\n>  SCRIPT_SH += git-merge-octopus.sh\n>  SCRIPT_SH += git-merge-one-file.sh\n>  SCRIPT_SH += git-merge-resolve.sh\n>  SCRIPT_SH += git-mergetool.sh\n>  SCRIPT_SH += git-quiltimport.sh\n> -SCRIPT_SH += git-legacy-stash.sh\n>  SCRIPT_SH += git-request-pull.sh\n>  SCRIPT_SH += git-submodule.sh\n>  SCRIPT_SH += git-web--browse.sh\n> @@ -617,8 +617,8 @@ SCRIPT_SH += git-web--browse.sh\n>\n> which makes it appear to the xmerge code that legacy-status that\n> used to exist in between quiltimport and request-pull has already\n> been removed.\n>\n> As Thomas's above patch exactly wants to do that (i.e. we want to\n> remove legacy-stash between quiltimport and request-pull), the\n> xmerge code seems to think incorrectly that the requested change has\n> already been applied.  And as a result of that, there remains\n> legacy-stash between fliter-branch and merge-octopus, breaking the\n> build by having one unbuildable build target X-<.\n\nThanks for the heads up; I agree that it looks like an xdiff thing,\nand in particular it reminds me of\nhttps://lore.kernel.org/git/20190816184051.GB13894@sigill.intra.peff.net/\nand https://lore.kernel.org/git/CABPp-BHvJHpSJT7sdFwfNcPn_sOXwJi3=o14qjZS3M8Rzcxe2A@mail.gmail.com/\n\nI'm collecting these cases because I'd like to look into it at some\npoint, though for now I'm more focused on merge-ort (my\nmerge-recursive replacement).\n"},{"id":"392911","messageId":"20200306172948.GG1571684@cat","threadId":"52879","inReplyTo":"CA+P7+xqVyMnG6FiyL4hngPfEEMi5CKz1qN5Cy1TMMpLg3CmsBw@mail.gmail.com","subject":"Re: [PATCH 2/2] stash: remove the stash.useBuiltin setting","fromName":"Thomas Gummerer","fromEmail":"t.gummerer@gmail.com","sentAt":"2020-03-06T17:29:48Z","receivedAt":"2020-03-06T17:29:58Z","isPatch":true,"sender":{"key":"t.gummerer@gmail.com","avatar":"https://avatars.githubusercontent.com/u/191004?v=4"},"body":"On 03/05, Jacob Keller wrote:\n> Sorry this is on phone and might not hit the list since Gmail forces\n> html.... but the docs say git-rebase when you meant git-stash.\n\nEmbarrassing, thanks for noticing it!\n\n> I didn't want to forget this before I got to a desktop\n> \n> On Mon, Mar 2, 2020, 10:20 AM Thomas Gummerer <t.gummerer@gmail.com> wrote:\n> \n> > Remove the stash.useBuiltin setting which was added as an escape hatch\n> > to disable the builtin version of stash first released with Git 2.22.\n> >\n> > Carrying the legacy version is a maintenance burden, and has in fact\n> > become out of date failing a test since the 2.23 release, without\n> > anyone noticing until now.  So users would be getting a hint to fall\n> > back to a potentially buggy version of the tool.\n> >\n> > We used to shell out to git config to get the useBuiltin configuration\n> > to avoid changing any global state before spawning legacy-stash.\n> > However that is no longer necessary, so just use the 'git_config'\n> > function to get the setting instead.\n> >\n> > Similar to what we've done in d03ebd411c (\"rebase: remove the\n> > rebase.useBuiltin setting\", 2019-03-18), where we remove the\n> > corresponding setting for rebase, we leave the documentation in place,\n> > so people can refer back to it when searching for it online, and so we\n> > can refer to it in the commit message.\n> >\n> > Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com>\n> > ---\n> >  .gitignore                     |   1 -\n> >  Documentation/config/stash.txt |  18 +-\n> >  Makefile                       |   1 -\n> >  builtin/stash.c                |  44 +-\n> >  git-legacy-stash.sh            | 798 ---------------------------------\n> >  t/README                       |   4 -\n> >  t/t3903-stash.sh               |  14 +\n> >  7 files changed, 30 insertions(+), 850 deletions(-)\n> >  delete mode 100755 git-legacy-stash.sh\n> >\n> > diff --git a/.gitignore b/.gitignore\n> > index aebe7c0908..188bd1c3de 100644\n> > --- a/.gitignore\n> > +++ b/.gitignore\n> > @@ -83,7 +83,6 @@\n> >  /git-init-db\n> >  /git-interpret-trailers\n> >  /git-instaweb\n> > -/git-legacy-stash\n> >  /git-log\n> >  /git-ls-files\n> >  /git-ls-remote\n> > diff --git a/Documentation/config/stash.txt\n> > b/Documentation/config/stash.txt\n> > index abc7ef4a3a..0f3db821f6 100644\n> > --- a/Documentation/config/stash.txt\n> > +++ b/Documentation/config/stash.txt\n> > @@ -1,17 +1,9 @@\n> >  stash.useBuiltin::\n> > -       Set to `false` to use the legacy shell script implementation of\n> > -       linkgit:git-stash[1]. Is `true` by default, which means use\n> > -       the built-in rewrite of it in C.\n> > -+\n> > -The C rewrite is first included with Git version 2.22 (and Git for Windows\n> > -version 2.19). This option serves as an escape hatch to re-enable the\n> > -legacy version in case any bugs are found in the rewrite. This option and\n> > -the shell script version of linkgit:git-stash[1] will be removed in some\n> > -future release.\n> > -+\n> > -If you find some reason to set this option to `false`, other than\n> > -one-off testing, you should report the behavior difference as a bug in\n> > -Git (see https://git-scm.com/community for details).\n> > +       Unused configuration Variable.  Used in Git versions 2.22 to\n> > +       2.26 as an escape hatch to enable the legacy shellscript\n> > +       implementation of rebase. Now the built-in rewrite of it in C\n> > +       is always used. Setting this will emit a warning, to alert any\n> > +       remaining users that setting this now does nothing.\n> >\n> >  stash.showPatch::\n> >         If this is set to true, the `git stash show` command without an\n> > diff --git a/Makefile b/Makefile\n> > index 9804a0758b..096c6d1fbb 100644\n> > --- a/Makefile\n> > +++ b/Makefile\n> > @@ -609,7 +609,6 @@ SCRIPT_SH += git-merge-one-file.sh\n> >  SCRIPT_SH += git-merge-resolve.sh\n> >  SCRIPT_SH += git-mergetool.sh\n> >  SCRIPT_SH += git-quiltimport.sh\n> > -SCRIPT_SH += git-legacy-stash.sh\n> >  SCRIPT_SH += git-request-pull.sh\n> >  SCRIPT_SH += git-submodule.sh\n> >  SCRIPT_SH += git-web--browse.sh\n> > diff --git a/builtin/stash.c b/builtin/stash.c\n> > index f371db270c..5f4bd693df 100644\n> > --- a/builtin/stash.c\n> > +++ b/builtin/stash.c\n> > @@ -701,6 +701,7 @@ static int list_stash(int argc, const char **argv,\n> > const char *prefix)\n> >\n> >  static int show_stat = 1;\n> >  static int show_patch;\n> > +static int use_legacy_stash;\n> >\n> >  static int git_stash_config(const char *var, const char *value, void *cb)\n> >  {\n> > @@ -712,6 +713,10 @@ static int git_stash_config(const char *var, const\n> > char *value, void *cb)\n> >                 show_patch = git_config_bool(var, value);\n> >                 return 0;\n> >         }\n> > +       if (!strcmp(var, \"stash.usebuiltin\")) {\n> > +               use_legacy_stash = !git_config_bool(var, value);\n> > +               return 0;\n> > +       }\n> >         return git_diff_basic_config(var, value, cb);\n> >  }\n> >\n> > @@ -1524,29 +1529,6 @@ static int save_stash(int argc, const char **argv,\n> > const char *prefix)\n> >         return ret;\n> >  }\n> >\n> > -static int use_builtin_stash(void)\n> > -{\n> > -       struct child_process cp = CHILD_PROCESS_INIT;\n> > -       struct strbuf out = STRBUF_INIT;\n> > -       int ret, env = git_env_bool(\"GIT_TEST_STASH_USE_BUILTIN\", -1);\n> > -\n> > -       if (env != -1)\n> > -               return env;\n> > -\n> > -       argv_array_pushl(&cp.args,\n> > -                        \"config\", \"--bool\", \"stash.usebuiltin\", NULL);\n> > -       cp.git_cmd = 1;\n> > -       if (capture_command(&cp, &out, 6)) {\n> > -               strbuf_release(&out);\n> > -               return 1;\n> > -       }\n> > -\n> > -       strbuf_trim(&out);\n> > -       ret = !strcmp(\"true\", out.buf);\n> > -       strbuf_release(&out);\n> > -       return ret;\n> > -}\n> > -\n> >  int cmd_stash(int argc, const char **argv, const char *prefix)\n> >  {\n> >         int i = -1;\n> > @@ -1558,22 +1540,18 @@ int cmd_stash(int argc, const char **argv, const\n> > char *prefix)\n> >                 OPT_END()\n> >         };\n> >\n> > -       if (!use_builtin_stash()) {\n> > -               const char *path = mkpath(\"%s/git-legacy-stash\",\n> > -                                         git_exec_path());\n> > -\n> > -               if (sane_execvp(path, (char **)argv) < 0)\n> > -                       die_errno(_(\"could not exec %s\"), path);\n> > -               else\n> > -                       BUG(\"sane_execvp() returned???\");\n> > -       }\n> > -\n> >         prefix = setup_git_directory();\n> >         trace_repo_setup(prefix);\n> >         setup_work_tree();\n> >\n> >         git_config(git_stash_config, NULL);\n> >\n> > +       if (use_legacy_stash ||\n> > +           !git_env_bool(\"GIT_TEST_STASH_USE_BUILTIN\", -1))\n> > +               warning(_(\"the stash.useBuiltin support has been\n> > removed!\\n\"\n> > +                         \"See its entry in 'git help config' for\n> > details.\"));\n> > +\n> > +\n> >         argc = parse_options(argc, argv, prefix, options, git_stash_usage,\n> >                              PARSE_OPT_KEEP_UNKNOWN |\n> > PARSE_OPT_KEEP_DASHDASH);\n> >\n> > diff --git a/git-legacy-stash.sh b/git-legacy-stash.sh\n> > deleted file mode 100755\n> > index 4d4ebb4f2b..0000000000\n> > --- a/git-legacy-stash.sh\n> > +++ /dev/null\n> > @@ -1,798 +0,0 @@\n> > -#!/bin/sh\n> > -# Copyright (c) 2007, Nanako Shiraishi\n> > -\n> > -dashless=$(basename \"$0\" | sed -e 's/-/ /')\n> > -USAGE=\"list [<options>]\n> > -   or: $dashless show [<stash>]\n> > -   or: $dashless drop [-q|--quiet] [<stash>]\n> > -   or: $dashless ( pop | apply ) [--index] [-q|--quiet] [<stash>]\n> > -   or: $dashless branch <branchname> [<stash>]\n> > -   or: $dashless save [--patch] [-k|--[no-]keep-index] [-q|--quiet]\n> > -                     [-u|--include-untracked] [-a|--all] [<message>]\n> > -   or: $dashless [push [--patch] [-k|--[no-]keep-index] [-q|--quiet]\n> > -                      [-u|--include-untracked] [-a|--all] [-m <message>]\n> > -                      [-- <pathspec>...]]\n> > -   or: $dashless clear\"\n> > -\n> > -SUBDIRECTORY_OK=Yes\n> > -OPTIONS_SPEC=\n> > -START_DIR=$(pwd)\n> > -. git-sh-setup\n> > -require_work_tree\n> > -prefix=$(git rev-parse --show-prefix) || exit 1\n> > -cd_to_toplevel\n> > -\n> > -TMP=\"$GIT_DIR/.git-stash.$$\"\n> > -TMPindex=${GIT_INDEX_FILE-\"$(git rev-parse --git-path index)\"}.stash.$$\n> > -trap 'rm -f \"$TMP-\"* \"$TMPindex\"' 0\n> > -\n> > -ref_stash=refs/stash\n> > -\n> > -if git config --get-colorbool color.interactive; then\n> > -       help_color=\"$(git config --get-color color.interactive.help 'red\n> > bold')\"\n> > -       reset_color=\"$(git config --get-color '' reset)\"\n> > -else\n> > -       help_color=\n> > -       reset_color=\n> > -fi\n> > -\n> > -no_changes () {\n> > -       git diff-index --quiet --cached HEAD --ignore-submodules -- \"$@\" &&\n> > -       git diff-files --quiet --ignore-submodules -- \"$@\" &&\n> > -       (test -z \"$untracked\" || test -z \"$(untracked_files \"$@\")\")\n> > -}\n> > -\n> > -untracked_files () {\n> > -       if test \"$1\" = \"-z\"\n> > -       then\n> > -               shift\n> > -               z=-z\n> > -       else\n> > -               z=\n> > -       fi\n> > -       excl_opt=--exclude-standard\n> > -       test \"$untracked\" = \"all\" && excl_opt=\n> > -       git ls-files -o $z $excl_opt -- \"$@\"\n> > -}\n> > -\n> > -prepare_fallback_ident () {\n> > -       if ! git -c user.useconfigonly=yes var GIT_COMMITTER_IDENT\n> > >/dev/null 2>&1\n> > -       then\n> > -               GIT_AUTHOR_NAME=\"git stash\"\n> > -               GIT_AUTHOR_EMAIL=git@stash\n> > -               GIT_COMMITTER_NAME=\"git stash\"\n> > -               GIT_COMMITTER_EMAIL=git@stash\n> > -               export GIT_AUTHOR_NAME\n> > -               export GIT_AUTHOR_EMAIL\n> > -               export GIT_COMMITTER_NAME\n> > -               export GIT_COMMITTER_EMAIL\n> > -       fi\n> > -}\n> > -\n> > -clear_stash () {\n> > -       if test $# != 0\n> > -       then\n> > -               die \"$(gettext \"git stash clear with parameters is\n> > unimplemented\")\"\n> > -       fi\n> > -       if current=$(git rev-parse --verify --quiet $ref_stash)\n> > -       then\n> > -               git update-ref -d $ref_stash $current\n> > -       fi\n> > -}\n> > -\n> > -maybe_quiet () {\n> > -       case \"$1\" in\n> > -       --keep-stdout)\n> > -               shift\n> > -               if test -n \"$GIT_QUIET\"\n> > -               then\n> > -                       \"$@\" 2>/dev/null\n> > -               else\n> > -                       \"$@\"\n> > -               fi\n> > -               ;;\n> > -       *)\n> > -               if test -n \"$GIT_QUIET\"\n> > -               then\n> > -                       \"$@\" >/dev/null 2>&1\n> > -               else\n> > -                       \"$@\"\n> > -               fi\n> > -               ;;\n> > -       esac\n> > -}\n> > -\n> > -create_stash () {\n> > -\n> > -       prepare_fallback_ident\n> > -\n> > -       stash_msg=\n> > -       untracked=\n> > -       while test $# != 0\n> > -       do\n> > -               case \"$1\" in\n> > -               -m|--message)\n> > -                       shift\n> > -                       stash_msg=${1?\"BUG: create_stash () -m requires an\n> > argument\"}\n> > -                       ;;\n> > -               -m*)\n> > -                       stash_msg=${1#-m}\n> > -                       ;;\n> > -               --message=*)\n> > -                       stash_msg=${1#--message=}\n> > -                       ;;\n> > -               -u|--include-untracked)\n> > -                       shift\n> > -                       untracked=${1?\"BUG: create_stash () -u requires an\n> > argument\"}\n> > -                       ;;\n> > -               --)\n> > -                       shift\n> > -                       break\n> > -                       ;;\n> > -               esac\n> > -               shift\n> > -       done\n> > -\n> > -       git update-index -q --refresh\n> > -       if maybe_quiet no_changes \"$@\"\n> > -       then\n> > -               exit 0\n> > -       fi\n> > -\n> > -       # state of the base commit\n> > -       if b_commit=$(maybe_quiet --keep-stdout git rev-parse --verify\n> > HEAD)\n> > -       then\n> > -               head=$(git rev-list --oneline -n 1 HEAD --)\n> > -       elif test -n \"$GIT_QUIET\"\n> > -       then\n> > -               exit 1\n> > -       else\n> > -               die \"$(gettext \"You do not have the initial commit yet\")\"\n> > -       fi\n> > -\n> > -       if branch=$(git symbolic-ref -q HEAD)\n> > -       then\n> > -               branch=${branch#refs/heads/}\n> > -       else\n> > -               branch='(no branch)'\n> > -       fi\n> > -       msg=$(printf '%s: %s' \"$branch\" \"$head\")\n> > -\n> > -       # state of the index\n> > -       i_tree=$(git write-tree) &&\n> > -       i_commit=$(printf 'index on %s\\n' \"$msg\" |\n> > -               git commit-tree $i_tree -p $b_commit) ||\n> > -               die \"$(gettext \"Cannot save the current index state\")\"\n> > -\n> > -       if test -n \"$untracked\"\n> > -       then\n> > -               # Untracked files are stored by themselves in a parentless\n> > commit, for\n> > -               # ease of unpacking later.\n> > -               u_commit=$(\n> > -                       untracked_files -z \"$@\" | (\n> > -                               GIT_INDEX_FILE=\"$TMPindex\" &&\n> > -                               export GIT_INDEX_FILE &&\n> > -                               rm -f \"$TMPindex\" &&\n> > -                               git update-index -z --add --remove --stdin\n> > &&\n> > -                               u_tree=$(git write-tree) &&\n> > -                               printf 'untracked files on %s\\n' \"$msg\" |\n> > git commit-tree $u_tree  &&\n> > -                               rm -f \"$TMPindex\"\n> > -               ) ) || die \"$(gettext \"Cannot save the untracked files\")\"\n> > -\n> > -               untracked_commit_option=\"-p $u_commit\";\n> > -       else\n> > -               untracked_commit_option=\n> > -       fi\n> > -\n> > -       if test -z \"$patch_mode\"\n> > -       then\n> > -\n> > -               # state of the working tree\n> > -               w_tree=$( (\n> > -                       git read-tree --index-output=\"$TMPindex\" -m\n> > $i_tree &&\n> > -                       GIT_INDEX_FILE=\"$TMPindex\" &&\n> > -                       export GIT_INDEX_FILE &&\n> > -                       git diff-index --name-only -z HEAD -- \"$@\"\n> > >\"$TMP-stagenames\" &&\n> > -                       git update-index --ignore-skip-worktree-entries \\\n> > -                               -z --add --remove --stdin\n> > <\"$TMP-stagenames\" &&\n> > -                       git write-tree &&\n> > -                       rm -f \"$TMPindex\"\n> > -               ) ) ||\n> > -                       die \"$(gettext \"Cannot save the current worktree\n> > state\")\"\n> > -\n> > -       else\n> > -\n> > -               rm -f \"$TMP-index\" &&\n> > -               GIT_INDEX_FILE=\"$TMP-index\" git read-tree HEAD &&\n> > -\n> > -               # find out what the user wants\n> > -               GIT_INDEX_FILE=\"$TMP-index\" \\\n> > -                       git add --legacy-stash-p -- \"$@\" &&\n> > -\n> > -               # state of the working tree\n> > -               w_tree=$(GIT_INDEX_FILE=\"$TMP-index\" git write-tree) ||\n> > -               die \"$(gettext \"Cannot save the current worktree state\")\"\n> > -\n> > -               git diff-tree -p HEAD $w_tree -- >\"$TMP-patch\" &&\n> > -               test -s \"$TMP-patch\" ||\n> > -               die \"$(gettext \"No changes selected\")\"\n> > -\n> > -               rm -f \"$TMP-index\" ||\n> > -               die \"$(gettext \"Cannot remove temporary index (can't\n> > happen)\")\"\n> > -\n> > -       fi\n> > -\n> > -       # create the stash\n> > -       if test -z \"$stash_msg\"\n> > -       then\n> > -               stash_msg=$(printf 'WIP on %s' \"$msg\")\n> > -       else\n> > -               stash_msg=$(printf 'On %s: %s' \"$branch\" \"$stash_msg\")\n> > -       fi\n> > -       w_commit=$(printf '%s\\n' \"$stash_msg\" |\n> > -       git commit-tree $w_tree -p $b_commit -p $i_commit\n> > $untracked_commit_option) ||\n> > -       die \"$(gettext \"Cannot record working tree state\")\"\n> > -}\n> > -\n> > -store_stash () {\n> > -       while test $# != 0\n> > -       do\n> > -               case \"$1\" in\n> > -               -m|--message)\n> > -                       shift\n> > -                       stash_msg=\"$1\"\n> > -                       ;;\n> > -               -m*)\n> > -                       stash_msg=${1#-m}\n> > -                       ;;\n> > -               --message=*)\n> > -                       stash_msg=${1#--message=}\n> > -                       ;;\n> > -               -q|--quiet)\n> > -                       quiet=t\n> > -                       ;;\n> > -               *)\n> > -                       break\n> > -                       ;;\n> > -               esac\n> > -               shift\n> > -       done\n> > -       test $# = 1 ||\n> > -       die \"$(eval_gettext \"\\\"$dashless store\\\" requires one <commit>\n> > argument\")\"\n> > -\n> > -       w_commit=\"$1\"\n> > -       if test -z \"$stash_msg\"\n> > -       then\n> > -               stash_msg=\"Created via \\\"git stash store\\\".\"\n> > -       fi\n> > -\n> > -       git update-ref --create-reflog -m \"$stash_msg\" $ref_stash $w_commit\n> > -       ret=$?\n> > -       test $ret != 0 && test -z \"$quiet\" &&\n> > -       die \"$(eval_gettext \"Cannot update \\$ref_stash with \\$w_commit\")\"\n> > -       return $ret\n> > -}\n> > -\n> > -push_stash () {\n> > -       keep_index=\n> > -       patch_mode=\n> > -       untracked=\n> > -       stash_msg=\n> > -       while test $# != 0\n> > -       do\n> > -               case \"$1\" in\n> > -               -k|--keep-index)\n> > -                       keep_index=t\n> > -                       ;;\n> > -               --no-keep-index)\n> > -                       keep_index=n\n> > -                       ;;\n> > -               -p|--patch)\n> > -                       patch_mode=t\n> > -                       # only default to keep if we don't already have an\n> > override\n> > -                       test -z \"$keep_index\" && keep_index=t\n> > -                       ;;\n> > -               -q|--quiet)\n> > -                       GIT_QUIET=t\n> > -                       ;;\n> > -               -u|--include-untracked)\n> > -                       untracked=untracked\n> > -                       ;;\n> > -               -a|--all)\n> > -                       untracked=all\n> > -                       ;;\n> > -               -m|--message)\n> > -                       shift\n> > -                       test -z ${1+x} && usage\n> > -                       stash_msg=$1\n> > -                       ;;\n> > -               -m*)\n> > -                       stash_msg=${1#-m}\n> > -                       ;;\n> > -               --message=*)\n> > -                       stash_msg=${1#--message=}\n> > -                       ;;\n> > -               --help)\n> > -                       show_help\n> > -                       ;;\n> > -               --)\n> > -                       shift\n> > -                       break\n> > -                       ;;\n> > -               -*)\n> > -                       option=\"$1\"\n> > -                       eval_gettextln \"error: unknown option for 'stash\n> > push': \\$option\"\n> > -                       usage\n> > -                       ;;\n> > -               *)\n> > -                       break\n> > -                       ;;\n> > -               esac\n> > -               shift\n> > -       done\n> > -\n> > -       eval \"set $(git rev-parse --sq --prefix \"$prefix\" -- \"$@\")\"\n> > -\n> > -       if test -n \"$patch_mode\" && test -n \"$untracked\"\n> > -       then\n> > -               die \"$(gettext \"Can't use --patch and --include-untracked\n> > or --all at the same time\")\"\n> > -       fi\n> > -\n> > -       test -n \"$untracked\" || git ls-files --error-unmatch -- \"$@\"\n> > >/dev/null || exit 1\n> > -\n> > -       git update-index -q --refresh\n> > -       if maybe_quiet no_changes \"$@\"\n> > -       then\n> > -               say \"$(gettext \"No local changes to save\")\"\n> > -               exit 0\n> > -       fi\n> > -\n> > -       git reflog exists $ref_stash ||\n> > -               clear_stash || die \"$(gettext \"Cannot initialize stash\")\"\n> > -\n> > -       create_stash -m \"$stash_msg\" -u \"$untracked\" -- \"$@\"\n> > -       store_stash -m \"$stash_msg\" -q $w_commit ||\n> > -       die \"$(gettext \"Cannot save the current status\")\"\n> > -       say \"$(eval_gettext \"Saved working directory and index state\n> > \\$stash_msg\")\"\n> > -\n> > -       if test -z \"$patch_mode\"\n> > -       then\n> > -               test \"$untracked\" = \"all\" && CLEAN_X_OPTION=-x ||\n> > CLEAN_X_OPTION=\n> > -               if test -n \"$untracked\" && test $# = 0\n> > -               then\n> > -                       git clean --force --quiet -d $CLEAN_X_OPTION\n> > -               fi\n> > -\n> > -               if test $# != 0\n> > -               then\n> > -                       test -z \"$untracked\" && UPDATE_OPTION=\"-u\" ||\n> > UPDATE_OPTION=\n> > -                       test \"$untracked\" = \"all\" &&\n> > FORCE_OPTION=\"--force\" || FORCE_OPTION=\n> > -                       git add $UPDATE_OPTION $FORCE_OPTION -- \"$@\"\n> > -                       git diff-index -p --cached --binary HEAD -- \"$@\" |\n> > -                       git apply --index -R\n> > -               else\n> > -                       git reset --hard -q --no-recurse-submodules\n> > -               fi\n> > -\n> > -               if test \"$keep_index\" = \"t\" && test -n \"$i_tree\"\n> > -               then\n> > -                       git read-tree --reset $i_tree\n> > -                       git ls-files -z --modified -- \"$@\" |\n> > -                       git checkout-index -z --force --stdin\n> > -               fi\n> > -       else\n> > -               git apply -R < \"$TMP-patch\" ||\n> > -               die \"$(gettext \"Cannot remove worktree changes\")\"\n> > -\n> > -               if test \"$keep_index\" != \"t\"\n> > -               then\n> > -                       git reset -q -- \"$@\"\n> > -               fi\n> > -       fi\n> > -}\n> > -\n> > -save_stash () {\n> > -       push_options=\n> > -       while test $# != 0\n> > -       do\n> > -               case \"$1\" in\n> > -               -q|--quiet)\n> > -                       GIT_QUIET=t\n> > -                       ;;\n> > -               --)\n> > -                       shift\n> > -                       break\n> > -                       ;;\n> > -               -*)\n> > -                       # pass all options through to push_stash\n> > -                       push_options=\"$push_options $1\"\n> > -                       ;;\n> > -               *)\n> > -                       break\n> > -                       ;;\n> > -               esac\n> > -               shift\n> > -       done\n> > -\n> > -       stash_msg=\"$*\"\n> > -\n> > -       if test -z \"$stash_msg\"\n> > -       then\n> > -               push_stash $push_options\n> > -       else\n> > -               push_stash $push_options -m \"$stash_msg\"\n> > -       fi\n> > -}\n> > -\n> > -have_stash () {\n> > -       git rev-parse --verify --quiet $ref_stash >/dev/null\n> > -}\n> > -\n> > -list_stash () {\n> > -       have_stash || return 0\n> > -       git log --format=\"%gd: %gs\" -g --first-parent -m \"$@\" $ref_stash --\n> > -}\n> > -\n> > -show_stash () {\n> > -       ALLOW_UNKNOWN_FLAGS=t\n> > -       assert_stash_like \"$@\"\n> > -\n> > -       if test -z \"$FLAGS\"\n> > -       then\n> > -               if test \"$(git config --bool stash.showStat || echo true)\"\n> > = \"true\"\n> > -               then\n> > -                       FLAGS=--stat\n> > -               fi\n> > -\n> > -               if test \"$(git config --bool stash.showPatch || echo\n> > false)\" = \"true\"\n> > -               then\n> > -                       FLAGS=${FLAGS}${FLAGS:+ }-p\n> > -               fi\n> > -\n> > -               if test -z \"$FLAGS\"\n> > -               then\n> > -                       return 0\n> > -               fi\n> > -       fi\n> > -\n> > -       git diff ${FLAGS} $b_commit $w_commit\n> > -}\n> > -\n> > -show_help () {\n> > -       exec git help stash\n> > -       exit 1\n> > -}\n> > -\n> > -#\n> > -# Parses the remaining options looking for flags and\n> > -# at most one revision defaulting to ${ref_stash}@{0}\n> > -# if none found.\n> > -#\n> > -# Derives related tree and commit objects from the\n> > -# revision, if one is found.\n> > -#\n> > -# stash records the work tree, and is a merge between the\n> > -# base commit (first parent) and the index tree (second parent).\n> > -#\n> > -#   REV is set to the symbolic version of the specified stash-like commit\n> > -#   IS_STASH_LIKE is non-blank if ${REV} looks like a stash\n> > -#   IS_STASH_REF is non-blank if the ${REV} looks like a stash ref\n> > -#   s is set to the SHA1 of the stash commit\n> > -#   w_commit is set to the commit containing the working tree\n> > -#   b_commit is set to the base commit\n> > -#   i_commit is set to the commit containing the index tree\n> > -#   u_commit is set to the commit containing the untracked files tree\n> > -#   w_tree is set to the working tree\n> > -#   b_tree is set to the base tree\n> > -#   i_tree is set to the index tree\n> > -#   u_tree is set to the untracked files tree\n> > -#\n> > -#   GIT_QUIET is set to t if -q is specified\n> > -#   INDEX_OPTION is set to --index if --index is specified.\n> > -#   FLAGS is set to the remaining flags (if allowed)\n> > -#\n> > -# dies if:\n> > -#   * too many revisions specified\n> > -#   * no revision is specified and there is no stash stack\n> > -#   * a revision is specified which cannot be resolve to a SHA1\n> > -#   * a non-existent stash reference is specified\n> > -#   * unknown flags were set and ALLOW_UNKNOWN_FLAGS is not \"t\"\n> > -#\n> > -\n> > -parse_flags_and_rev()\n> > -{\n> > -       test \"$PARSE_CACHE\" = \"$*\" && return 0 # optimisation\n> > -       PARSE_CACHE=\"$*\"\n> > -\n> > -       IS_STASH_LIKE=\n> > -       IS_STASH_REF=\n> > -       INDEX_OPTION=\n> > -       s=\n> > -       w_commit=\n> > -       b_commit=\n> > -       i_commit=\n> > -       u_commit=\n> > -       w_tree=\n> > -       b_tree=\n> > -       i_tree=\n> > -       u_tree=\n> > -\n> > -       FLAGS=\n> > -       REV=\n> > -       for opt\n> > -       do\n> > -               case \"$opt\" in\n> > -                       -q|--quiet)\n> > -                               GIT_QUIET=-t\n> > -                       ;;\n> > -                       --index)\n> > -                               INDEX_OPTION=--index\n> > -                       ;;\n> > -                       --help)\n> > -                               show_help\n> > -                       ;;\n> > -                       -*)\n> > -                               test \"$ALLOW_UNKNOWN_FLAGS\" = t ||\n> > -                                       die \"$(eval_gettext \"unknown\n> > option: \\$opt\")\"\n> > -                               FLAGS=\"${FLAGS}${FLAGS:+ }$opt\"\n> > -                       ;;\n> > -                       *)\n> > -                               REV=\"${REV}${REV:+ }'$opt'\"\n> > -                       ;;\n> > -               esac\n> > -       done\n> > -\n> > -       eval set -- $REV\n> > -\n> > -       case $# in\n> > -               0)\n> > -                       have_stash || die \"$(gettext \"No stash entries\n> > found.\")\"\n> > -                       set -- ${ref_stash}@{0}\n> > -               ;;\n> > -               1)\n> > -                       :\n> > -               ;;\n> > -               *)\n> > -                       die \"$(eval_gettext \"Too many revisions specified:\n> > \\$REV\")\"\n> > -               ;;\n> > -       esac\n> > -\n> > -       case \"$1\" in\n> > -               *[!0-9]*)\n> > -                       :\n> > -               ;;\n> > -               *)\n> > -                       set -- \"${ref_stash}@{$1}\"\n> > -               ;;\n> > -       esac\n> > -\n> > -       REV=$(git rev-parse --symbolic --verify --quiet \"$1\") || {\n> > -               reference=\"$1\"\n> > -               die \"$(eval_gettext \"\\$reference is not a valid\n> > reference\")\"\n> > -       }\n> > -\n> > -       i_commit=$(git rev-parse --verify --quiet \"$REV^2\") &&\n> > -       set -- $(git rev-parse \"$REV\" \"$REV^1\" \"$REV:\" \"$REV^1:\" \"$REV^2:\"\n> > 2>/dev/null) &&\n> > -       s=$1 &&\n> > -       w_commit=$1 &&\n> > -       b_commit=$2 &&\n> > -       w_tree=$3 &&\n> > -       b_tree=$4 &&\n> > -       i_tree=$5 &&\n> > -       IS_STASH_LIKE=t &&\n> > -       test \"$ref_stash\" = \"$(git rev-parse --symbolic-full-name \"${REV%@*}\")\"\n> > &&\n> > -       IS_STASH_REF=t\n> > -\n> > -       u_commit=$(git rev-parse --verify --quiet \"$REV^3\") &&\n> > -       u_tree=$(git rev-parse \"$REV^3:\" 2>/dev/null)\n> > -}\n> > -\n> > -is_stash_like()\n> > -{\n> > -       parse_flags_and_rev \"$@\"\n> > -       test -n \"$IS_STASH_LIKE\"\n> > -}\n> > -\n> > -assert_stash_like() {\n> > -       is_stash_like \"$@\" || {\n> > -               args=\"$*\"\n> > -               die \"$(eval_gettext \"'\\$args' is not a stash-like commit\")\"\n> > -       }\n> > -}\n> > -\n> > -is_stash_ref() {\n> > -       is_stash_like \"$@\" && test -n \"$IS_STASH_REF\"\n> > -}\n> > -\n> > -assert_stash_ref() {\n> > -       is_stash_ref \"$@\" || {\n> > -               args=\"$*\"\n> > -               die \"$(eval_gettext \"'\\$args' is not a stash reference\")\"\n> > -       }\n> > -}\n> > -\n> > -apply_stash () {\n> > -\n> > -       assert_stash_like \"$@\"\n> > -\n> > -       git update-index -q --refresh || die \"$(gettext \"unable to refresh\n> > index\")\"\n> > -\n> > -       # current index state\n> > -       c_tree=$(git write-tree) ||\n> > -               die \"$(gettext \"Cannot apply a stash in the middle of a\n> > merge\")\"\n> > -\n> > -       unstashed_index_tree=\n> > -       if test -n \"$INDEX_OPTION\" && test \"$b_tree\" != \"$i_tree\" &&\n> > -                       test \"$c_tree\" != \"$i_tree\"\n> > -       then\n> > -               git diff-tree --binary $s^2^..$s^2 | git apply --cached\n> > -               test $? -ne 0 &&\n> > -                       die \"$(gettext \"Conflicts in index. Try without\n> > --index.\")\"\n> > -               unstashed_index_tree=$(git write-tree) ||\n> > -                       die \"$(gettext \"Could not save index tree\")\"\n> > -               git reset\n> > -       fi\n> > -\n> > -       if test -n \"$u_tree\"\n> > -       then\n> > -               GIT_INDEX_FILE=\"$TMPindex\" git read-tree \"$u_tree\" &&\n> > -               GIT_INDEX_FILE=\"$TMPindex\" git checkout-index --all &&\n> > -               rm -f \"$TMPindex\" ||\n> > -               die \"$(gettext \"Could not restore untracked files from\n> > stash entry\")\"\n> > -       fi\n> > -\n> > -       eval \"\n> > -               GITHEAD_$w_tree='Stashed changes' &&\n> > -               GITHEAD_$c_tree='Updated upstream' &&\n> > -               GITHEAD_$b_tree='Version stash was based on' &&\n> > -               export GITHEAD_$w_tree GITHEAD_$c_tree GITHEAD_$b_tree\n> > -       \"\n> > -\n> > -       if test -n \"$GIT_QUIET\"\n> > -       then\n> > -               GIT_MERGE_VERBOSITY=0 && export GIT_MERGE_VERBOSITY\n> > -       fi\n> > -       if git merge-recursive $b_tree -- $c_tree $w_tree\n> > -       then\n> > -               # No conflict\n> > -               if test -n \"$unstashed_index_tree\"\n> > -               then\n> > -                       git read-tree \"$unstashed_index_tree\"\n> > -               else\n> > -                       a=\"$TMP-added\" &&\n> > -                       git diff-index --cached --name-only\n> > --diff-filter=A $c_tree >\"$a\" &&\n> > -                       git read-tree --reset $c_tree &&\n> > -                       git update-index --add --stdin <\"$a\" ||\n> > -                               die \"$(gettext \"Cannot unstage modified\n> > files\")\"\n> > -                       rm -f \"$a\"\n> > -               fi\n> > -               squelch=\n> > -               if test -n \"$GIT_QUIET\"\n> > -               then\n> > -                       squelch='>/dev/null 2>&1'\n> > -               fi\n> > -               (cd \"$START_DIR\" && eval \"git status $squelch\") || :\n> > -       else\n> > -               # Merge conflict; keep the exit status from merge-recursive\n> > -               status=$?\n> > -               git rerere\n> > -               if test -n \"$INDEX_OPTION\"\n> > -               then\n> > -                       gettextln \"Index was not unstashed.\" >&2\n> > -               fi\n> > -               exit $status\n> > -       fi\n> > -}\n> > -\n> > -pop_stash() {\n> > -       assert_stash_ref \"$@\"\n> > -\n> > -       if apply_stash \"$@\"\n> > -       then\n> > -               drop_stash \"$@\"\n> > -       else\n> > -               status=$?\n> > -               say \"$(gettext \"The stash entry is kept in case you need\n> > it again.\")\"\n> > -               exit $status\n> > -       fi\n> > -}\n> > -\n> > -drop_stash () {\n> > -       assert_stash_ref \"$@\"\n> > -\n> > -       git reflog delete --updateref --rewrite \"${REV}\" &&\n> > -               say \"$(eval_gettext \"Dropped \\${REV} (\\$s)\")\" ||\n> > -               die \"$(eval_gettext \"\\${REV}: Could not drop stash entry\")\"\n> > -\n> > -       # clear_stash if we just dropped the last stash entry\n> > -       git rev-parse --verify --quiet \"$ref_stash@{0}\" >/dev/null ||\n> > -       clear_stash\n> > -}\n> > -\n> > -apply_to_branch () {\n> > -       test -n \"$1\" || die \"$(gettext \"No branch name specified\")\"\n> > -       branch=$1\n> > -       shift 1\n> > -\n> > -       set -- --index \"$@\"\n> > -       assert_stash_like \"$@\"\n> > -\n> > -       git checkout -b $branch $REV^ &&\n> > -       apply_stash \"$@\" && {\n> > -               test -z \"$IS_STASH_REF\" || drop_stash \"$@\"\n> > -       }\n> > -}\n> > -\n> > -test \"$1\" = \"-p\" && set \"push\" \"$@\"\n> > -\n> > -PARSE_CACHE='--not-parsed'\n> > -# The default command is \"push\" if nothing but options are given\n> > -seen_non_option=\n> > -for opt\n> > -do\n> > -       case \"$opt\" in\n> > -       --) break ;;\n> > -       -*) ;;\n> > -       *) seen_non_option=t; break ;;\n> > -       esac\n> > -done\n> > -\n> > -test -n \"$seen_non_option\" || set \"push\" \"$@\"\n> > -\n> > -# Main command set\n> > -case \"$1\" in\n> > -list)\n> > -       shift\n> > -       list_stash \"$@\"\n> > -       ;;\n> > -show)\n> > -       shift\n> > -       show_stash \"$@\"\n> > -       ;;\n> > -save)\n> > -       shift\n> > -       save_stash \"$@\"\n> > -       ;;\n> > -push)\n> > -       shift\n> > -       push_stash \"$@\"\n> > -       ;;\n> > -apply)\n> > -       shift\n> > -       apply_stash \"$@\"\n> > -       ;;\n> > -clear)\n> > -       shift\n> > -       clear_stash \"$@\"\n> > -       ;;\n> > -create)\n> > -       shift\n> > -       create_stash -m \"$*\" && echo \"$w_commit\"\n> > -       ;;\n> > -store)\n> > -       shift\n> > -       store_stash \"$@\"\n> > -       ;;\n> > -drop)\n> > -       shift\n> > -       drop_stash \"$@\"\n> > -       ;;\n> > -pop)\n> > -       shift\n> > -       pop_stash \"$@\"\n> > -       ;;\n> > -branch)\n> > -       shift\n> > -       apply_to_branch \"$@\"\n> > -       ;;\n> > -*)\n> > -       case $# in\n> > -       0)\n> > -               push_stash &&\n> > -               say \"$(gettext \"(To restore them type \\\"git stash\n> > apply\\\")\")\"\n> > -               ;;\n> > -       *)\n> > -               usage\n> > -       esac\n> > -       ;;\n> > -esac\n> > diff --git a/t/README b/t/README\n> > index 9afd61e3ca..369e3a9ded 100644\n> > --- a/t/README\n> > +++ b/t/README\n> > @@ -393,10 +393,6 @@ the --no-sparse command-line argument.\n> >  GIT_TEST_PRELOAD_INDEX=<boolean> exercises the preload-index code path\n> >  by overriding the minimum number of cache entries required per thread.\n> >\n> > -GIT_TEST_STASH_USE_BUILTIN=<boolean>, when false, disables the\n> > -built-in version of git-stash. See 'stash.useBuiltin' in\n> > -git-config(1).\n> > -\n> >  GIT_TEST_ADD_I_USE_BUILTIN=<boolean>, when true, enables the\n> >  built-in version of git add -i. See 'add.interactive.useBuiltin' in\n> >  git-config(1).\n> > diff --git a/t/t3903-stash.sh b/t/t3903-stash.sh\n> > index ea56e85e70..b84d55a832 100755\n> > --- a/t/t3903-stash.sh\n> > +++ b/t/t3903-stash.sh\n> > @@ -1285,4 +1285,18 @@ test_expect_success 'stash handles skip-worktree\n> > entries nicely' '\n> >         git rev-parse --verify refs/stash:A.t\n> >  '\n> >\n> > +test_expect_success 'stash -c stash.useBuiltin=false warning ' '\n> > +       expected=\"stash.useBuiltin support has been removed\" &&\n> > +\n> > +       git -c stash.useBuiltin=false stash 2>err &&\n> > +       test_i18ngrep \"$expected\" err &&\n> > +       env GIT_TEST_STASH_USE_BUILTIN=false git stash 2>err &&\n> > +       test_i18ngrep \"$expected\" err &&\n> > +\n> > +       git -c stash.useBuiltin=true stash 2>err &&\n> > +       test_must_be_empty err &&\n> > +       env GIT_TEST_STASH_USE_BUILTIN=true git stash 2>err &&\n> > +       test_must_be_empty err\n> > +'\n> > +\n> >  test_done\n> > --\n> > 2.25.1.377.g2d2118b814\n> >\n> >\n"}]}