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

Re: possible bug in git apply?

From
David Kastrup <dak@gnu.org>
Date
Aug 5, 2007, 07:55 UTC
Message-ID
<857ioact4u.fsf@lola.goethe.zz>
In-Reply-To
<7vvebuh8g8.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano <gitster@pobox.com> writes:
Show 18 quoted lines
> Linus Torvalds <torvalds@linux-foundation.org> writes:
>
>> It should. I thought we did that, but maybe there's some bug there.
>>
>> See "remove_file()" in builtin-apply.c.
>>
>> But yeah, it seems that the file *rename* ends up not triggering that 
>> logic! Very annoying.
>>
>> Does this fix it? Totally untested, but it _looks_ obvious enough..
>
> That would regress the fix made in aea19457, I am afraid.  If
> you are in a subdirectory and the rename patch moves away the
> last file in your current directory, the shell session you ran
> the git-apply from will end up in an unlinked directory.
>
> Maybe that is a pilot error, and we can revert aea19457
> altogether?

I'd call it pilot error. We can't really have git's behavior depend on where somebody might point his cwd. If we do that, we may never remove any directory. Once git tracks directories, it will be harder to make this particular pilot error (git rm ../mycwd is more obviously having this effect than git rm *), but a pilot error it is in my book.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum
Previous: Junio C HamanoNext: Linus Torvalds
Message 7 of 15 in “possible bug in git apply?”
  1. david@lang.hmAug 4, 2007
  2. Junio C HamanoAug 4, 2007
  3. David KastrupAug 4, 2007
  4. Linus TorvaldsAug 5, 2007
  5. Linus TorvaldsAug 5, 2007
  6. Junio C HamanoAug 5, 2007
  7. David KastrupAug 5, 2007
  8. Linus TorvaldsAug 5, 2007
  9. David KastrupAug 5, 2007
  10. Linus TorvaldsAug 5, 2007
  11. David KastrupAug 5, 2007
  12. Linus TorvaldsAug 5, 2007
  13. David KastrupAug 5, 2007
  14. Junio C HamanoAug 6, 2007
  15. Junio C HamanoAug 6, 2007

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.