git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v3 3/5] t3903: test stash --index merges

From
PWPhillip Wood <phillip.wood123@gmail.com>
Date
Sep 28, 2026, 15:44 UTC
Message-ID
<97f86d82-b5ec-44df-9ccf-8e6cd93e45f4@gmail.com>
In-Reply-To
<8b5ea5e6f47ee9a57df3a4d97a457d024b3dec00.1790425008.git.ben.knoble@gmail.com>
Hi Ben
On 26/09/2026 13:16, D. Ben Knoble wrote:
> A future commit will refactor index handling for applied stashes, and we
> need to take care to get the order of trees right when merging. Add a
> test that covers this case.

The test looks good, but without the changes in patch 5 it fails and so adding it here breaks running "git bisect" on this series. I'd squash this into the final patch and I think we can probably replace an existing "stash apply --index" tests that are not so strict with this one, rather than adding a new test.

Thanks
Phillip
Show 38 quoted lines
> Suggested-by: Phillip Wood <phillip.wood@dunelm.org.uk>
> Signed-off-by: D. Ben Knoble <ben.knoble@gmail.com>
> ---
>   t/t3903-stash.sh | 21 +++++++++++++++++++++
>   1 file changed, 21 insertions(+)
> 
> diff --git a/t/t3903-stash.sh b/t/t3903-stash.sh
> index 721158606f..9bc99fa252 100755
> --- a/t/t3903-stash.sh
> +++ b/t/t3903-stash.sh
> @@ -374,6 +374,27 @@ setup_stash() {
>   	test_cmp expect actual
>   '
>   
> +# the later "stash -k" test is not expecting us to muck with file so much, so
> +# reset when finished
> +test_expect_success 'stash apply --index merges the correct trees' '
> +	head=$(git rev-parse HEAD) &&
> +	test_when_finished "git reset --hard $head" &&
> +	test_write_lines A B C >file &&
> +	git commit -m setup file &&
> +	test_write_lines A B staged >file &&
> +	git add file &&
> +	test_write_lines A B unstaged >file &&
> +	git stash &&
> +	test_write_lines committed B C >file &&
> +	git commit -m to-be-merged file &&
> +	git stash pop --index &&
> +	git show :file >actual &&
> +	test_write_lines committed B staged >expect &&
> +	test_cmp expect actual &&
> +	test_write_lines committed B unstaged >expect &&
> +	test_cmp expect file
> +'
> +
>   test_expect_success 'stash -k' '
>   	echo bar3 >file &&
>   	echo bar4 >file2 &&
Previous: D. Ben KnobleNext: D. Ben Knoble
Message 38 of 78 in “Hi all,”
  1. 0/2 Hi all,D. Ben Knoble, Sep 19, 2026
  2. 1/2 builtin/stash: remove unused headerD. Ben Knoble, Sep 19, 2026
  3. Junio C HamanoSep 21, 2026
  4. 2/2 builtin/stash: merge index in-coreD. Ben Knoble, Sep 19, 2026
  5. Phillip WoodSep 21, 2026
  6. D. Ben KnobleSep 22, 2026
  7. D. Ben KnobleSep 22, 2026
  8. Phillip WoodSep 22, 2026
  9. D. Ben KnobleSep 22, 2026
  10. D. Ben KnobleSep 19, 2026
  11. 0/4 stash: clean up index-mode test mergeD. Ben Knoble, Sep 23, 2026
  12. 1/4 builtin/stash: remove unused headerD. Ben Knoble, Sep 23, 2026
  13. 2/4 stash: prepare merge options earlierD. Ben Knoble, Sep 23, 2026
  14. 3/4 t: test failed "stash apply --index"D. Ben Knoble, Sep 23, 2026
  15. Phillip WoodSep 24, 2026
  16. D. Ben KnobleSep 25, 2026
  17. Phillip WoodSep 25, 2026
  18. Phillip WoodSep 26, 2026
  19. D. Ben KnobleSep 26, 2026
  20. 4/4 builtin/stash: merge index in-coreD. Ben Knoble, Sep 23, 2026
  21. Phillip WoodSep 24, 2026
  22. D. Ben KnobleSep 25, 2026
  23. Phillip WoodSep 25, 2026
  24. D. Ben KnobleSep 25, 2026
  25. Junio C HamanoSep 24, 2026
  26. Junio C HamanoSep 25, 2026
  27. D. Ben KnobleSep 25, 2026
  28. Junio C HamanoSep 25, 2026
  29. Phillip WoodSep 26, 2026
  30. D. Ben KnobleSep 26, 2026
  31. Phillip WoodSep 25, 2026
  32. D. Ben KnobleSep 25, 2026
  33. Junio C HamanoSep 25, 2026
  34. 0/5 stash: clean up index-mode test mergeD. Ben Knoble, Sep 26, 2026
  35. 1/5 builtin/stash: remove unused headerD. Ben Knoble, Sep 26, 2026
  36. 2/5 stash: prepare merge options earlierD. Ben Knoble, Sep 26, 2026
  37. 3/5 t3903: test stash --index mergesD. Ben Knoble, Sep 26, 2026
  38. Phillip WoodSep 28, 2026
  39. D. Ben KnobleSep 28, 2026
  40. Phillip WoodSep 29, 2026
  41. 4/5 t3903: test failed "stash apply --index"D. Ben Knoble, Sep 26, 2026
  42. 5/5 builtin/stash: merge index in-coreD. Ben Knoble, Sep 26, 2026
  43. Junio C HamanoSep 27, 2026
  44. D. Ben KnobleSep 28, 2026
  45. Junio C HamanoSep 28, 2026
  46. D. Ben KnobleSep 28, 2026
  47. Junio C HamanoSep 28, 2026
  48. D. Ben KnobleSep 26, 2026
  49. Junio C HamanoSep 27, 2026
  50. Phillip WoodSep 28, 2026
  51. D. Ben KnobleSep 28, 2026
  52. D. Ben KnobleSep 28, 2026
  53. D. Ben KnobleSep 28, 2026
  54. Phillip WoodSep 28, 2026
  55. Thomas BachemSep 28, 2026
  56. D. Ben KnobleSep 28, 2026
  57. D. Ben KnobleSep 29, 2026
  58. Phillip WoodSep 29, 2026
  59. Phillip WoodSep 28, 2026
  60. 0/5 stash: clean up index-mode test mergeD. Ben Knoble, Sep 29, 2026
  61. 1/5 builtin/stash: remove unused headerD. Ben Knoble, Sep 29, 2026
  62. 2/5 stash: prepare merge options earlierD. Ben Knoble, Sep 29, 2026
  63. 3/5 t3903: test failed "stash apply --index"D. Ben Knoble, Sep 29, 2026
  64. 4/5 t5520: don't expire reflogs where it mattersD. Ben Knoble, Sep 29, 2026
  65. Phillip WoodSep 29, 2026
  66. 5/5 builtin/stash: merge index in-coreD. Ben Knoble, Sep 29, 2026
  67. Junio C HamanoSep 29, 2026
  68. D. Ben KnobleSep 30, 2026
  69. Phillip WoodSep 29, 2026
  70. Ben KnobleSep 29, 2026
  71. D. Ben KnobleSep 30, 2026
  72. 0/4 stash: clean up index-mode test mergeD. Ben Knoble, Sep 30, 2026
  73. 1/4 builtin/stash: remove unused headerD. Ben Knoble, Sep 30, 2026
  74. 3/4 t3903: test failed "stash apply --index"D. Ben Knoble, Sep 30, 2026
  75. 2/4 stash: prepare merge options earlierD. Ben Knoble, Sep 30, 2026
  76. 4/4 builtin/stash: merge index in-coreD. Ben Knoble, Sep 30, 2026
  77. Phillip WoodOct 1, 2026
  78. Junio C HamanoOct 1, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.