Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

An excellent tool that can be used in conjunction with this approach is the word-level diff option for git diffs: `git diff --color-words`

Rather than processing entire lines (useful for code), it shows individual word changes, so it's great for tracking data as in the screenshots in the article and even better for text (output produced is similar to latexdiff for those familiar).

I highly recommend... I have a git alias setup for this, and use it almost every day.



That's a great tip, thanks. Looks like you can use that option with 'git show' too:

    git show --color-words


Oh cool. I just learned a new git verb today! (Previously I always used `git diff <commit-1> <commit>` but `git show <commit>` is much simpler.


> [I] use it almost every day.

What do you use it for? I'm wondering, what web pages / what information is so interesting, so one looks for changes almost every day :-)

Is it maybe for finding out if contents linked by Minireference text books, change in significant ways? Or move to different URLs?


Mostly reviews of text edits on the books. I'll make some changes for a while, then add them to git, and review the changes `git diff --color-words --cached` before I commit. Both MATH&PHYS and LA books are about to get a point-release (lots of typo fixes and improvements to certain explanations based on two years of reader feedback).

Even more useful is when collaborating with others, e.g., to see what changes the editor made. When I send diffs to her, I usually run `latexdiff` (takes >1h to generate on 500 pages), but when I check her changes I just use git.

Last but not least, I've been working on a French translation of the book and now I use the diffs to keep the two versions "in sync," meaning any improvements made to one edition are also made in the other. See https://minireference.com/blog/multilingual-authoring-for-th... for more info about this cool hack.


magit users can enable this in all diffs by setting the variable `magit-diff-refine-hunk'.


Thanks! I have written my last half dozen books using markdown + leanpub.com, keeping my book artifacts in GitHub. I am going to try this!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: