I've been trying to understand why gitx wheel spins, sometimes for a few seconds, with Refreshing index... whenever something is staged, and have found:
- Index refresh is done by spawning an external task:
git update-index -q --unmerged --ignore-missing --refresh.
- The refresh is invoked in
PBGitCommitController when it sees repository updated events of type WorkingDir and Index. In this case it is the Index event that is responsible for the refresh.
- These events are sent by
PBGitRepositoryWatcher.
- The Index event is generated when the index directory's modification time is changed.
Given that gitx should be able to determine if all of an un-staged file has been staged (and vice-versa) and so update the appropriate lists, is there a need to then refresh the index?
#181 is related.