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

Re: On removing files and "git-rm is pointless"

From
Jakub Narebski <jnareb@gmail.com>
Date
Dec 4, 2006, 10:48 UTC
Message-ID
<el0uaf$n7h$1@sea.gmane.org>
In-Reply-To
<7vd570q888.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano wrote:
Show 15 quoted lines
> Nicolas Pitre <nico@cam.org> writes:
> 
>> I think what Linus is proposing makes tons of sense.
>>
>> If you do git rm by mistake then you can always do git checkout on that
>> file to get it back.
>>
>> If you modified it so it doesn't match the index then git rm won't do
>> anything by default so you have a chance to think a bit more.
>>
>> If you updated the index, didn't commit anything but then do git rm then
>> you certainly wanted to really rm the file.
> 
> FWIW, I too am in favor of the proposed fix to "git rm" as Linus
> outlined.
+1. I'm also for this change. Of course if the working area version doesn't
match HEAD version git-rm should remove only index entry, and print warning
message, for example what it does now, i.e.
  rm '<filename>'
or if we want more chatty version (core.gitgor = true) it would print:
  File '<filename>' changed. Use "rm '<filename>'" to remove.
(or something like that).
-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
Previous: Junio C HamanoNext: Linus Torvalds
Message 6 of 13 in “On removing files and "git-rm is pointless"”
  1. Carl WorthDec 2, 2006
  2. Linus TorvaldsDec 2, 2006
  3. Sam VilainDec 2, 2006
  4. Nicolas PitreDec 3, 2006
  5. Junio C HamanoDec 4, 2006
  6. Jakub NarebskiDec 4, 2006
  7. Linus TorvaldsDec 4, 2006
  8. Jakub NarebskiDec 4, 2006
  9. Olivier GalibertDec 4, 2006
  10. Junio C HamanoDec 5, 2006
  11. Nicolas PitreDec 5, 2006
  12. Carl WorthDec 5, 2006
  13. Junio C HamanoDec 5, 2006

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.