git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
To: Philippe Vaucher <philippe.vaucher@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Proposal: create meaningful aliases for git reset's hard/soft/mixed
Date: Wed, 23 Nov 2011 09:49:13 +0100	[thread overview]
Message-ID: <vpq4nxvusty.fsf@bauges.imag.fr> (raw)
In-Reply-To: <CAGK7Mr4GZq5eXn4OB+B0ZborX-OVoXiWU8Lo1XM5LRZDuRe1YA@mail.gmail.com> (Philippe Vaucher's message of "Wed, 23 Nov 2011 09:28:19 +0100")

Philippe Vaucher <philippe.vaucher@gmail.com> writes:

> A lot of time when I want to use reset for smth else than "--hard" I
> have to go and look the documentation.

I have to agree with this, I took a lot of time to understand/memorize
the meaning of reset options.

> Optional: a new mode would be introduced for consistency:
> --worktree (or maybe --tree): only updates the worktree but not the index

That would be an alias for "git checkout <rev> -- path", right?

I don't really like this "there is more than one way to do it" in Git's
command-line, I think we should think very carefully before introducing
yet another instance of it.

> --keep could be removed in favor of an additional --safe flag

If you are to change the option names, then you should also make the
behavior safe by default:

* "git reset --all" = "git reset --keep"
* "git reset --all --force" = "git reset --hard"

With the current terminology, --hard has the advantage that it makes it
realatively clear how dangerous it is. Still, I've seen users losing
data because they did a "git reset --hard" with uncommited changes. Git
is safe by default most of the time, and "git reset --hard" is one
unfortunate exception (because it was there before --keep, people are
more used to it).

"git reset --all" would make it worse, because the option name is less
scary, people would be less reluctant to use it, and would get more
chance to lose data.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

  reply	other threads:[~2011-11-23  8:49 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-23  8:28 Proposal: create meaningful aliases for git reset's hard/soft/mixed Philippe Vaucher
2011-11-23  8:49 ` Matthieu Moy [this message]
2011-11-23 11:32   ` Philippe Vaucher
2012-12-18  6:24   ` Martin von Zweigbergk
2011-11-23 12:02 ` Nguyen Thai Ngoc Duy
2011-11-23 18:51 ` Junio C Hamano
2011-11-23 23:00   ` Philippe Vaucher
2011-12-01 21:23     ` Phil Hord
2011-12-02  7:26       ` Thomas Rast
2011-12-02  7:45         ` Miles Bader
2011-12-02 15:28         ` Phil Hord
2011-12-02 14:27       ` Philippe Vaucher
2011-12-02 15:38         ` Phil Hord
2011-12-06  7:34           ` Philippe Vaucher
2012-10-03 16:23             ` Phil Hord
2012-10-03 18:41               ` Junio C Hamano
2012-10-03 19:03                 ` Junio C Hamano
2012-12-15 18:57                   ` Jan Engelhardt
2011-12-01 21:02   ` Phil Hord
2012-12-18  6:34   ` Martin von Zweigbergk
2012-12-18 15:22     ` Junio C Hamano
2012-12-18 16:30     ` 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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=vpq4nxvusty.fsf@bauges.imag.fr \
    --to=matthieu.moy@grenoble-inp.fr \
    --cc=git@vger.kernel.org \
    --cc=philippe.vaucher@gmail.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).