News for hackers. Stuff that matters.
Re:Excel as Code by kyberias on Monday September 20, 2021 @12:12PM (#28595403)
> Because Excel is not a source file.

Well, it is a zip-archive with XML files, so it's close.

Re:Excel as Code by cxr on Monday September 20, 2021 @12:33PM (#28595632)
I recommended exploring this approach here <https://news.ycombinator.com/item?id=27998733>:

> Hot tip for handling office file formats or anything that uses a ZIP container: just unzip them and commit _that_ to the repo.

Even modern (zipped XML-based) office file formats do make some limited use of binary blobs. You can either keep these intact, or write a small objdump-like tool that serializes them to text†. For portability, it might be best to write the serializer/deserializer in JS dumped into a thin HTML wrapper, so you pretty much anyone can double click to "run" it. (My experiments on roundtrippability with including that file in the ZIP container yielded poor results.)

† I've used this strategy for Oberon .rsc binaries. Due to Wirth's affinity for single-pass compilers, the Oberon toolchain doesn't involve a discrete assembler or AOT linker tool, so there is no assembly format or linker scripts. However, Wirth's distribution of the Oberon system does have an ORTool utility <https://people.inf.ethz.ch/wirth/ProjectOberon/Sources/ORToo...> (in the vein of objdump/readelf/nm) that will dump a textual description of the binary you give it. I realized that with some slight tweaks, you can use the output of ORTool.DecObj as a de facto "assembly" format—just write a tool capable of parsing it and then write out the corresponding binary.

Re:Excel as Code by inshadows on Monday September 20, 2021 @04:49PM (#28598818)
>> Hot tip for handling office file formats or anything that uses a ZIP container: just unzip them and commit _that_ to the repo.

What is the point if that? I think neither binary nor XML output would be meaningful in the diff output.

Re:Excel as Code by banana_giraffe on Monday September 20, 2021 @02:07PM (#28596801)
Notably: The VBA stuff is stored as a binary OLE2 blob thing inside of the xlsm file.

(Or at least it is in the few spreadsheets I checked, no clue if there's some way to change that behavior)

Re:Excel as Code by tyingq on Monday September 20, 2021 @11:29PM (#28601817)
The VBA blob is documented: https://interoperability.blob.core.windows.net/files/MS-OVBA...

111 pages, and it looks non-trivial to implement something to tear it apart. But, I give MS some credit for documenting it.

Re:Excel as Code by WorldMaker on Monday September 20, 2021 @12:38PM (#28595702)
I built a tool to explore version control of files like that by decompressing their contents and version controlling those. It was an interesting experiment.