Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jgit-dev] How to provide IndexChangedEvent?

On 09.09.11 14:01, "Baumgart, Jens" <jens.baumgart@xxxxxxx> wrote:

>The old GitIndex fired an IndexChangedEvent event. This event is needed
>to react on index changes to update the UI.
>The DirCache implementation does not provide the event (it even does not
>know Repository!)
>Is it possible to extend DirCache to provide the IndexChangedEvent?
>
>Currenty we only get IndexChangedEvents in EGit because
>RepositoryChangeScanner calls
>Repository.scanForRepoChanges and scanForRepoChanges uses
>GitIndex.rereadIfNecessary!
>
>	public void scanForRepoChanges() throws IOException {
>		getAllRefs(); // This will look for changes to refs
>		if (!isBare())
>			getIndex(); // This will detect changes in the index
>	}

Shouldn't be a problem to teach DirCache.commit() to fire this event.
This should be done in a way so that scanForRepoChanges() doesn't fire
a second event if DirCache already sent it.

--
Matthias



Back to the top