git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Dale Worley <worley@alum.mit.edu>
Cc: git@vger.kernel.org
Subject: Re: Git reset --hard with staged changes
Date: Mon, 09 Jun 2014 22:44:53 -0700	[thread overview]
Message-ID: <xmqqsindb9nu.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <loom.20140610T025754-449@post.gmane.org> (Dale Worley's message of "Tue, 10 Jun 2014 01:03:09 +0000 (UTC)")

Dale Worley <worley@alum.mit.edu> writes:

> (As far as I can tell from Git's behavior, the definition of tracked file is
> "any file that is in the base commit or in the index".  Based on that
> definition, "git reset --hard" is working as documented.)

The book (whichever book you guys are talking about) is wrong, if it
considers only the paths in the HEAD commit tracked.  After the user
deliberately does "git add" a path not in HEAD, the user runs any
command (e.g. "git apply --index", "git cherry-pick --no-commit")
that may bring a path not in HEAD to the result without recording a
new commit that updates the HEAD, a new path is recorded in the
index and that path is considered "tracked" before the resulting
contents in the index is made into a commit.

  reply	other threads:[~2014-06-10  5:45 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CANWD=rWmzgAwTp=E_1=th0Myk-dh4m5Y9PE3=fpHeirsVVQKwQ@mail.gmail.com>
2014-06-09 11:24 ` Git reset --hard with staged changes 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 [this message]
2016-05-23  0:55 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
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

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=xmqqsindb9nu.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=worley@alum.mit.edu \
    /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).