From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carl Worth Subject: "git reset --hard" leaves empty directories that shouldn't exist Date: Tue, 14 Feb 2006 23:51:34 -0800 Message-ID: <87y80dhxfd.wl%cworth@cworth.org> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: multipart/signed; boundary="pgp-sign-Multipart_Tue_Feb_14_23:51:27_2006-1"; micalg=pgp-sha1; protocol="application/pgp-signature" Content-Transfer-Encoding: 7bit X-From: git-owner@vger.kernel.org Wed Feb 15 08:52:55 2006 Return-path: Envelope-to: gcvg-git@gmane.org Received: from vger.kernel.org ([209.132.176.167]) by ciao.gmane.org with esmtp (Exim 4.43) id 1F9HSr-0000df-GN for gcvg-git@gmane.org; Wed, 15 Feb 2006 08:52:44 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1422658AbWBOHwb (ORCPT ); Wed, 15 Feb 2006 02:52:31 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1422666AbWBOHwa (ORCPT ); Wed, 15 Feb 2006 02:52:30 -0500 Received: from theworths.org ([217.160.253.102]:37598 "EHLO theworths.org") by vger.kernel.org with ESMTP id S1422658AbWBOHwa (ORCPT ); Wed, 15 Feb 2006 02:52:30 -0500 Received: (qmail 20821 invoked from network); 15 Feb 2006 02:52:29 -0500 Received: from localhost (HELO raht.cworth.org) (127.0.0.1) by localhost with SMTP; 15 Feb 2006 02:52:29 -0500 To: git@vger.kernel.org User-Agent: Wanderlust/2.14.0 (Africa) Emacs/21.4 Mule/5.0 (SAKAKI) Sender: git-owner@vger.kernel.org Precedence: bulk X-Mailing-List: git@vger.kernel.org Archived-At: --pgp-sign-Multipart_Tue_Feb_14_23:51:27_2006-1 Content-Type: text/plain; charset=US-ASCII 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 --pgp-sign-Multipart_Tue_Feb_14_23:51:27_2006-1 Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) iD8DBQBD8t2G6JDdNq8qSWgRAoh1AJ9jXTLZRvlH3nX5bD02Ar54DEZ4jgCcCygw 1eEKwLPRnK/ujkJVv4mv9to= =NUO5 -----END PGP SIGNATURE----- --pgp-sign-Multipart_Tue_Feb_14_23:51:27_2006-1--