From: "Elijah Newren" <newren@gmail.com>
To: "Junio C Hamano" <gitster@pobox.com>
Cc: "Steven Walter" <stevenrwalter@gmail.com>,
"Petr Baudis" <pasky@suse.cz>,
"Jakub Narebski" <jnareb@gmail.com>,
"Govind Salinas" <govind@sophiasuchtig.com>,
git@vger.kernel.org
Subject: Re: Revert behavior
Date: Tue, 9 Sep 2008 16:51:20 -0600 [thread overview]
Message-ID: <51419b2c0809091551n6f1f627cica23312795502225@mail.gmail.com> (raw)
In-Reply-To: <7v63p53r93.fsf@gitster.siamese.dyndns.org>
On Tue, Sep 9, 2008 at 4:10 PM, Junio C Hamano <gitster@pobox.com> wrote:
> If you implement "eg svn-like-revert" to checkout the given paths out of
> the last commit, instead of the index, shouldn't that be sufficient?
No, that would leave staged changes unreverted -- a particular case of
which means that revert wouldn't be able to undo an add operation.
For svn-like-revert, the default should be for both staged and
unstaged changes to be undone, unless the user specifically requested
that only part of the changes be reverted (e.g. with --staged or
--unstaged flags). Making revert work prior to the initial commit for
new adds is another case that needs a command with behavior different
than git's checkout of paths.
>> It it a delicate balance to have the user interface match both the
>> mental model of the user and the storage model of the tool.
>
> I do not think it is that simple.
>
> You could match the user experience to the mental model of the other tool,
> by hiding the differences and insisting that people use only your tool.
>
> The real issue is that you may need to castrate the underlying tool in
> certain places if its world model is richer than the model the tool you
> are trying to emulate. Ignoring the index by making "svn-like-revert"
> work on both index and the working tree file at the same time is a good
> example of that.
Why? If the command _by default_ works on both the index and working
tree file, is that necessarily bad ('git checkout BRANCH' operates on
both)? If the tool can only operate on both at once, then sure, I
agree, but that at least isn't the case with eg and wasn't my
suggestion for git.
Not all alternate porcelains try to hide or destroy the index. Some
of us really do love it.
Elijah
prev parent reply other threads:[~2008-09-09 22:52 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-09 13:26 Revert behavior [Was: Re: [ANNOUNCE] yap: Yet Another (Git) Porcelain] Elijah Newren
2008-09-09 13:38 ` Jakub Narebski
2008-09-09 16:37 ` Govind Salinas
2008-09-09 17:29 ` Steven Walter
2008-09-09 20:19 ` Elijah Newren
2008-09-09 21:50 ` Steven Walter
2008-09-09 23:02 ` Elijah Newren
2008-09-09 20:20 ` Elijah Newren
2008-09-09 21:28 ` Petr Baudis
2008-09-09 21:39 ` Steven Walter
2008-09-09 22:10 ` Revert behavior Junio C Hamano
2008-09-09 22:30 ` Steven Walter
2008-09-09 22:51 ` Elijah Newren [this message]
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=51419b2c0809091551n6f1f627cica23312795502225@mail.gmail.com \
--to=newren@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=govind@sophiasuchtig.com \
--cc=jnareb@gmail.com \
--cc=pasky@suse.cz \
--cc=stevenrwalter@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.
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).