Re: [PATCH] gitk: refresh the index before running diff-files

2012-10-01 Thread Junio C Hamano
Jeff King writes: > I don't buy the "gitk should be read-only" argument from that thread. I > think we decided a while back[1] that the stat cache is not really a > user-visible modification; you're not updating the index in any > meaningful way that impacts the user's workflow, but merely refres

Re: [PATCH] gitk: refresh the index before running diff-files

2012-10-01 Thread Jeff King
On Sun, Sep 30, 2012 at 01:34:58PM -0700, Jonathan Nieder wrote: > Jeff King wrote: > > On Sun, Sep 30, 2012 at 10:05:27AM +1000, Paul Mackerras wrote: > > >> Unfortunately this will wait for the git update-index command to > >> complete, making the GUI unresponsive while it executes, and that ca

Re: [PATCH] gitk: refresh the index before running diff-files

2012-09-30 Thread Jonathan Nieder
Hi Jeff, Jeff King wrote: > On Sun, Sep 30, 2012 at 10:05:27AM +1000, Paul Mackerras wrote: >> Unfortunately this will wait for the git update-index command to >> complete, making the GUI unresponsive while it executes, and that can >> take minutes on a large repository (e.g. the linux kernel) on

Re: [PATCH] gitk: refresh the index before running diff-files

2012-09-29 Thread Jeff King
On Sun, Sep 30, 2012 at 10:05:27AM +1000, Paul Mackerras wrote: > On Fri, Sep 28, 2012 at 04:50:54PM -0400, Jeff King wrote: > > > +proc refresh_index {} { > > +global need_index_refresh > > +if { $need_index_refresh } { > > + exec sh -c "git update-index --refresh >/dev/null 2>&1 || tr

Re: [PATCH] gitk: refresh the index before running diff-files

2012-09-29 Thread Paul Mackerras
On Fri, Sep 28, 2012 at 04:50:54PM -0400, Jeff King wrote: > +proc refresh_index {} { > +global need_index_refresh > +if { $need_index_refresh } { > + exec sh -c "git update-index --refresh >/dev/null 2>&1 || true" > + set need_index_refresh false > +} > +} Unfortunately this

Re: [PATCH] gitk: refresh the index before running diff-files

2012-09-28 Thread Andreas Schwab
Junio C Hamano writes: > Jeff King writes: > >> On Sat, Sep 29, 2012 at 12:11:58AM +0200, Andreas Schwab wrote: >> >>> Jeff King writes: >>> >>> > +proc refresh_index {} { >>> > +global need_index_refresh >>> > +if { $need_index_refresh } { >>> > + exec sh -c "git update-index --refres

Re: [PATCH] gitk: refresh the index before running diff-files

2012-09-28 Thread Junio C Hamano
Jeff King writes: > I think the weird tcl-catches-stderr thing kicks in (at least it did for > me in a simple experiment). But like I said, I am not an expert. OK, I'll believe you ;-) -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.k

Re: [PATCH] gitk: refresh the index before running diff-files

2012-09-28 Thread Jeff King
On Fri, Sep 28, 2012 at 04:02:32PM -0700, Junio C Hamano wrote: > >> Jeff King writes: > >> > >> > +proc refresh_index {} { > >> > +global need_index_refresh > >> > +if { $need_index_refresh } { > >> > +exec sh -c "git update-index --refresh >/dev/null 2>&1 || true" > >> > >> I

Re: [PATCH] gitk: refresh the index before running diff-files

2012-09-28 Thread Junio C Hamano
Jeff King writes: > On Sat, Sep 29, 2012 at 12:11:58AM +0200, Andreas Schwab wrote: > >> Jeff King writes: >> >> > +proc refresh_index {} { >> > +global need_index_refresh >> > +if { $need_index_refresh } { >> > + exec sh -c "git update-index --refresh >/dev/null 2>&1 || true" >> >> I

Re: [PATCH] gitk: refresh the index before running diff-files

2012-09-28 Thread Jeff King
On Sat, Sep 29, 2012 at 12:11:58AM +0200, Andreas Schwab wrote: > Jeff King writes: > > > +proc refresh_index {} { > > +global need_index_refresh > > +if { $need_index_refresh } { > > + exec sh -c "git update-index --refresh >/dev/null 2>&1 || true" > > I think the usual idiom for ign

Re: [PATCH] gitk: refresh the index before running diff-files

2012-09-28 Thread Andreas Schwab
Jeff King writes: > +proc refresh_index {} { > +global need_index_refresh > +if { $need_index_refresh } { > + exec sh -c "git update-index --refresh >/dev/null 2>&1 || true" I think the usual idiom for ignoring errors is to use catch around exec, avoiding the extra shell wrapper:

Re: [PATCH] gitk: refresh the index before running diff-files

2012-09-28 Thread Junio C Hamano
Jeff King writes: > Potentially the "reload" command should reset the need_index_refresh > flag, too. Yeah, I think that is a sane enhancement to think about. > gitk | 10 ++ > 1 file changed, 10 insertions(+) > > diff --git a/gitk b/gitk > index 379582a..561be23 100755 > --- a/gitk >

[PATCH] gitk: refresh the index before running diff-files

2012-09-28 Thread Jeff King
is not refreshing the index at all. Try this (substitute Makefile with some file in your repository): $ touch Makefile $ gitk <-- reports uncommitted changes $ git update-index --refresh $ gitk <-- changes go away I am not a tcl hacker, but the patch below seems to fix it for me. -