* 'git stash' is not atomic: it leaves both an invalid stash and file changes
@ 2026-08-19 2:17 Yuri
0 siblings, 0 replies; only message in thread
From: Yuri @ 2026-08-19 2:17 UTC (permalink / raw)
To: Git Mailing List
My repository had many untracked files that were accidentally added, one
of them was 2GB.
My first attempt failed:
$ git stash push ../../ -m "all-accidentally-added"
Saved working directory and index state On main: all-accidentally-added
fatal: unable to generate diff for misc/linux-rl9-cuda13/libcuda.txt
Two problems with this:
1. it didn't say why did it fail to generate diff.
It should have said "fatal: unable to generate diff for
misc/linux-rl9-cuda13/libcuda.txt: file is 2GB which is larger than the
limit 1GB"
2. This command left both stash and file changes. If the command has
failed, why does it leave stash then?
After removing the large file 'git stash' still failed:
$ git stash push ../../ -m "all-accidentally-added-final"
Saved working directory and index state On main:
all-accidentally-added-final
error: patch too large
Again: "patch too large" needs to specify the limit, and the transaction
should be atomic.
Please consider improving error messages to be more informative as for
the reasons of failure. Also please consider making stash atomic. The
stash that was left was obviously invalid because it didn't contain at
least one file.
Yuri
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-08-19 2:28 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-19 2:17 'git stash' is not atomic: it leaves both an invalid stash and file changes Yuri
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox