From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeff King Subject: Re: New directory lost by git am Date: Wed, 5 Mar 2014 11:34:15 -0500 Message-ID: <20140305163415.GA28908@sigill.intra.peff.net> References: <531690A3.3040509@ubuntu.com> <53169549.10309@gmail.com> <53169868.3010401@ubuntu.com> <5316DBEC.3020208@gmail.com> <53173423.6050708@ubuntu.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Cc: Chris Packham , "git@vger.kernel.org" To: Phillip Susi X-From: git-owner@vger.kernel.org Wed Mar 05 17:34:25 2014 Return-path: Envelope-to: gcvg-git-2@plane.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WLEly-00064J-Gy for gcvg-git-2@plane.gmane.org; Wed, 05 Mar 2014 17:34:22 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753899AbaCEQeS (ORCPT ); Wed, 5 Mar 2014 11:34:18 -0500 Received: from cloud.peff.net ([50.56.180.127]:33471 "HELO peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1752232AbaCEQeR (ORCPT ); Wed, 5 Mar 2014 11:34:17 -0500 Received: (qmail 10060 invoked by uid 102); 5 Mar 2014 16:34:17 -0000 Received: from c-71-63-4-13.hsd1.va.comcast.net (HELO sigill.intra.peff.net) (71.63.4.13) (smtp-auth username relayok, mechanism cram-md5) by peff.net (qpsmtpd/0.84) with ESMTPA; Wed, 05 Mar 2014 10:34:17 -0600 Received: by sigill.intra.peff.net (sSMTP sendmail emulation); Wed, 05 Mar 2014 11:34:15 -0500 Content-Disposition: inline In-Reply-To: <53173423.6050708@ubuntu.com> Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: On Wed, Mar 05, 2014 at 09:26:43AM -0500, Phillip Susi wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On 3/5/2014 3:10 AM, Chris Packham wrote: > > My example is creating a commit on the "temp" branch then applying > > it to the "master" branch using git am. > > > >> Do a reset HEAD~1 --hard, and git clean -x -f -d before git am. > >> I didn't notice the missing file myself for some time because it > >> is left in the working tree, just not added to the index and > >> included in the commit. > >> > > Right... so the file is left in the directory, even though it is not > checked in. A git status should show it is an unknown file, and a > clean should remove it. I don't think those steps are necessary for Chris's example. When he switches back to the master branch, git removes the subdirectory (the file is tracked in "temp" but not "master", so we remove it when switching branches, and then the directory is empty, so we clean it up, too). You can verify with an extra "ls" after the checkout but before the "am". > > * "git apply" parsed patches that add new files, generated by > > programs other than Git, incorrectly. This is an old breakage in > > v1.7.11. > > > > Does that sound like your problem? If you can I'd suggest > > updating, ideally to the recent 1.9.0 release but if you're feeling > > conservative try 1.8.3.4. > > Vaguely, except for the "other than git" part. This patch was > generated by git-format-patch ( I didn't think apply handled patches > that weren't ). I can't get Chris's script to fail on any version of git. Can you show us an example of a patch that does not behave (or better yet, a reproduction recipe to generate the patch with "format-patch")? -Peff