From: Michael Herrmann <michael@herrmann.io>
To: Junio C Hamano <gitster@pobox.com>
Cc: "brian m. carlson" <sandals@crustytoothpaste.net>, git@vger.kernel.org
Subject: Re: A puzzle: reset --hard and hard links
Date: Mon, 24 Jan 2022 15:16:43 -0300 [thread overview]
Message-ID: <CABrKpmB7UEGzLCiNHQtY5-Dt16jLkpcpBEx3o8y9OBGZ418keA@mail.gmail.com> (raw)
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:
>
> 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.
>
>
>
>
>
>
next prev parent reply other threads:[~2022-01-24 18:17 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-19 20:37 A puzzle: reset --hard and hard links Michael Herrmann
2022-01-19 22:20 ` brian m. carlson
2022-01-19 22:37 ` Junio C Hamano
2022-01-20 8:59 ` Michael Herrmann
2022-01-20 22:20 ` brian m. carlson
2022-01-21 12:50 ` Michael Herrmann
2022-01-24 13:48 ` Michael Herrmann
2022-01-24 18:07 ` Junio C Hamano
2022-01-24 18:16 ` Michael Herrmann [this message]
2022-01-24 21:19 ` Junio C Hamano
2022-01-24 21:50 ` Michael Herrmann
2022-01-25 8:49 ` Andreas Schwab
2022-01-25 11:33 ` Ævar Arnfjörð Bjarmason
2022-01-25 13:29 ` Andreas Schwab
2022-01-25 14:30 ` Michael Herrmann
2022-01-26 2:14 ` brian m. carlson
2022-01-26 18:46 ` Junio C Hamano
2022-01-24 22:18 ` rsbecker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CABrKpmB7UEGzLCiNHQtY5-Dt16jLkpcpBEx3o8y9OBGZ418keA@mail.gmail.com \
--to=michael@herrmann.io \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=sandals@crustytoothpaste.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).