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

Re: Suggestion: make git checkout safer

From: Junio C Hamano <hidden>
Date: 2016-06-15 23:05:09

Eric Sunshine [off-list ref] writes:
...
Again:

    ...`hello.c` will also be restored,...
quoted
 because the file globbing is used to match entries in the index
 (not in the working tree by the shell).
Thanks for a thorough review.  I agree with all the comments and
suggestions you gave.  Also, Ed, thanks for an attempt to improve
the documentation.

I think the biggest problem with this patch is that the tone of the
updated text is geared a lot more towards venting the initial
frustration of the writer than helping the readers of the document.

By explaining what the behaviour is meant to solve and help, the
readers would get useful information (e.g. "this is to be used to
restore pristine contents").  The same thing said in the negative
way only serve to unnecessarily repel readers (e.g. "this will
unconditionally overwrite and lose contents").

Technically, they are the descriptions of the same thing---in order
to restore pristine contents to the workng tree, you have to discard
the botched changes you made in the working tree, and that is done
"unconditionally" by "overwriting" and "losing contents".  But
saying it in the negative way does not serve as a useful warning.

The readers are intelligent, and they will understand (and will even
appreciate) that a request to replace their botched contents in the
working tree out of the index is done unconditionally without being
asked an unnecessary "are you sure?" and done by overwriting the
files, losing the botched contents from there, once they are
explained why they want to "git checkout $paths", what the operation
is meant to be used for.

Perhaps taking a deep breath and waiting for a few days for the head
to coll down and frustrations to dissipate may be a good thing to do
;-)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help