Re: [PATCH] git-diff: Add --staged as a synonym for --cached.

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH] git-diff: Add --staged as a synonym for --cached.

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:45:38

Jeff King [off-list ref] writes:
On Wed, Nov 12, 2008 at 10:39:21AM -0500, Avery Pennarun wrote:
quoted
quoted
I thought about that at first, too, but the working tree is even more
painful. You would have to hash every changed file on the filesystem to
create the tree object.
Is that so bad?  You have to read all those files anyway in order to
do a diff.
I don't know for sure, as I haven't tried it. But you would need to read
them twice (once to hash, and then once to diff) plus the extra
computation time of hashing. So assuming you have a decent cache, you
pay the disk access only once.

Maybe it would be negligible, but I would have to see numbers to be
convinced either way.
I think you guys are barking up a wrong tree.

The staged state, the work tree state and the committed states are three
conceptually different things.  Making them stand out as distinct entities
at the UI level is a _good thing_.

Introducing STAGED or WORKTREE psuedonym to deliberately muddy the
distinction goes against helping the users form a clear vision of what
s/he is working on at the conceptual level.

Re: [PATCH] git-diff: Add --staged as a synonym for --cached.

From: Jeff King <hidden>
Date: 2016-06-15 22:45:38

On Wed, Nov 12, 2008 at 11:29:35AM -0800, Junio C Hamano wrote:
I think you guys are barking up a wrong tree.

The staged state, the work tree state and the committed states are three
conceptually different things.  Making them stand out as distinct entities
at the UI level is a _good thing_.
I'm not sure I agree. They _are_ different things, but in the case of
diff, you are really treating each of them like a tree (which makes
range operators a little silly, but then that is a silliness already
present in "git diff tree1..tree2").

But again, I would not be convinced this is a good direction until I
saw:

 - the actual design, especially to what degree any ugliness is exposed
   when we realize that they _aren't_ trees. IOW, how badly does this
   abstraction leak?

 - numbers showing that it isn't going to perform significantly worse

And I'm still not volunteering to work on it, so somebody else will have
to come up with those things. ;)

-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