git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: New directory lost by git am

From
PSPhillip Susi <psusi@ubuntu.com>
Date
Mar 5, 2014, 16:47 UTC
Message-ID
<53175510.7020000@ubuntu.com>
In-Reply-To
<20140305163415.GA28908@sigill.intra.peff.net>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 3/5/2014 11:34 AM, Jeff King wrote:
Show 6 quoted lines
> 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".
Right.
Show 15 quoted lines
>>> * "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")?

AHA! It requires a conflict. There were simple conflicts in the NEWS file so I applied the patch with git am --reject and fixed up the NEWS, and ran git am --resolved. The git am --reject fails to add the new directory to the index.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (MingW32)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJTF1UOAAoJEI5FoCIzSKrwTD4H/35pUf8DFsbwPIVVQi+8I8e3 5NMHwQrHK3TPbZigVPBgVfwRCtOAxX656BPhninfhix99HWs00W5zGaFDwkymRNp 87EeU3LVcIjapqijszw9AqwBLvfm9uzXEus964hShCJVOmKBezQfl6Mvcrkn5Na1 UchJLkRzEoi6VUyUso8FH0xpL7JyjF08H19dtvXoUbrvrXYuN1Ys3UMBHXVEVdi+ 5O924lo4+psgdjGZ3HUpclYRbKO0LS5IVMCxFRw5Q+EfARJQ7NXzv/csRXIKyms7 roCQqmQnnem71GHx6SQaepnY5pKuEnmmDaqXbCOqZdpyfo1CB7SFJDq/VXrbLyw= =zS2r -----END PGP SIGNATURE-----

Previous: Jeff KingNext: Jeff King
Message 7 of 10 in “New directory lost by git am”
  1. Phillip SusiMar 5, 2014
  2. Chris PackhamMar 5, 2014
  3. Phillip SusiMar 5, 2014
  4. Chris PackhamMar 5, 2014
  5. Phillip SusiMar 5, 2014
  6. Jeff KingMar 5, 2014
  7. Phillip SusiMar 5, 2014
  8. Jeff KingMar 5, 2014
  9. Phillip SusiMar 5, 2014
  10. Junio C HamanoMar 5, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.