From: "Avery Pennarun" <apenwarr@gmail.com>
To: "Linus Torvalds" <torvalds@linux-foundation.org>
Cc: "Junio C Hamano" <gitster@pobox.com>,
"Git Mailing List" <git@vger.kernel.org>
Subject: Re: Add 'sane' mode to 'git reset'
Date: Mon, 1 Dec 2008 12:44:52 -0500 [thread overview]
Message-ID: <32541b130812010944k3dd825e4pfa8c270ecc75d539@mail.gmail.com> (raw)
In-Reply-To: <alpine.LFD.2.00.0812010908120.3256@nehalem.linux-foundation.org>
On Mon, Dec 1, 2008 at 12:30 PM, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
> So add this kind of mode to "git reset", and since it's probably the
> sanest form of reset (it will not throw any state away), just call it
> that: "git reset --sane". It should probably be the default, but we likely
> cannot change the semantics of a regular "git reset", even though it is
> unlikely that very many people really use the current (insane) default
> mode of "--mixed" that only resets the index.
For reference, I advised someone just yesterday to use "git reset
HEAD^" to undo an accidental "commit -a" instead of just "commit".
Also, as far as I know, "git reset HEAD filename" is the only
recommended way to undo an accidental "git add". (Which I do
sometimes when I meant to write "git add -p".) Those two options are
pretty common, I think, and are also perfectly "sane".
How about calling it --merge instead? That's really what it does:
merges the diffs from (your current index) to (the requested index)
into (your working tree and your index).
Or --keep, because it keeps your working tree changes.
Have fun,
Avery
next prev parent reply other threads:[~2008-12-01 17:46 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-01 17:30 Add 'sane' mode to 'git reset' Linus Torvalds
2008-12-01 17:44 ` Avery Pennarun [this message]
2008-12-01 18:04 ` Jakub Narebski
2008-12-01 18:06 ` Linus Torvalds
2008-12-03 22:22 ` Junio C Hamano
2008-12-04 0:39 ` Linus Torvalds
2008-12-04 2:00 ` [RFC/PATCH] Document "git-reset --merge" Junio C Hamano
2008-12-04 2:03 ` Add 'sane' mode to 'git reset' Junio C Hamano
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=32541b130812010944k3dd825e4pfa8c270ecc75d539@mail.gmail.com \
--to=apenwarr@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=torvalds@linux-foundation.org \
/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).