On 2011.2.4 1:39 PM, Aaron J. Grier wrote:
> is there a knob for me to always default git merge to --no-commit ?

Software and systems which try to prevent errors are hateful.  They come from
the failed assumption that the user and system will realize they're going to
make an error BEFORE they make it.  In reality this results the user
proceeding very slowly and carefully... until they inevitably get
tired/complacent and forget.  Then there's no way to recover.

It also results in a lot of hateful annoying and increasingly ineffective and
counter productive error messages.  Remember when Redhat made rm -i the default?

  $ rm -i *
  rm: remove regular file `foo.txt'? y
  rm: remove regular file `junk.txt'? y
  rm: remove regular file `trash.stuff'? Y
  rm: remove regular file `whatever.junk'? YES
  rm: remove regular file `important.txt'? YES GOD DAMNIT

  Wait... NOOOOOOOOOO!!!

The real solution is to allow users to make errors, but quickly and easily
detect and undo them.  Thus, everything needs an undo button.  Delete the
wrong file?  Pull it from the trash. [1]  Editing a document wrong?  Undo
button.  Screw up a merge?  Throw out that commit and try again.

Here is your git undo button.

[alias]
    undo = reset --hard HEAD^


[1] At this point somebody points out that sometimes you REALLY want to delete
a file RIGHT NOW like when the disk is full.  In that exceptional case you
have something like a --delete-now flag.  Make the common case the default.
You also out a reaper on the trash to automatically remove files at a certain
size/age just like /tmp.


-- 
3. Not allowed to threaten anyone with black magic.
    -- The 213 Things Skippy Is No Longer Allowed To Do In The U.S. Army
           http://skippyslist.com/list/

Reply via email to