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

Re: A puzzle: reset --hard and hard links

From
MHMichael Herrmann <michael@herrmann.io>
Date
Jan 24, 2022, 18:16 UTC
Message-ID
<CABrKpmB7UEGzLCiNHQtY5-Dt16jLkpcpBEx3o8y9OBGZ418keA@mail.gmail.com>
In-Reply-To
<xmqqk0ep57ou.fsf@gitster.g>
> It is merely because you helped Git to realize

I don't want to "help Git realize". I'm sorry but in my opinion `git status` should not have any effects on other commands. I don't understand how you can argue that calling `git status` is a valid fix to "help Git".

> With another step 1.5 "append a line to the file in question", git
> should severe the link,
I don't want to sever the hard link. I want to avoid that it gets severed.
On Mon, 24 Jan 2022 at 15:07, Junio C Hamano <gitster@pobox.com> wrote:
Show 23 quoted lines
>
> Michael Herrmann <michael@herrmann.io> writes:
>
> > I now believe this is a bug in Git because calling `git status` fixes
> > the problem.
> >
> > 1) Create a hard link to a file in a Git repo.
> > 2) Call `git status`.
> > 3) Call `git reset --hard`.
>
> It is merely because you helped Git to realize that there is no need
> to change the contents of hte file with "reset --hard".
>
> With another step 1.5 "append a line to the file in question", git
> should severe the link, I would think, as at that point, to revert
> the contents of the file in question to its pristine state, it needs
> to modify it.
>
>
>
>
>
>
Previous: Junio C HamanoNext: Junio C Hamano
Message 9 of 18 in “A puzzle: reset --hard and hard links”
  1. Michael HerrmannJan 19, 2022
  2. brian m. carlsonJan 19, 2022
  3. Junio C HamanoJan 19, 2022
  4. Michael HerrmannJan 20, 2022
  5. brian m. carlsonJan 20, 2022
  6. Michael HerrmannJan 21, 2022
  7. Michael HerrmannJan 24, 2022
  8. Junio C HamanoJan 24, 2022
  9. Michael HerrmannJan 24, 2022
  10. Junio C HamanoJan 24, 2022
  11. rsbecker@nexbridge.comJan 24, 2022
  12. Michael HerrmannJan 24, 2022
  13. Andreas SchwabJan 25, 2022
  14. Ævar Arnfjörð BjarmasonJan 25, 2022
  15. Andreas SchwabJan 25, 2022
  16. Michael HerrmannJan 25, 2022
  17. brian m. carlsonJan 26, 2022
  18. Junio C HamanoJan 26, 2022

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.