munificent / craftinginterpreters

Repository for the book "Crafting Interpreters"
http://www.craftinginterpreters.com/
Other
8.84k stars 1.04k forks source link

Sources modified during the build #48

Closed nirs closed 7 years ago

nirs commented 7 years ago

Making modifies sources, so your next commit will include these unwanted changes.

$ make
$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

    modified:   site/representing-code.html
    modified:   site/scanning.html
    modified:   site/the-lox-language.html

no changes added to commit (use "git add" and/or "git commit -a")
munificent commented 7 years ago

Yes, the repo contains the checked in built HTML. However, in most cases, running make should produce the same files as what's already in the repo. If that's not the case, it usually means either:

  1. Someone didn't rebuild the HTML after changing a Markdown file or something. This can happen with external contributors who don't have the build set up. Generally, I just do it for them the next time I touch things.

  2. You may not have all of the Python dependencies set up. In particular, if you don't have Pygments and the syntax highlighting wired up, then when you build the book, you'll get different HTML that doesn't include the highlighting.

I know it's a little annoying when this happens, but I kind of like having the HTML in the repo. It lets people see it without having to build locally, and it gives me a sanity check where I can see which HTML files are affected by some change.