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

Re: [PATCH] Add test that checkout does not overwrite entries in .git/info/exclude

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 21, 2011, 17:27 UTC
Message-ID
<7vfwhhgzcb.fsf@alter.siamese.dyndns.org>
In-Reply-To
<CACsJy8AgDKYhyJ2CD0Y7trGrT63bUuYAS0DadD9khyqEYpguew@mail.gmail.com>
Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes:
> It dated back to f8a9d42 (read-tree: further loosen "working file will
> be lost" check. - 2006-12-04) when you introduced --exclude-per-directory
> to read-tree, but not --exclude-from to explicitly add .git/info/exclude.

That one together with 1127148 (Loosen "working file will be lost" check in Porcelain-ish, 2006-12-04) complets the picture. Thanks for digging this out.

> I guess it's time to add "read-tree --exclude-from".
Perhaps, also --exclude-standard to match?
> We may add an option to checkout to skip
> either .git/info/exclude or .gitignore, or both.

I do not think we want to go that route, because it is not just "checkout" but is an issue shared across users of unpack-trees machinery.

When a merge result loses build/ directory and replaces it with a regular file "build", with the current ignore semantics, build/*.o will go but if you had an untracked and ignored build/TODO, the file will also go, for example. If we want to have "precious", we should either make "ignored" to mean "precious", or introduce a "precious" as a new category (cf. $gmane/185746)

Previous: Nguyen Thai Ngoc DuyNext: Nguyen Thai Ngoc Duy
Message 10 of 23 in “Bug report - local (and git ignored) file silently removed after checkout”
  1. Bertrand BENOITNov 20, 2011
  2. Junio C HamanoNov 20, 2011
  3. Taylor HedbergNov 20, 2011
  4. Junio C HamanoNov 21, 2011
  5. Add test that checkout does not overwrite entries in .git/info/excludeJohannes Sixt, Nov 21, 2011
  6. Philip OakleyNov 21, 2011
  7. Junio C HamanoNov 21, 2011
  8. Junio C HamanoNov 21, 2011
  9. Nguyen Thai Ngoc DuyNov 21, 2011
  10. Junio C HamanoNov 21, 2011
  11. Nguyen Thai Ngoc DuyNov 23, 2011
  12. Nguyen Thai Ngoc DuyNov 21, 2011
  13. Junio C HamanoNov 21, 2011
  14. Bertrand BENOITNov 21, 2011
  15. Nguyen Thai Ngoc DuyNov 23, 2011
  16. Junio C HamanoNov 23, 2011
  17. Nguyen Thai Ngoc DuyNov 24, 2011
  18. Junio C HamanoNov 24, 2011
  19. Nguyen Thai Ngoc DuyNov 24, 2011
  20. Nguyen Thai Ngoc DuyNov 27, 2011
  21. 1/2 checkout,merge: loosen overwriting untracked file check based on info/excludeNguyễn Thái Ngọc Duy, Nov 27, 2011
  22. 2/2 checkout,merge: disallow overwriting ignored files with --no-overwrite-ignoreNguyễn Thái Ngọc Duy, Nov 27, 2011
  23. Junio C HamanoNov 29, 2011

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.