capnfabs / grouse

A diff tool for Hugo static sites.
https://capnfabs.net/posts/grouse-diff-tool-hugo-static-site-generators/
MIT License
13 stars 2 forks source link

Grouse doesn't support Hugo themes which use GitInfo #2

Closed shah closed 4 years ago

shah commented 4 years ago

I'm using an out of the box example site with the Google Docsy theme. In each version running "hugo serve" or "hugo" builds properly. When I try to use grouse, I get the following:

ERROR 2019/12/22 18:38:19 Failed to read Git log: fatal: not a git repository (or any of the parent directories): .git

I'm not sure what I could be doing wrong so I was hoping to get some help. Here's my debug log.

❯ grouse --debug b616a47158aaf6459119bafa56ad39e7773f7f0b master
Computing diff between revisions b616a47158aaf6459119bafa56ad39e7773f7f0b (b616a47) and master (637d5ad)
Building revision b616a47158aaf6459119bafa56ad39e7773f7f0b (b616a47)…
2019/12/22 18:38:12 Checking out b616a47158aaf6459119bafa56ad39e7773f7f0b (b616a47) to /tmp/grouse-diff361430417/source/b616a47158aaf6459119bafa56ad39e7773f7f0b…
2019/12/22 18:38:12 Found submodules file, figuring out where to source the submodule contents from
2019/12/22 18:38:12 Found commit for submodule in worktree.
2019/12/22 18:38:12 Found submodules file, figuring out where to source the submodule contents from
2019/12/22 18:38:12 Found commit for submodule in worktree.
2019/12/22 18:38:13 Found commit for submodule in worktree.
2019/12/22 18:38:19 …done checking out.
2019/12/22 18:38:19 Running command
> hugo --destination=/tmp/grouse-diff361430417/output
(from directory /tmp/grouse-diff361430417/source/b616a47158aaf6459119bafa56ad39e7773f7f0b)
Building sites … ERROR 2019/12/22 18:38:19 Failed to read Git log: fatal: not a git repository (or any of the parent directories): .git
Total in 1571 ms
Error: Error building site: logged 1 error(s)
Error: Building at commit b616a47158aaf6459119bafa56ad39e7773f7f0b (b616a47) failed: exit status 255
capnfabs commented 4 years ago

Hey @shah! Thanks for filing the report about this, and for all the info you provided; it's very helpful.

So - the issue here is that:

I was super unsure of the decision to roll my own checkout code when I released Grouse (I discuss it briefly here), and I think at some point in the next month, I'll re-work the code-checkout system to use git worktree instead, which should fix the Hugo GitInfo support as well.

In the meantime, I'll rename this issue accordingly and keep you updated here when I make the requisite changes.