Thread (46 messages) flat view 46 messages, 3 authors, 2016-06-15

Re: [PATCH 16/19] reset [--mixed] --quiet: don't refresh index

From: Jeff King <hidden>
Date: 2016-06-15 22:55:42

On Wed, Jan 09, 2013 at 12:16:13AM -0800, Martin von Zweigbergk wrote:
"git reset [--mixed]" without --quiet refreshes the index in order to
display the "Unstaged changes after reset". When --quiet is given,
that output is suppressed, removing the need to refresh the index.
Other porcelain commands that care about a refreshed index should
already be refreshing it, so running e.g. "git reset -q && git diff"
is still safe.
Hmm. But "git reset -q && git diff-files" would not be?

We have never been very clear about which commands refresh the index.
Since "reset" is about manipulating the index, I'd expect it to be
refreshed afterwards. On the other hand, since we have never guaranteed
anything, perhaps a careful script should always use "git update-index
--refresh". I would not be too surprised if some of our own scripts are
not that careful, though.

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help