@J-M-L
You’re absolutely right about the limitation with the main .ino file. Once a project grows into multiple .cpp and .h files, the whole idea of this library starts to lose its meaning anyway. At that point you are already in the territory where proper version control makes sense, you have a repository, tags, commits, maybe CI, and printing a version number that maps to a commit on GitHub is the correct solution.
This library is really aimed at a very different situation: small sketches, quick prototypes, experiments, teaching setups, or those one-off projects where you wrote something quickly, uploaded it, and three years later you find the board in a drawer and think “what exactly is running on this thing?”.
Another situation where this happens is with field prototypes. The version in the repository might be the “best” or latest one, but it is not always the one that actually works on that specific piece of hardware. Real devices accumulate small fixes, tweaks, and adjustments over time that never make it back to the repository. You can track everything with digital twins and strict documentation, but that quickly becomes a time management problem. In those situations it can be very useful if the device itself can simply tell you what code produced the firmware.
It also happens in places where there is no real operational continuity, for example hacker spaces, university prototype labs, shared workbenches, or teaching environments where many people touch the same hardware over time. In those contexts it’s very easy for boards to accumulate without anyone being completely sure what firmware was last uploaded. Ans most importanty environments where we cannot enforce versioning to everyone, like a company.
In those cases setting up a full versioning workflow often feels like overkill, and people end up relying on folders like “final_v3_really_final”. This is simply meant as a convenience tool for that scenario, where the board itself can tell you what code produced the firmware without having to guess.
Thanks again for the feedback.
@robtillaart
I really appreciate the detailed feedback.
About the use case, replied above! 
Regarding compression, I actually experimented with it. I tried using zlib and also played with Unishox to zip the source before storing it in flash. Compression itself worked, but I ran into problems when reading and streaming the compressed data back reliably from flash on the microcontroller side. Because of that I kept the current version simple and stored the raw text. I agree though that compression would make sense and it’s something I would like to revisit, because even a simple gzip could roughly halve the flash footprint.
Your comment about timestamps is interesting because that is actually where another idea came from while reading the discussion in reddit. In the past I used macros like FILE, DATE, TIME, and TIMESTAMP to print build information over Serial. It worked surprisingly well as a sort of “poor man’s versioning”. The board could literally tell you which file compiled it and when.
Seeing the feedback there made me think about a second approach that could combine both worlds. I’m thinking about a small companion library called “Githolino”.
Instead of embedding the full source code in flash, it would only embed lightweight compile metadata such as the file name and timestamp using those macros. Since they are compile-time constants they basically cost nothing in terms of resources.
The device could then report something like “this firmware was built from file X at time Y nad has this unique ID”. A small tool on the host side could query the Git repository, match the file and timestamp, and automatically retrieve the exact version of the code that produced the firmware.
In that model the device tells you what it is actually running, and Git provides the full history.
So Forgetfulino is the brute force approach where the device remembers everything, while Githolino would be the lightweight approach where the device only provides the key needed to reconstruct the exact source from the repository.
I’m starting to think the architecture of the second option as this might actually be the cleaner architecture, possibly implemented as a small tool between the device and Git.
Curious what you think about that direction.