All of lore.kernel.org
 help / color / mirror / Atom feed
From: Carl Worth <cworth@cworth.org>
To: git@vger.kernel.org
Subject: "git reset --hard" leaves empty directories that shouldn't exist
Date: Tue, 14 Feb 2006 23:51:34 -0800	[thread overview]
Message-ID: <87y80dhxfd.wl%cworth@cworth.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 883 bytes --]

I've been exploring the potential for git-sync, and I found some odd
behavior with "git reset --hard". It appears that if the current tree
has some directory structure (at least two levels deep) that does not
exist in the tree being reset to, that empty directories are left
around after the reset:

	$ git --version
	git version 1.2.0.gf6e8
	$ git init-db
	defaulting to local storage area
	$ touch file; git add file; git commit -m "Add file"
	Committing initial tree df2b8fc99e1c1d4dbc0a854d9f72157f1d6ea078
	$ git tag OLD
	$ mkdir -p a/b/c; touch a/b/c/foo; git add a/b/c/foo; git commit -m
	"Add foo"
	$ git checkout -b bogus
	$ git reset --hard OLD
	$ find a
	a
	a/b
	a/b/c
	$

Is this operator error? I don't see any extra options I might be
missing in the documentation of git-reset.

I haven't looked into the implementation at all yet to see what might
be going on.

-Carl

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

             reply	other threads:[~2006-02-15  7:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-15  7:51 Carl Worth [this message]
2006-02-15  8:06 ` "git reset --hard" leaves empty directories that shouldn't exist Shawn Pearce
2006-02-15  8:09 ` Junio C Hamano
2006-02-16  1:35 ` Linus Torvalds

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=87y80dhxfd.wl%cworth@cworth.org \
    --to=cworth@cworth.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 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.