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

Re: [PATCH v4 4/5] t5520: don't expire reflogs where it matters

From
PWPhillip Wood <phillip.wood123@gmail.com>
Date
Sep 29, 2026, 15:46 UTC
Message-ID
<3547f4aa-649a-4f46-868c-0e50dfa69466@gmail.com>
In-Reply-To
<2ac371d2dc1425cc47bf369e88b321d3c0c8c605.1790684309.git.ben.knoble@gmail.com>
On 29/09/2026 13:18, D. Ben Knoble wrote:
Show 25 quoted lines
> From: Thomas Bachem <mail@thomasbachem.com>
> 
> The "--rebase -f with rebased upstream" test computes its fork point
> from the reflog of refs/remotes/me/copy, and the entry it needs is
> the one that the fetch of the test before it wrote. Like every reflog
> entry the suite writes after test_tick, it is dated 2005, so the
> first "git reflog expire --all" after that fetch removes it. Pull
> then finds no fork point and rebases onto the merge head with the
> merge head as the upstream, and the rewound commits come back as a
> conflict.
> 
> Since 452b12c2e0 (builtin/maintenance: use "geometric" strategy by
> default, 2026-02-24) auto maintenance runs that expiry once the reflog
> of HEAD holds a hundred entries it would remove, the default of
> maintenance.reflog-expire.auto. Which run crosses the threshold
> depends on the entries and maintenance runs before it, so the script
> passed by chance: a stash topic that no longer runs "git reset" from
> "stash apply --index" and a rebase topic that runs auto maintenance
> at the end of "git rebase" together move the expiry between the two
> tests.
> 
> Pin the expiry as ea7d894f44 (t34xx: don't expire reflogs where it
> matters, 2026-02-24) did for the rebase tests. That covers a "git gc"
> as well, which expires reflogs on its own, where turning off the auto
> trigger of the reflog-expire task alone would not.

I find this commit message quite hard to understand. From my perspective the important points are

  - "git merge" uses "git stash" to clear any uncommitted changes from
    the worktree before it tries each strategy. The stashed changes are
    popped with "--index".
  - switching "git stash pop --index" to use merge_incore_nonrecursive()
    causes "git merge" to stop writing the reflog entries that came from
    "git stash pop --index" running "git reset"
  - that combined with "git rebase" starting to run "git maintenance
    --auto" changed when we expire the reflogs which breaks the fork-
    point detection.
The changes themselves look good
Thanks
Phillip
Show 28 quoted lines
> 
> Reported-by: Junio C Hamano <gitster@pobox.com>
> Helped-by: D. Ben Knoble <ben.knoble@gmail.com>
> Helped-by: Phillip Wood <phillip.wood@dunelm.org.uk>
> Assisted-by: Claude Fable 5.1
> Signed-off-by: Thomas Bachem <mail@thomasbachem.com>
> Signed-off-by: D. Ben Knoble <ben.knoble@gmail.com>
> ---
>   t/t5520-pull.sh | 6 ++++++
>   1 file changed, 6 insertions(+)
> 
> diff --git a/t/t5520-pull.sh b/t/t5520-pull.sh
> index 27f38ab3c8..bc818605a5 100755
> --- a/t/t5520-pull.sh
> +++ b/t/t5520-pull.sh
> @@ -35,6 +35,12 @@ test_pull_autostash_fail () {
>   }
>   
>   test_expect_success setup '
> +	# Commit dates are hardcoded to 2005, and the reflog entries will have
> +	# a matching timestamp. Maintenance may thus immediately expire
> +	# reflogs if it was running.
> +	git config set gc.reflogExpire never &&
> +	git config set gc.reflogExpireUnreachable never &&
> +
>   	echo file >file &&
>   	git add file &&
>   	git commit -a -m original
Previous: D. Ben KnobleNext: D. Ben Knoble
Message 65 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.