Thread (4 messages) 4 messages, 4 authors, 2016-06-15

Re: [PATCH 2/2] read-tree: at least one tree-ish argument is required

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:47:55

Sverre Rabbelier [off-list ref] writes:
On Fri, Dec 18, 2009 at 13:32, Junio C Hamano [off-list ref] wrote:
quoted
Sure, it will empty the index, so it is dangerous in the same sense that
"reset --hard" is dangerous because it will wipe all your local changes,
or "rm -rf it" will remove everything underneath it.
With the difference that both 'reset --hard' and 'rm -rf' need a flag
to do their destructive work? Although 'git reset' might be just as
destructive if you've been using 'git add -p' a lot or something,
mhh...
I'll grant you that at least "rm -rf it" names "it" that will be wiped
very explicitly.  But just like the index and the work tree plus the index
are the implicit targets to "reset" and "reset --hard" respectively, the
index is the implicit target to "read-tree".

So it may be "dangerous" in the sense that "it would change things and if
you meant to do something else the end result would be different from what
you wanted to do".  In that sense, "log", "cat-file" and friends may be
danger-free commands and all others would be dangerous.  You might type
"commit" when you meant to say "commit -a" and record an incomplete state;
it is "dangerous" in that sense.

These are part of their feature.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help