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

Re: [PATCH v3 7/8] checkout: introduce --{,no-}overlay option

From
Thomas Gummerer <t.gummerer@gmail.com>
Date
Jan 23, 2019, 20:21 UTC
Message-ID
<20190123202156.GA11293@hank.intra.tgummerer.com>
In-Reply-To
<20190122235313.GA199923@google.com>
On 01/22, Jonathan Nieder wrote:
Show 19 quoted lines
> Hi,
> 
> Thomas Gummerer wrote:
> 
> > Currently 'git checkout' is defined as an overlay operation, which
> > means that if in 'git checkout <tree-ish> -- [<pathspec>]' we have an
> > entry in the index that matches <pathspec>, but that doesn't exist in
> > <tree-ish>, that entry will not be removed from the index or the
> > working tree.
> >
> > Introduce a new --{,no-}overlay option, which allows using 'git
> > checkout' in non-overlay mode, thus removing files from the working
> > tree if they do not exist in <tree-ish> but match <pathspec>.
> 
> This patch just hit my workstation.  Some initial thoughts:
> 
> I had no idea what --overlay would mean and am still not clear on it.
> Is this analogous to "git add --ignore-removal"?  If so, can we just
> call it --ignore-removal?

Yes, it seems like they are very similar. I'm happy to rename the option. The topic seems to have made it to 'next' already, so I'll submit the patches on top, unless reverting the topic out of next and replacing it is preferred?

> Thank you thank you thank you for working on this.  I run into this
> all the time and am super excited about the "default to
> --no-ignore-removal" future.
:)
Show 7 quoted lines
> I'm nervous about the config with no associated warning or plan for
> phasing it out.  It means that scripts using "git checkout" don't
> get a consistent behavior unless they explicitly pass this option,
> which didn't exist in older versions of Git --- in other words,
> scripts have no real good option.  Can we plan a transition to
> making --no-ignore-removal the default, in multiple steps?  For
> example:

As Junio mentioned, the plan was to just have this mode default when we introduce the new checkout-paths command.

As checkout is a porcelain command, I had hoped it would be okay to also have this as a configuration option, for the time before 'checkout-paths' exists and while I'm getting used to actually typing 'checkout-paths' instead of 'checkout'. However I get that there may be scripts that are using git checkout, and expect the previous behaviour, so I'm also okay with dropping the config option for now.

If we still want to make this the default even after 'checkout-paths' exists, the plan you outline below sounds good to me, though maybe we can make the "flip the default" step once we decide to release git 3.0.

Show 23 quoted lines
>  1. First introduce the commandline option, as in this series
> 
>  2. Next, change the default to warn whenever the difference would
>     matter, printing a hint about how to configure to explicitly
>     request the old or new behavior.
> 
>  3. After a release or two has passed so people get a chance
>     to update their scripts, flip the default.
> 
>  4. Finally, remove the warning.
> 
>  5. Warn whenver the difference would matter when a user has
>     requested the old behavior through config, in preparation
>     for removing the config.
> 
>  6. Remove the config.
> 
> Steps 5 and 6 are optional but might be nice.
> 
> What do you think?
> 
> Thanks,
> Jonathan
Previous: Junio C HamanoNext: Jonathan Nieder
Message 105 of 115 in “introduce no-overlay and cached mode in git checkout”
  1. 0/8 introduce no-overlay and cached mode in git checkoutThomas Gummerer, Dec 9, 2018
  2. 1/8 move worktree tests to t24*Thomas Gummerer, Dec 9, 2018
  3. Junio C HamanoDec 10, 2018
  4. Duy NguyenDec 10, 2018
  5. Thomas GummererDec 11, 2018
  6. Eric SunshineDec 12, 2018
  7. Duy NguyenDec 12, 2018
  8. 3/8 entry: support CE_WT_REMOVE flag in checkout_entryThomas Gummerer, Dec 9, 2018
  9. Duy NguyenDec 10, 2018
  10. Junio C HamanoDec 11, 2018
  11. Duy NguyenDec 12, 2018
  12. Junio C HamanoDec 12, 2018
  13. Elijah NewrenDec 10, 2018
  14. Thomas GummererDec 11, 2018
  15. 2/8 entry: factor out unlink_entry functionThomas Gummerer, Dec 9, 2018
  16. Duy NguyenDec 10, 2018
  17. Elijah NewrenDec 10, 2018
  18. Duy NguyenDec 10, 2018
  19. Junio C HamanoDec 11, 2018
  20. Thomas GummererDec 20, 2018
  21. 4/8 read-cache: add invalidate parameter to remove_marked_cache_entriesThomas Gummerer, Dec 9, 2018
  22. Duy NguyenDec 10, 2018
  23. Elijah NewrenDec 10, 2018
  24. Duy NguyenDec 10, 2018
  25. Elijah NewrenDec 10, 2018
  26. Duy NguyenDec 10, 2018
  27. Elijah NewrenDec 10, 2018
  28. Thomas GummererDec 11, 2018
  29. Junio C HamanoDec 11, 2018
  30. 5/8 checkout: introduce --{,no-}overlay optionThomas Gummerer, Dec 9, 2018
  31. Duy NguyenDec 10, 2018
  32. Thomas GummererDec 11, 2018
  33. Elijah NewrenDec 10, 2018
  34. Junio C HamanoDec 11, 2018
  35. Elijah NewrenDec 11, 2018
  36. Thomas GummererDec 11, 2018
  37. 6/8 checkout: add --cached optionThomas Gummerer, Dec 9, 2018
  38. Duy NguyenDec 10, 2018
  39. Junio C HamanoDec 11, 2018
  40. Elijah NewrenDec 11, 2018
  41. Duy NguyenDec 11, 2018
  42. Duy NguyenJan 31, 2019
  43. Junio C HamanoJan 31, 2019
  44. Duy NguyenFeb 1, 2019
  45. Junio C HamanoFeb 1, 2019
  46. Duy NguyenFeb 2, 2019
  47. Duy NguyenFeb 19, 2019
  48. Elijah NewrenFeb 19, 2019
  49. Duy NguyenFeb 19, 2019
  50. Junio C HamanoFeb 19, 2019
  51. Elijah NewrenFeb 19, 2019
  52. Junio C HamanoFeb 19, 2019
  53. Elijah NewrenFeb 19, 2019
  54. Duy NguyenFeb 20, 2019
  55. Junio C HamanoFeb 19, 2019
  56. Junio C HamanoFeb 19, 2019
  57. Elijah NewrenFeb 19, 2019
  58. Junio C HamanoFeb 19, 2019
  59. Duy NguyenFeb 20, 2019
  60. Duy NguyenFeb 20, 2019
  61. Duy NguyenFeb 20, 2019
  62. Elijah NewrenFeb 19, 2019
  63. Junio C HamanoFeb 19, 2019
  64. Elijah NewrenDec 10, 2018
  65. Thomas GummererDec 11, 2018
  66. 7/8 checkout: allow ignoring unmatched pathspecThomas Gummerer, Dec 9, 2018
  67. Duy NguyenDec 10, 2018
  68. Thomas GummererDec 11, 2018
  69. Elijah NewrenDec 10, 2018
  70. Thomas GummererDec 11, 2018
  71. 8/8 stash: use git checkout --no-overlayThomas Gummerer, Dec 9, 2018
  72. Elijah NewrenDec 10, 2018
  73. Junio C HamanoDec 10, 2018
  74. Thomas GummererDec 20, 2018
  75. Duy NguyenDec 10, 2018
  76. Elijah NewrenDec 10, 2018
  77. Duy NguyenDec 10, 2018
  78. Thomas GummererDec 11, 2018
  79. Junio C HamanoDec 12, 2018
  80. 0/8 introduce no-overlay mode in git checkoutThomas Gummerer, Dec 20, 2018
  81. 1/8 move worktree tests to t24*Thomas Gummerer, Dec 20, 2018
  82. 2/8 entry: factor out unlink_entry functionThomas Gummerer, Dec 20, 2018
  83. 3/8 entry: support CE_WT_REMOVE flag in checkout_entryThomas Gummerer, Dec 20, 2018
  84. 4/8 read-cache: add invalidate parameter to remove_marked_cache_entriesThomas Gummerer, Dec 20, 2018
  85. 5/8 checkout: clarify commentThomas Gummerer, Dec 20, 2018
  86. 6/8 checkout: factor out mark_cache_entry_for_checkout functionThomas Gummerer, Dec 20, 2018
  87. 7/8 checkout: introduce --{,no-}overlay optionThomas Gummerer, Dec 20, 2018
  88. Duy NguyenDec 23, 2018
  89. Eric SunshineDec 23, 2018
  90. Thomas GummererJan 6, 2019
  91. 8/8 checkout: introduce checkout.overlayMode configThomas Gummerer, Dec 20, 2018
  92. Junio C HamanoJan 2, 2019
  93. Thomas GummererJan 6, 2019
  94. Junio C HamanoJan 7, 2019
  95. 0/8 introduce no-overlay mode in git checkoutThomas Gummerer, Jan 8, 2019
  96. 2/8 entry: factor out unlink_entry functionThomas Gummerer, Jan 8, 2019
  97. 1/8 move worktree tests to t24*Thomas Gummerer, Jan 8, 2019
  98. 4/8 read-cache: add invalidate parameter to remove_marked_cache_entriesThomas Gummerer, Jan 8, 2019
  99. 3/8 entry: support CE_WT_REMOVE flag in checkout_entryThomas Gummerer, Jan 8, 2019
  100. 5/8 checkout: clarify commentThomas Gummerer, Jan 8, 2019
  101. 6/8 checkout: factor out mark_cache_entry_for_checkout functionThomas Gummerer, Jan 8, 2019
  102. 7/8 checkout: introduce --{,no-}overlay optionThomas Gummerer, Jan 8, 2019
  103. Jonathan NiederJan 22, 2019
  104. Junio C HamanoJan 23, 2019
  105. Thomas GummererJan 23, 2019
  106. Jonathan NiederJan 23, 2019
  107. Thomas GummererJan 24, 2019
  108. Junio C HamanoJan 23, 2019
  109. Jonathan NiederJan 24, 2019
  110. Thomas GummererJan 24, 2019
  111. Junio C HamanoJan 24, 2019
  112. Jonathan NiederJan 25, 2019
  113. Duy NguyenJan 25, 2019
  114. Philip OakleyFeb 9, 2019
  115. 8/8 checkout: introduce checkout.overlayMode configThomas Gummerer, Jan 8, 2019

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.