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

Re: Bug with .gitignore and branch switching

From
Duy Nguyen <pclouds@gmail.com>
Date
Mar 18, 2017, 03:40 UTC
Message-ID
<CACsJy8DYx_vEyUBJWQ=-rOGvWG2BBGQKbxYTVS18NPqfk02r9g@mail.gmail.com>
In-Reply-To
<20170317220213.GO26789@aiede.mtv.corp.google.com>
On Sat, Mar 18, 2017 at 5:02 AM, Jonathan Nieder <jrnieder@gmail.com> wrote:
Show 21 quoted lines
> Junio C Hamano wrote:
>
>> There is no "untracked but precious" vs "untracked and expendable"
>> difference in the current system.  An untracked file that matches
>> patterns listed in .gitignore is treated as the latter.
> [...]
>> We've discussed the lack of "untracked but precious" class a few
>> times on the list in the past, but I do not recall the topic came up
>> in the recent past.  It perhaps is because nobody found that class
>> useful enough so far.
>
> The most recent example I can find is 2010:
> http://public-inbox.org/git/4C6A1C5B.4030304@workspacewhiz.com/.
>
> It also came up in 2007:
> http://public-inbox.org/git/C0E9F681E68D48EB8989022D11FEE3D1@ntdev.corp.microsoft.com/
> Earlier in that year it even made the "What's not in 1.5.2" list.
> http://public-inbox.org/git/11793556383977-git-send-email-junkio@cox.net/
>
> Perhaps those references could be a useful starting point for an
> interested person's thinking.

I think I made it work in 2014 [1] using new "precious" attribute, but never submitted it, probably because I was worried about the interaction with untracked cache (adding .gitattributes as a new dependency) though maybe we can avoid that by always checking for preciousness after all the tree walking/filtering is done, either with or without untracked cache. But I never addressed that loose end. Then again, it could also be another useful starting point for interested person's thinking ;-)

[1] https://github.com/pclouds/git/commit/0e7f7afa1879b055369ebd3f1224311c43c8a32b
-- 
Duy
Previous: Junio C HamanoNext: Stefan Beller
Message 5 of 8 in “Bug with .gitignore and branch switching”
  1. Nevada SanchezMar 17, 2017
  2. Junio C HamanoMar 17, 2017
  3. Jonathan NiederMar 17, 2017
  4. Junio C HamanoMar 17, 2017
  5. Duy NguyenMar 18, 2017
  6. Stefan BellerMar 17, 2017
  7. Nevada SanchezMar 18, 2017
  8. Jonathan NiederMar 17, 2017

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.