Git, Scrivener, and Wordcount

I’m using git version control on my writing.

I had a merge conflict and fixed it, and everything looks fine.

Except, when I do a word count across the whole project scrivener crashes.

Any clues on what to do?

Try rebuilding Scrivener’s search indexes. Maybe they got corrupted in the merge and need to be thrown out and re-built from scratch…

You can find that menu item under Tools->Save and Rebuild Search Indexes on the Windows version. On the Mac version, I think it’s under the “Scrivener” menu when you hold down the OPT key, but I can’t verify that right now. Pressing and releasing the OPT key while a section of the menu is visible will reveal these optional menu items and then let them hide again, so it’s easy to locate wherever it is.


I swear up and down that there is no tools option on Mac. I’ve tried Opt clicking all over the place, I’ve looked in every menu I can see.

BTW, is this forum not indexed by Google? I hardly seem to be able to find anything about Scrivener through Google search.

I don’t think it is indexed on Google.

There is no Tools menu on the Mac version. I believe the equivalent menu for Scrivener is “Scrivener”, as that’s where you find Preferences, which is the equivalent of Tools->Options on Windows. I found that confusing at first, but it seems to be the only major way the menus deviate, and there’s no convention on Windows for a top-level menu named for the application. I guess they compromised on the “everything organized the same” concept for the sake of not further upsetting people who expect all Windows apps to look like MS Office products.

As for finding the Rebuild indexes menu item on the Mac application, I’m pretty sure it’s under Scrivener, File, or Edit. Did you not find any menu items under those that change when you press and release the OPT key? It should be easy to spot them changing as you do that several times.

OK, found it, was under file. I’ve never seen the use of OPT like that before.

Sadly, even after rebuilding it still hangs.

Is there anything else I can try?

Create a new project from whatever template you started from, then carefully drag the contents of each top-level folder from the troublesome project to the new one. If that works, you can delete the original and rename the new one to match the old name… but fair warning: that’ll almost certainly break your versioning, as internally, the 1.rtf file under Files/Docs/ will probably not have the same contents nor be associated with the same entry in the .scrivx file. Same goes for most if not all of the entries in the binder.

Out of curiosity, does the program crash if you try to compile? The Project Statistics feature doesn’t rely upon the search index, but rather does a background compile for maximum accuracy. That can mean it goes into files and processes things you ordinarily do not encounter on a regular basis, like maybe a graphic in a file somewhere that the compiler is having troubles processing, or the results of the merge caused an unfortunate combination of RTF codes that can’t be processed. If compile crashes as well, you could try forming a full draft Scrivenings session and see if that crashes. If it does, that makes things easy, you just have to poke through the binder until the software crashes and make note of which document caused it.

Obviously it’s best to work on a duplicate of the project when doing this kind of testing, that will also make it easier to safely run tests like splitting the compile group in halves to located where the problematic file is. What I do when I’m troubleshooting a project that has been sent in is to keep a zip of it in its original state, and then repeatedly try breaking things, deleting the test project and recreating it from the zip with a simple double-click when I need to reset the test.

Strangely, it seems that compile does work.

If I go though and do text statistics for each page will I be able to isolate the problem like that?

That would take longer than Ioa’s suggestion. Essentially, you start by de-selecting half of your draft folder documents, try Project Statistics. If it hangs, then the problem probably lies in the selected half. If not, then it’s in the de-selected half. Deselect everything, then select a quarter of the files from the group where the problem seems to lie and try Project Statistics. Repeat, halving the selected files from the group that seems to be problematic, until you narrow down to the bad file or files.

It’s much faster if you have a lot of files to start to test half, then test half of that, then half of that… than to try it one document at a time. Unless you only have 10 files in your draft folder, then it doesn’t make that much difference.