From: "Carlisle T. Hamlin" <hamlin.carlisle@gmx.com>
To: Sphinx <sphinx9692@gmail.com>, git@vger.kernel.org
Subject: Re: Question: behavior when reverting a commit from a shallow clone
Date: Sat, 3 Oct 2026 12:41:47 -0700 [thread overview]
Message-ID: <54fac5f4-e49b-4384-af2c-615d7cc04ff5@gmx.com> (raw)
In-Reply-To: <CALfz8Qx63qNoSbXq7C7u+KwX4=HCL7=uOUahpXd6j7KvW_c_Eg@mail.gmail.com>
[-- Attachment #1.1.1: Type: text/plain, Size: 1539 bytes --]
On 10/3/26 1:54 AM, Sphinx wrote:
> Is the following understanding correct?
>
> An empty tree is a valid Git state, so Git does not generally consider
> transitioning from a non-empty tree to an empty tree inherently
> erroneous.
>
> Git does not have a general safeguard that warns when an operation
> will delete all tracked files.
>
> If there are existing safeguards, warnings, configuration options, or
> historical discussions that I may have missed, I would appreciate any
> pointers.
>
> The reason I am asking is that I am trying to establish precisely
> where Git's safety boundary is in this scenario specifically, whether
> Git itself is expected to warn about the resulting empty tree, or
> whether detecting an unexpectedly destructive tree change is
> considered the responsibility of the tooling performing the operation.
You know, it seems to me that it should be reasonable for Git to assume
that someone with the wherewithal to set up and operate a git repository
(or at the very least operate one that someone else set up) knows enough
to understand what's going to happen if they obliterate the only commit
in their tree.
There really is only *so* much holding of the hand I think we should be
expected to perform before it's not only insulting to the project
developers, but also to the *user*.
My two cents. I know folk use Git for all sorts of stuff. Just, maybe...
the sort of person who would be surprised catastrophically by this
behaviour... well... shouldn't.
[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 7951 bytes --]
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 203 bytes --]
next prev parent reply other threads:[~2026-10-03 19:41 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-03 8:54 Question: behavior when reverting a commit from a shallow clone Sphinx
2026-10-03 19:41 ` Carlisle T. Hamlin [this message]
2026-10-05 6:57 ` Patrick Steinhardt
2026-10-05 18:10 ` Carlisle T. Hamlin
2026-10-05 6:57 ` Patrick Steinhardt
2026-10-05 10:41 ` Matt Hunter
2026-10-05 16:38 ` Junio C Hamano
[not found] ` <CALfz8QzymKxvzYGWLwdtzERDm1apa8ebZEVyLne18hpTaB=D0g@mail.gmail.com>
2026-10-05 17:35 ` Sphinx
2026-10-06 15:54 ` Junio C Hamano
2026-10-09 17:34 ` Sphinx
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=54fac5f4-e49b-4384-af2c-615d7cc04ff5@gmx.com \
--to=hamlin.carlisle@gmx.com \
--cc=git@vger.kernel.org \
--cc=sphinx9692@gmail.com \
/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