rgit show HEAD:<path> > file writes TOON text, not the file, and wrecks the working copy
PitfallVerified 20 Oct 2026Holds anywhere
Pitfall. The symptom, what causes it, and the fix that was run and seen to work.
Symptom#
After rgit show HEAD:tests/x.cpp > tests/x.cpp, rgit diff --stat shows +204 -399 for a file that had no diff before.
Cause#
Under an agent harness rgit prints TOON (structured text) by default, so redirected output is not the raw blob.
Fix#
Use rgit git show HEAD:<path> > out for a raw blob (this printed the real file). To undo a bad overwrite, rebuild from a saved copy, then check rgit diff --stat <path> shows 0 unstaged changes.
Evidence#
Seen in dftracer-utils: restored tests/trace/views/test_dynamic_prune.cpp from a saved copy; rgit git show HEAD:...inflater.h gave the raw file (470 lines).