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

Re: [RFC] reset --hard: warn before discarding staged content with no commit history

From
Štefan Balog <stevobalog123@gmail.com>
Date
Dec 14, 2025, 13:45 UTC
Message-ID
<CAJq5WQ5+LBNR11gC+XPT6Z1ZZQZ0HLXxtZdRDoS+wpDjAy2itA@mail.gmail.com>
In-Reply-To
<Ai2bA2Zt8bsexgQEIKg1vK7-SNNhTlsmmFp_gOJp8IKX9dJME7UC97EtqRhAUfD00sFmqRdHg9xgGW82rikrLIDUIswrUPr3RKm-LQgGuNY=@proton.me>

Dôvera, spolupráca, jednota ! Jedina cesta posunu genetického kódu a vyvoja pre zlepšenie kvality života ľudí a spoločnosti v ktorej víťazí dokonalá súhra dôvery viery a nádeje v lepší svet v symbióze s kozmom.

World Rescue Organization

Dňa ne, 14. dec 2025, 14:30 Koutsouflakis Stefanos < koutsouflakis.stefanos@proton.me> napísal(a):

Show 26 quoted lines
> On Friday, December 12th, 2025 at 05:25, Junio C Hamano <gitster@pobox.com>
> wrote:
>
> > I doubt that special casing an empty tree would fly well.
>
> I might be missing something, could you say more about
> what makes this problematic?
> If it is about breaking existing workflows: any script that
> automates either of the two use-cases discussed would be relying
> on behavior that is almost certainly unintended. Such scripts
> would fail, but without data loss, and give authors a clear
> signal to fix a likely bug.
>
> > And I do not have any better ideas.  Other than just failing, that is.
> > But that leads to nonsense combination "--hard --force", just as
> > idiotic combination as "rm -f -i" :-/
>
> There might be other ways to mitigate this, e.g.:
> a) Refuse with a fatal error and hint the user
>    to remove staged content with "git rm --cached -r ."
> b) Autostash with a warning
>
> Thanks,
> Stefanos
>
>
Previous: Koutsouflakis StefanosNext: Junio C Hamano
Message 10 of 13 in “[RFC] reset --hard: warn before discarding staged content with no commit history”
  1. Koutsouflakis StefanosDec 10, 2025
  2. Junio C HamanoDec 11, 2025
  3. Eric SunshineDec 11, 2025
  4. Junio C HamanoDec 11, 2025
  5. Koutsouflakis StefanosDec 11, 2025
  6. Johannes SixtDec 11, 2025
  7. Koutsouflakis StefanosDec 11, 2025
  8. Junio C HamanoDec 12, 2025
  9. Koutsouflakis StefanosDec 14, 2025
  10. Štefan BalogDec 14, 2025
  11. Junio C HamanoDec 14, 2025
  12. Koutsouflakis StefanosDec 15, 2025
  13. D. Ben KnobleDec 12, 2025

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.