git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Elijah Newren" <newren@gmail.com>
To: "Changsheng Jiang" <jiangzuoyan@gmail.com>
Cc: "Eric Raible" <raible@gmail.com>,
	"Git Mailing List" <git@vger.kernel.org>
Subject: Re: RFC: perhaps a "new file" should not be deleted by "git reset --hard"
Date: Wed, 10 Sep 2008 20:38:13 -0600	[thread overview]
Message-ID: <51419b2c0809101938v30e5a1aflf944027aedc2d900@mail.gmail.com> (raw)
In-Reply-To: <eafc0afe0809101914lff5b23ehaf625d702fbd9b5d@mail.gmail.com>

On Wed, Sep 10, 2008 at 8:14 PM, Changsheng Jiang <jiangzuoyan@gmail.com> wrote:
> I think the current behavior is better than you described. If you want
> to ignore some files, you can added it to the exclude file. All files
> not excluded in the repo directory is maintained by git.

No, there's a limbo state -- the "untracked" files shown by git status
(which is the default state; these are files that have not been
explicitly requested to be ignored or be tracked).  Note the quote
from Linus at the beginning of Eric's email that specifically
references this.

Anyway, Eric wasn't really talking about ignoring files, since he was
explicitly adding them for the next commit.  It's just that at some
point he changed his mind and decided he didn't want to include any of
the changes he had already made in the next commit, but was surprised
when git reset --hard deleted the files from both the index and
working copy instead of just the index.  git reset --hard really is
meant for throwing away unwanted stuff (particularly including in the
working directory), but I can see how he may have expected behavior
more along the lines of git rm --cached for those particular files.  I
don't agree with that viewpoint (I see files as tracked as soon as you
stage it, not once you commit it), but I can see where the expectation
comes from.

Just my thoughts,
Elijah

  reply	other threads:[~2008-09-11  2:39 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-10 19:12 RFC: perhaps a "new file" should not be deleted by "git reset --hard" Eric Raible
     [not found] ` <eafc0afe0809101912v72916d3hce9ae5d6812f0db8@mail.gmail.com>
2008-09-11  2:14   ` Changsheng Jiang
2008-09-11  2:38     ` Elijah Newren [this message]
2008-09-11 20:50       ` Eric Raible
2008-09-11 21:34         ` Junio C Hamano
2008-09-11 22:19           ` Eric Raible
2008-09-11 23:04             ` Jeff Whiteside
2008-09-11 23:29               ` Eric Raible
2008-09-11  2:46   ` Eric Raible
2008-09-11  6:05     ` Changsheng Jiang
2008-09-11  6:15       ` RFC: perhaps a Eric Raible
2008-09-11 16:32       ` RFC: perhaps a "new file" should not be deleted by "git reset --hard" Elijah Newren
     [not found]         ` <3ab397d0809111022m24c81bd9y2520f6be478babd3@mail.gmail.com>
2008-09-11 21:24           ` Eric Raible
2008-09-11 23:39             ` Miklos Vajna
2008-09-11 23:49               ` Eric Raible
2008-09-12 15:41                 ` Miklos Vajna
2008-09-11  6:14 ` Mike Hommey
2008-09-11 20:26   ` Eric Raible

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=51419b2c0809101938v30e5a1aflf944027aedc2d900@mail.gmail.com \
    --to=newren@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=jiangzuoyan@gmail.com \
    --cc=raible@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).