]> git.ipfire.org Git - thirdparty/git.git/commit - git-gui/git-gui.sh
git-gui: Efficiently update the UI after committing.
authorShawn O. Pearce <spearce@spearce.org>
Sat, 11 Nov 2006 23:38:00 +0000 (18:38 -0500)
committerShawn O. Pearce <spearce@spearce.org>
Sun, 12 Nov 2006 05:16:01 +0000 (00:16 -0500)
commit7f1df79bb7bad696d1d8965da3937edeb1cfe9f6
treea0ae183cc220e649b37f67e18772ad8e8b5332aa
parent68e009dec44a023efd6f6fcd61c1583b23b04f32
git-gui: Efficiently update the UI after committing.

When we commit we know that whatever was in the index went as part
of the commit.  Since we generally assume that the user does not
update the index except through our user interface we can be reasonably
certain that any file which was marked as A/M/D in the index will have
had that A/M/D state changed to an _ (not different) by the commit.

We can use this knowledge to update the user interface post commit
by simply updating the index part of the file state of all files whose
index state was A/M/D to _ and then removing any file memory any which
wound up with a final state of __ (not different anywhere).  Finally we
redraw the file lists and update the diff view.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
git-gui