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 20, 2019, 22:32 UTC
Message-ID
<xmqqsgwium3o.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<CACsJy8Dq9_uFofs40XwjLkmiBNWXCpic96W1MK_tjLQyaF0+BA@mail.gmail.com>
Duy Nguyen <pclouds@gmail.com> writes:
Show 5 quoted lines
>  - surprises sometimes, but in known classes. This is the main use
> case of backup log, where I may accidentally do "git commit
> -amsomething" after carefully preparing the index. Saving overwritten
> files by merge/checkout could be done here as an alternative to
> "garbage" attribute.

The problem with either of these is not the "saving" half, but "restoring". For different people, and for different cases even to the same person, granularity of what is perceived as a single action is different, so "give me the state of my working tree files before the last operation" is a request that does not have a good definition. After finishing "git rebase" that replays 3 changes, one of which needs manual conflict resolution, you may realize that you made an incorrect resolution for one path but not others. How would you let the user say "no, I do not want to undo the whole rebase, I want to go back to the state where I replayed the first change, saw the conflicts while replaying the second change, and resolved them in these files, but before touching that last one I screwed up resolving, so that I can correct"?

Piling many "backups" (or "snapshots") on top of each other is the easier part; I'd expect that it would be a much harder design problem to let users make use of them in meaningful ways, and that is the primary reason why I am skeptical.

Previous: Clemens BuchacherNext: Ævar Arnfjörð Bjarmason
Message 10 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.