git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pierre Habouzit <madcoder@debian.org>
To: Junio C Hamano <gitster@pobox.com>
Cc: Johannes Schindelin <Johannes.Schindelin@gmx.de>,
	Steven Grimm <koreth@midwinter.com>,
	git@vger.kernel.org
Subject: Re: [PATCH] git-revert is one of the most misunderstood command in git, help users out.
Date: Tue, 06 Nov 2007 09:49:25 +0100	[thread overview]
Message-ID: <20071106084925.GC4435@artemis.corp> (raw)
In-Reply-To: <7vode8j7o5.fsf@gitster.siamese.dyndns.org>

[-- Attachment #1: Type: text/plain, Size: 2498 bytes --]

On Tue, Nov 06, 2007 at 04:54:02AM +0000, Junio C Hamano wrote:
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> 
> > On Mon, 5 Nov 2007, Junio C Hamano wrote:
> >
> >> Allowing people to revert or cherry pick partially by using paths 
> >> limiter is a very good idea; the whole "it comes from a commit so we 
> >> also commit" feels an utter nonsense, though.
> >
> > No.
> >
> > When "git revert <commit>" commits the result, "git revert <commit> -- 
> > <file>" should, too.
> 
> I was not questioning about that part.  "If 'git revert <some
> other form> foo' does not talk about commit, it should not
> commit" was what I was referring to.

  Well, I don't really know how closely you read #git, but I'd say that
"how do I undo my local changes in a git repository" is among the top 3
questions. There _IS_ an UI issue for that.

If git revert <commitish> -- path1 path2 path3 is going to work at some
point, I see no harm in saying that git revert HEAD -- path1 path2 path3
work. We can also in that case spit an error message:

error: this works as a courtesy but you really meant git checkout -- path/to/file

  On some other issues I'm all about educating people and learning to
them how to "think different". But here it's a pure interface problem,
and git is the sole $scm with a revert commands that doesn't reverts
local changes wrt HEAD.

  The next release of master will have tons of UI improvements (terse
output, better options parsing, more builtins hence faster commands …),
I believe it's stopping halfway not thinking about issues like this from
a newcomer point of view.

  On the pure theoretical basis I believe you're right, it's a bit
mixing apples and oranges. On the pragmatic usability side I'm quite
sure you're wrong, because everyone is used to that:

    $ hg revert --help | head -3 | tail -1
    revert files or dirs to their states as of some revision

    $ bzr help revert | head -1
    Purpose: Revert files to a previous revision.

    $ svn help revert | head -1
    revert: Restore pristine working copy file (undo most local edits).

    $ darcs help revert | head -3 | tail -1
    Revert to the recorded version (safe the first time only).

    <put your favorite non-git scm with a revert command here>

-- 
·O·  Pierre Habouzit
··O                                                madcoder@debian.org
OOO                                                http://www.madism.org

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2007-11-06  8:49 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-05 19:01 [PATCH] git-revert is one of the most misunderstood command in git, help users out Pierre Habouzit
2007-11-05 19:04 ` Pierre Habouzit
2007-11-05 19:05   ` J. Bruce Fields
2007-11-05 19:10     ` Pierre Habouzit
2007-11-05 19:28 ` Steven Grimm
2007-11-05 19:50   ` Pierre Habouzit
2007-11-05 21:54   ` Alejandro Martinez Ruiz
2007-11-05 22:06     ` David Kastrup
2007-11-05 23:41       ` Alejandro Martinez Ruiz
2007-11-05 22:21   ` Junio C Hamano
2007-11-05 23:40     ` Johannes Schindelin
2007-11-06  0:08       ` Pierre Habouzit
2007-11-06  2:51       ` Junio C Hamano
2007-11-06  3:18         ` Johannes Schindelin
2007-11-06  4:54           ` Junio C Hamano
2007-11-06  8:49             ` Pierre Habouzit [this message]
2007-11-06  9:29               ` Mike Hommey
2007-11-06  9:37                 ` Pierre Habouzit
2007-11-06 12:32             ` Johannes Schindelin
2007-11-06 18:06               ` Junio C Hamano
2007-11-06 18:27                 ` Johannes Schindelin
2007-11-06 19:39                   ` Pierre Habouzit
2007-11-06 19:42                     ` Junio C Hamano
2007-11-06 22:21                       ` Johannes Schindelin
2007-11-06 20:06               ` Robin Rosenberg
2007-11-06 20:13                 ` Mike Hommey
2007-11-06 21:21                   ` Robin Rosenberg
2007-11-06 22:25                     ` Johannes Schindelin
2007-11-07  8:16                       ` Mike Hommey
2007-11-07 11:08                         ` Johannes Schindelin
2007-11-07 19:32                           ` Robin Rosenberg
2007-11-07 20:01                             ` Jakub Narebski
2007-11-07  9:03                       ` David Kastrup
2007-11-06 11:08         ` Junio C Hamano
2007-11-06 11:51           ` Johannes Sixt
2007-11-06 12:16             ` Johannes Schindelin
2007-11-06 12:25           ` Johannes Schindelin
2007-11-06 12:48             ` Pierre Habouzit
2007-11-06 17:43               ` 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=20071106084925.GC4435@artemis.corp \
    --to=madcoder@debian.org \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=koreth@midwinter.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).