git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
TRTim Retout <tim@retout.co.uk>
Date
Apr 13, 2009, 21:19 UTC
Message-ID
<1239657595.4641.50.camel@arneb.retout.co.uk>
In-Reply-To
<7vr5zwe3ie.fsf@gitster.siamese.dyndns.org>
On Mon, 2009-04-13 at 12:51 -0700, Junio C Hamano wrote:
Show 12 quoted lines
> Tim Retout <tim@retout.co.uk> writes:
> 
> > 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...

Show 5 quoted lines
> 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 <tim@retout.co.uk>
Previous: Junio C HamanoNext: Jeff King
Message 3 of 4 in “builtin-reset.c: Extend hard reset error message when using paths.”
  1. builtin-reset.c: Extend hard reset error message when using paths.Tim Retout, Apr 13, 2009
  2. Junio C HamanoApr 13, 2009
  3. Tim RetoutApr 13, 2009
  4. Jeff KingApr 14, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.