git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tim Retout <tim@retout.co.uk>
To: Junio C Hamano <gitster@pobox.com>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: [PATCH] builtin-reset.c: Extend hard reset error message when using paths.
Date: Mon, 13 Apr 2009 22:19:55 +0100	[thread overview]
Message-ID: <1239657595.4641.50.camel@arneb.retout.co.uk> (raw)
In-Reply-To: <7vr5zwe3ie.fsf@gitster.siamese.dyndns.org>

On Mon, 2009-04-13 at 12:51 -0700, Junio C Hamano wrote:
> 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...

> 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>

  reply	other threads:[~2009-04-13 21:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-13 18:14 [PATCH] builtin-reset.c: Extend hard reset error message when using paths Tim Retout
2009-04-13 19:51 ` Junio C Hamano
2009-04-13 21:19   ` Tim Retout [this message]
2009-04-14  5:35   ` Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1239657595.4641.50.camel@arneb.retout.co.uk \
    --to=tim@retout.co.uk \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).