Live data from Hacker News

Using Microsoft Word with Git

blog.martinfenner.org

91–100 of 136 posts

Re: Using Microsoft Word with Git

#91

I've mentioned this in a similar thread a few months back, but it looks like it could be relevant here, too: https://github.com/TomasHubelbauer/modern-office-git-diff I've made this script which automatically extracts the Office file format (which is a ZIP archive of XML documents) and versions the XML documents and their extracted text contents alongside the binary Office file. This is done using a Git hook and it s…

I built a similar tool in Python years back:

https://github.com/WorldMaker/musdex https://pythonhosted.org/musdex/

Because I built it to be extensible/support plugins I've used it for all sorts of interesting file types beyond DOCX too. (CELTX, a screenwriting format from years back; prettier diffs for Inform 7 source text; experimented with an SQLite deconstructor; ...)

Looks like I take a slightly different approach too, in that I store a bunch more metadata about the deconstructed contents (not just relying on directory listings), so I end up trusting my reconstruction tool a bit more and I mostly don't store the binary blobs in git, as I assume I can reconstruct them quickly enough.

Re: Using Microsoft Word with Git

#92
post #39

Earlier quoted context omitted.

Yep. They've had version control for at least a decade, diff'ing also, by way of Compare. I'm also not sure why people are fascinated with using git here. It's weird seeing all of the complex solutions in this thread for a problem which does not exist. Edit: I meant 'fascinated with using git here in this context'.

i don't know why you are getting down voted for speaking the truth. I don't know a single person who this article would relate to in today's climate since everyone i know is using the latest version of office or on google docs.

The Word compare feature is often a pain to use. This is a decent alternative.

Re: Using Microsoft Word with Git

#93
Back in the bad old days of version control (thinking of VSS here), I was overall pretty satisfied with how the check-in/check-out mechanics worked for Word docs and the like. In this case you have the benefit of the sequential workflow, in fact enforced or hinted by the tool itself, while also getting rid of the recurrent weakness of email-based document storage. There were plenty of other things to dislike about VSS (like, pretty much the rest of them) but it wasn't so bad for maintaining documents.

Re: Using Microsoft Word with Git

#94
Wow nice. I'm a big fan of git's `--word-diff` option for text edits. The output is almost as good as `latexdiff` and so much faster.

Another useful trick is to pipe the ANSI-colored terminal output through `aha` (https://github.com/theZiz/aha or `brew install aha`) which produces HTML output, e.g.

   git wdiff | aha > ~/Desktop/mydiff.html
You can then send the file mydiff.html to collaborators by email or add to CI build script.

Re: Using Microsoft Word with Git

#95

I've mentioned this in a similar thread a few months back, but it looks like it could be relevant here, too: https://github.com/TomasHubelbauer/modern-office-git-diff I've made this script which automatically extracts the Office file format (which is a ZIP archive of XML documents) and versions the XML documents and their extracted text contents alongside the binary Office file. This is done using a Git hook and it s…

This looks very interesting. Do you think it can be applied to other kinds of XML files? I'm interested in using git with a vfx software (The Foundry Nuke) that writes XML projects, and it would be great to have some versioning system for it.

I've tried using the git diff patience algorithm, but didn't work well - frequently, the diff was about to remove every single line and add all them back to the XML file.

Re: Using Microsoft Word with Git

#96

I've mentioned this in a similar thread a few months back, but it looks like it could be relevant here, too: https://github.com/TomasHubelbauer/modern-office-git-diff I've made this script which automatically extracts the Office file format (which is a ZIP archive of XML documents) and versions the XML documents and their extracted text contents alongside the binary Office file. This is done using a Git hook and it s…

This looks very interesting. Do you think it can be applied to other kinds of XML files? I'm interested in using git with a vfx software (The Foundry Nuke) that writes XML projects, and it would be great to have some versioning system for it. I've tried using the git diff patience algorithm, but didn't work well - frequently, the diff was about to remove every single line and add all them back to the XML file.

In your situation, I'd just whip together a quick PowerShell script like I have here, but tailor it to the structure of your file format: traverse the XML tree and have a few if-else statements which filter out noisy metadata you don't need to see in the diff, if any, and save the resulting collected text node contents as a text file alongside the XML files. Each commit with changes to the XML will thanks to the Git hook also have a corresponding TXT file so you can very easily view the changes in a skimable way, unlike the potentially really big and messy XML diff you'd have if you versioned only the original.

Re: Using Microsoft Word with Git

#97

I gave up using Word to write manuscripts when I switched to Markdown documents in git. In the last few months, though, I gave up on Markdown to switch to a more robust format - LaTeX. Before I switched, I didn't know LaTeX at all, but I knew from my reading that it had the features I needed.

I hope to see a post from you one day saying "I gave up on LaTeX and switched to org" :-)

Seriously, org has served all my authoring needs for over a decade now. You can export to LaTeX and HTML easily, and now pandoc does a decent job of exporting to other formats. You can embed LaTeX lines in your org document, so you get the full power of LaTeX, without having to write LaTeX for everything. Tables are hellish in LaTeX, and even lists are a pain.

Of course, there is the whole "You have to use Emacs" thing...

Re: Using Microsoft Word with Git

#100
Has anybody used SimulDocs[0], which sells itself as a "version control for Microsoft Word documents"? I've been really curious if it's a decent solution in this space, but I tend to keep myself away from Word docs in my life recently.

[0]: https://www.simuldocs.com/features/version-control-for-micro...

Post reply on HN