git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shawn Pearce <spearce@spearce.org>
To: git@vger.kernel.org
Subject: git-add + git-reset --hard = Arrrggh!
Date: Wed, 17 May 2006 05:45:26 -0400	[thread overview]
Message-ID: <20060517094526.GA8563@spearce.org> (raw)

After spending an hour writing and testing a new test case for GIT
I do the foolish:

	$ git add t/t1400-update-ref.sh
	# Hmm, maybe I should amend this into the prior commit.
	$ git format-patch -o .. next
	$ git reset --hard
	$ git update-ref HEAD~1
	# Uhhohh...
	$ ls t/t1400-update-ref.sh

All I can say is I'm very happy that update-index does a lot more
than just update the index.  I was easily able to find the deleted
test by finding the most recently modified object in my .git/objects
directory and pulling it back out with git cat-file.  :-)

Oh, and I totally agree with that discussion about GIT not clobbering
files the user is working on which the user can't easily recover.
I just wish recovery from the above stupidity didn't require going
through .git/objects looking for the newest file.  :-)

Yes, I know that git reset --hard was brutal and yes, I didn't
really need to use git-update-ref when git-reset would have also
done the job for me.  Arrgh.  Its early and I wasn't thinking.

-- 
Shawn.

             reply	other threads:[~2006-05-17  9:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-17  9:45 Shawn Pearce [this message]
2006-05-17 14:43 ` git-add + git-reset --hard = Arrrggh! Linus Torvalds
     [not found] ` <81b0412b0605170722u15702301p2565e8ac29a5a0da@mail.gmail.com>
2006-05-17 21:35   ` Shawn Pearce

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=20060517094526.GA8563@spearce.org \
    --to=spearce@spearce.org \
    --cc=git@vger.kernel.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).