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

Re: [PATCH] builtin-reset.c: Extend hard reset error message when using paths.

From: Tim Retout <hidden>
Date: 2016-06-15 22:46:36

Possibly related (same subject, not in this thread)

On Mon, 2009-04-13 at 12:51 -0700, Junio C Hamano wrote:
Tim Retout [off-list ref] writes:
quoted
Users who invoke 'git reset --hard <paths>' are probably trying to
update paths in their working directory.  The error message should
point them in the direction of git-checkout(1).
That is one possibility.  Another is:

    git reset --hard mester

(and you have ./mester file in the work tree) and in that case the user
definitely didn't want to do any checkout.
I would think that this sort of typo is sufficiently rare that it should
not cause confusion - at least, no more than 'Cannot do hard reset with
paths.', which would be the current message.
I wonder if you can tell these cases apart, and also if this (not just
telling these apart, but what your patch adds) is worth additional
cluttering in the running program.
Well, in my opinion the cluttering is minimal, and a line similar to
this would be useful to help these users find the right documentation...
I certainly wouldn't mind addition to
git-reset manual page if new people are often confused between "checking
out paths from the index or from the named commit" and "resetting the HEAD
to a different commit while nuking the index and the work tree state",
though.
...and a note in the man page would be helpful as well, similar to that
in git-revert(1).  I'm happy to come up with something.

I'm aiming to reduce the frequency with which I get asked for help with
reverting a file.  Perhaps adding a <paths> form to 'revert' is what I
really want to do.

-- 
Tim Retout [off-list ref]
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help