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

Re: [PATCH 1/1] Introduce "precious" file concept

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 19, 2019, 18:08 UTC
Message-ID
<xmqq8syb3b3j.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<CACsJy8CR7VGp7htC_wKC9BUCaQsmkp5Zd4+M7bddPL-jKyfDMQ@mail.gmail.com>
Duy Nguyen <pclouds@gmail.com> writes:
Show 24 quoted lines
> On Sun, Feb 17, 2019 at 2:36 AM Ævar Arnfjörð Bjarmason
> <avarab@gmail.com> wrote:
>>
>>
>> On Sat, Feb 16 2019, Nguyễn Thái Ngọc Duy wrote:
>>
>> [Re-CC some people involved the last time around]
>>
>> > A new attribute "precious" is added to indicate that certain files
>> > have valuable content and should not be easily discarded even if they
>> > are ignored or untracked.
>> >
>> > So far there are one part of Git that are made aware of precious
>> > files: "git clean" will leave precious files alone.
>>
>> Thanks for bringing this up again. There were also some patches recently
>> to save away clobbered files, do you/anyone else have any end goal in
>> mind here that combines this & that, or some other thing I may not have
>> kept up with?
>
> I assume you mean the clobbering untracked files by merge/checkout.
> Those files will be backed up [1] if backup-log is implemented. Even
> files deleted by "git clean" could be saved but that might go a little
> too far.

I agree with Ævar that it is a very good idea to ask what the endgame should look like. I would have expected that, with an introduction of new "ignored but unexpendable" class of file (i.e. "precious" here), operations such as merge and checkout will be updated to keep them in situations where we would remove "ignored and expendable" files (i.e. "ignored"). And it is perfectly OK if the very first introduction of the "precious" support begins only with a single operation, such as "clean", as long as the end-goal is clear.

I personally do not believe in "backup log"; if we can screw up and can fail to stop an operation that must avoid losing info, then we can screw up the same way and fail to design and implement "backup" to save info before an operation loses it. If we do a good job in supporting "precious" in various operations, we can rely less on "backup log" and still be safe ;-)

Previous: Duy NguyenNext: Duy Nguyen
Message 7 of 19 in “Introduce "precious" file attribute”
  1. 0/1 Introduce "precious" file attributeNguyễn Thái Ngọc Duy, Feb 16, 2019
  2. 1/1 Introduce "precious" file conceptNguyễn Thái Ngọc Duy, Feb 16, 2019
  3. Ævar Arnfjörð BjarmasonFeb 16, 2019
  4. Duy NguyenFeb 17, 2019
  5. Ævar Arnfjörð BjarmasonFeb 18, 2019
  6. Duy NguyenFeb 18, 2019
  7. Junio C HamanoFeb 19, 2019
  8. Duy NguyenFeb 20, 2019
  9. Clemens BuchacherFeb 20, 2019
  10. Junio C HamanoFeb 20, 2019
  11. Ævar Arnfjörð BjarmasonFeb 20, 2019
  12. Duy NguyenFeb 20, 2019
  13. Ævar Arnfjörð BjarmasonFeb 20, 2019
  14. Clemens BuchacherFeb 20, 2019
  15. Duy NguyenFeb 22, 2019
  16. Junio C HamanoFeb 20, 2019
  17. Duy NguyenFeb 22, 2019
  18. Junio C HamanoFeb 22, 2019
  19. Steffen JostFeb 20, 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.