From: Junio C Hamano <gitster@pobox.com>
To: Christian Couder <christian.couder@gmail.com>
Cc: Yotam Gingold <yotam@yotamgingold.com>, git <git@vger.kernel.org>
Subject: Re: Git reset --hard with staged changes
Date: Mon, 23 May 2016 14:16:39 -0700 [thread overview]
Message-ID: <xmqqeg8s8og8.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <CAP8UFD0dQGmfhPuHjEGRZjEZHwUHR_XzAASwq+87Obf26yi+BQ@mail.gmail.com> (Christian Couder's message of "Mon, 23 May 2016 21:31:16 +0200")
Christian Couder <christian.couder@gmail.com> writes:
>> This should be clarified to define what a tracked file is. I propose appending:
>>
>> A file is considered tracked if it exists in a prior commit or in the
>> staging area. Note that a newly added file not in any prior commit will be
>> removed.
>
> Would you like to send a patch with something like the above?
I am not sure if that is a good addition, though.
> I don't know if something about why it is like this, or why it is the
> right thing to do, at least for recovering from merges, should be
> added though.
I excuse you as it seems that you haven't read my response ;-)
>> I would also like to propose that the staging area's tree object be saved,
>> ..
> Yeah, it might be a good idea.
Two issues with that "proposal" is that
1. the index may not be writable as a tree (think: during a
conflict resolution); and
2. the sole point of "reset --hard" is to "discard the changes".
If you want to instead save them away, there is another command
that was designed to do just that.
It wasn't all that surprising that those on stackoverflow would
think such a proposal is a good idea, but I somehow was hoping you
have been around here long enough to know "git stash" ;-)
next prev parent reply other threads:[~2016-05-23 21:16 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-23 0:55 Git reset --hard with staged changes Yotam Gingold
2016-05-23 17:05 ` Junio C Hamano
2016-05-23 19:31 ` Christian Couder
2016-05-23 21:16 ` Junio C Hamano [this message]
2016-05-24 6:20 ` Christian Couder
2016-05-30 5:07 ` Yotam Gingold
2016-05-31 6:02 ` Junio C Hamano
2016-05-31 6:41 ` Christian Couder
[not found] <CANWD=rWmzgAwTp=E_1=th0Myk-dh4m5Y9PE3=fpHeirsVVQKwQ@mail.gmail.com>
2014-06-09 11:24 ` Pierre-François CLEMENT
2014-06-09 14:04 ` David Kastrup
2014-06-09 23:22 ` Pierre-François CLEMENT
2014-06-09 23:28 ` Junio C Hamano
2014-06-10 14:59 ` Pierre-François CLEMENT
2014-06-10 15:27 ` David Kastrup
2014-06-10 16:30 ` Pierre-François CLEMENT
2014-06-10 1:03 ` Dale Worley
2014-06-10 5:44 ` 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=xmqqeg8s8og8.fsf@gitster.mtv.corp.google.com \
--to=gitster@pobox.com \
--cc=christian.couder@gmail.com \
--cc=git@vger.kernel.org \
--cc=yotam@yotamgingold.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.