git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Steven Grimm <koreth@midwinter.com>
Cc: しらいしななこ <nanako3@bluebottle.com>, git@vger.kernel.org
Subject: Re: [PATCH] Make "git stash" configurable
Date: Fri, 21 Dec 2007 11:48:44 -0800	[thread overview]
Message-ID: <7vmys36d7n.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <2AB285BD-DA6E-49D1-B664-B1A8B552DD76@midwinter.com> (Steven Grimm's message of "Fri, 21 Dec 2007 09:23:47 -0800")

Steven Grimm <koreth@midwinter.com> writes:

> On Dec 21, 2007, at 2:22 AM, しらいしななこ wrote:
>
>> "git stash" without argument originally created an unnamed
>> stash, but some people felt this can be confusing to new
>> users.  This introduces per-user config variable stash.quick to
>> control this behavior.
>
> This whole thing smells of indecision to me.

If you want to force me to decide, you know what the decision it
would be.  Here are the guiding principles and decisions based
on them.

 (1) A tool should be optimized for people who know what it does
     and how to use it.

     While forbidding "git stash" without argument and forcing
     people who want to have a quick stash to type "git stash
     save" may appear not to be adding too many keystrokes, it
     actually is a regression.  Because "git stash save" without
     arguments make a much less descriptive stash than the
     current quickie "git stash", doing so slows them down by
     forcing them to think of what message to give.

     The decision would be to keep "git stash" quickie stash
     creation.  An alternative decision could be to do nothing
     when "git stash" is given, and make "git stash save" (and
     "git stash create") without the actual message to come up
     with a better default message.

 (2) A tool should not change its behaviour too drastically
     depending on who the user is.

     Otherwise it makes it harder for people with mid-level
     experience to teach less experienced people.  The decision
     would be that "stash.quick=ask" and "stash.quick=no" are
     unacceptable.

 (3) A tool should support safety for a mistaken use by who know
     the tool (even they can make mistakes).

     I listed this mostly because we made "git clean" to violate
     principle (2) above.  Even when you know what that command
     does, it is easy to mean "make clean" and type "git clean"
     by mistake.  And "git clean" is very destructive --- there
     is no "oops, I take it back".  This principle has led us to
     introduce clean.requireforce that defaults to true.

     For "git stash", there is no "make stash" or "xyzzy stash"
     that can easily induce mistyping.  Even if it were typed by
     mistake, there is no such destructive "oops, I cannot take
     it back" problem with "git stash", either.  "git stash
     apply" will get you back to where you were.  The decision
     would again be that "stash.quick=no" is unwanted.

 (4) A tool should support safety for clueless people when it is
     reasonable.

     Even though "I did not know what command foo does, so I
     tried running it and it did something unexpected" is a
     silly excuse to rob quickie "git stash" from people who
     know better, we cannot avoid the fact that there are
     clueless people.  I think checking stash.iknowwhatitdoes to
     detect first-time users, and explaining what it does to
     them, may make sense.  And we can take hints from the patch
     that started this thread how to do this.

     The decision here is that I am open to a change that
     implements the one-time safety instruction.

Note that in the above guiding principles, I used "should" in
RFC2119/BCP0014 sense: there may exist valid reasons in
particular circumstances to ignore a particular item, but the
full implications must be understood and carefully weighed
before choosing a different course.

  parent reply	other threads:[~2007-12-21 19:49 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-21 10:22 [PATCH] Make "git stash" configurable しらいしななこ
2007-12-21 17:23 ` Steven Grimm
2007-12-21 17:27   ` Matthieu Moy
2007-12-21 17:54     ` Junio C Hamano
2007-12-21 18:26       ` Steven Grimm
2007-12-21 19:48   ` Junio C Hamano [this message]
2007-12-22 14:22     ` [PATCH] Emit helpful status for accidental "git stash" save Wincent Colaiuta
2007-12-22 16:22       ` Junio C Hamano
2007-12-22 17:31         ` [PATCH v2] " Wincent Colaiuta
2007-12-22 17:58           ` Junio C Hamano
2007-12-22 18:44             ` Wincent Colaiuta

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=7vmys36d7n.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=koreth@midwinter.com \
    --cc=nanako3@bluebottle.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).