All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Herrmann <michael@herrmann.io>
To: "brian m. carlson" <sandals@crustytoothpaste.net>
Cc: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org
Subject: Re: A puzzle: reset --hard and hard links
Date: Mon, 24 Jan 2022 10:48:27 -0300	[thread overview]
Message-ID: <CABrKpmBFrrWgBh7QAOX35zQr_e+LC1E6Jn5FKb_XP-7bew9Hkg@mail.gmail.com> (raw)
In-Reply-To: <CABrKpmASHgBwPYgKnO2ZZRVVxMti=NFaxw6cBV=pst0xpVZYGA@mail.gmail.com>

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`.

Without 2), Git severs the hard link. With 2), the hard link is preserved.

Reproduction steps ("Test script") and further info:
https://github.com/brave/brave-browser/issues/20316#issuecomment-1020054082

This occurs for me on Debian 10 & 11, as well as Git 2.30.2 and 2.20.1.

  reply	other threads:[~2022-01-24 13:48 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 [this message]
2022-01-24 18:07             ` Junio C Hamano
2022-01-24 18:16               ` Michael Herrmann
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=CABrKpmBFrrWgBh7QAOX35zQr_e+LC1E6Jn5FKb_XP-7bew9Hkg@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.