{"thread":{"id":"6175","subject":"How to commit removed file?","startedAt":"2006-12-31T10:24:44Z","lastAt":"2007-01-12T10:42:54Z","messageCount":16,"participants":["Michael S. Tsirkin","Johannes Schindelin","Junio C Hamano","Juergen Ruehle","Jakub Narebski","Carl Worth"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"30572","messageId":"20061231102444.GD26552@mellanox.co.il","threadId":"6175","inReplyTo":null,"subject":"How to commit removed file?","fromName":"Michael S. Tsirkin","fromEmail":"mst@mellanox.co.il","sentAt":"2006-12-31T10:24:44Z","receivedAt":"2006-12-31T10:24:44Z","isPatch":false,"sender":{"key":"mst@kernel.org","avatar":null},"body":"I'd like to remove a file and commit the removal while\nleaving out other changes in repository/index.\n\n$git rm kernel_patches/fixes/ib_verbs_warning_fix.patch\nrm 'kernel_patches/fixes/ib_verbs_warning_fix.patch'\n\n$ git commit kernel_patches/fixes/ib_verbs_warning_fix.patch\nerror: pathspec 'kernel_patches/fixes/ib_verbs_warning_fix.patch' did not match\nany file(s) known to git.\nDid you forget to 'git add'?\n\nA similiar thing works with \"git add\".\n\n\n-- \nMST\n"},{"id":"30581","messageId":"Pine.LNX.4.63.0612311605410.22628@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"6175","inReplyTo":"20061231102444.GD26552@mellanox.co.il","subject":"Re: How to commit removed file?","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-12-31T15:06:08Z","receivedAt":"2006-12-31T15:06:08Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\njust a guess: putting \"--\" before the name of the removed file should \nwork, no?\n\nCiao,\nDscho\n"},{"id":"30693","messageId":"20070102201041.GB10451@mellanox.co.il","threadId":"6175","inReplyTo":"20061231102444.GD26552@mellanox.co.il","subject":"Re: How to commit removed file?","fromName":"Michael S. Tsirkin","fromEmail":"mst@mellanox.co.il","sentAt":"2007-01-02T20:10:41Z","receivedAt":"2007-01-02T20:10:41Z","isPatch":false,"sender":{"key":"mst@kernel.org","avatar":null},"body":"> I'd like to remove a file and commit the removal while\n> leaving out other changes in repository/index.\n> \n> $git rm kernel_patches/fixes/ib_verbs_warning_fix.patch\n> rm 'kernel_patches/fixes/ib_verbs_warning_fix.patch'\n> \n> $ git commit kernel_patches/fixes/ib_verbs_warning_fix.patch\n> error: pathspec 'kernel_patches/fixes/ib_verbs_warning_fix.patch' did not match\n> any file(s) known to git.\n> Did you forget to 'git add'?\n> \n> A similiar thing works with \"git add\".\n\nAny ideas? Can this be done with git?\n\n-- \nMST\n"},{"id":"30699","messageId":"Pine.LNX.4.63.0701022211100.22628@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"6175","inReplyTo":"20070102201041.GB10451@mellanox.co.il","subject":"Re: How to commit removed file?","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-01-02T21:12:33Z","receivedAt":"2007-01-02T21:12:33Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 2 Jan 2007, Michael S. Tsirkin wrote:\n\n> > I'd like to remove a file and commit the removal while\n> > leaving out other changes in repository/index.\n> > \n> > $git rm kernel_patches/fixes/ib_verbs_warning_fix.patch\n> > rm 'kernel_patches/fixes/ib_verbs_warning_fix.patch'\n> > \n> > $ git commit kernel_patches/fixes/ib_verbs_warning_fix.patch\n> > error: pathspec 'kernel_patches/fixes/ib_verbs_warning_fix.patch' did not match\n> > any file(s) known to git.\n> > Did you forget to 'git add'?\n> > \n> > A similiar thing works with \"git add\".\n> \n> Any ideas? Can this be done with git?\n\nDid you actually try the \"--\" thing I suggested in \nhttp://article.gmane.org/gmane.comp.version-control.git/35699/?\n\nBesides, I just tested with current \"next\": \n\n$ git commit kernel_patches/fixes/ib_verbs_warning_fix.patch\nCreated commit 89a5bb5ac16fb8be9b6e061284e191cafb3e4da2\n 1 files changed, 0 insertions(+), 22 deletions(-)\n delete mode 100644 a234\n"},{"id":"30704","messageId":"7vfyatt8di.fsf@assigned-by-dhcp.cox.net","threadId":"6175","inReplyTo":"Pine.LNX.4.63.0701022211100.22628@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: How to commit removed file?","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-01-02T21:40:41Z","receivedAt":"2007-01-02T21:40:41Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> On Tue, 2 Jan 2007, Michael S. Tsirkin wrote:\n>\n>> > I'd like to remove a file and commit the removal while\n>> > leaving out other changes in repository/index.\n>> > \n>> > $git rm kernel_patches/fixes/ib_verbs_warning_fix.patch\n>> > rm 'kernel_patches/fixes/ib_verbs_warning_fix.patch'\n>> > \n>> > $ git commit kernel_patches/fixes/ib_verbs_warning_fix.patch\n>> > error: pathspec 'kernel_patches/fixes/ib_verbs_warning_fix.patch' did not match\n>> > any file(s) known to git.\n>> > Did you forget to 'git add'?\n>> > \n>> > A similiar thing works with \"git add\".\n>> \n>> Any ideas? Can this be done with git?\n>\n> Did you actually try the \"--\" thing I suggested in \n> http://article.gmane.org/gmane.comp.version-control.git/35699/?\n>\n> Besides, I just tested with current \"next\": \n>\n> $ git commit kernel_patches/fixes/ib_verbs_warning_fix.patch\n> Created commit 89a5bb5ac16fb8be9b6e061284e191cafb3e4da2\n>  1 files changed, 0 insertions(+), 22 deletions(-)\n>  delete mode 100644 a234\n\nThe difference is Michael did \"git rm\" to explicitly tell git to\nforget about that path, while you used the vanilla \"/bin/rm\".\n\nPersonally I never saw the point of having \"git rm\".  Maybe we\nshould remove it to prevent this confusion from happening.\n"},{"id":"30706","messageId":"17818.54115.482000.804065@lapjr.intranet.kiel.bmiag.de","threadId":"6175","inReplyTo":"Pine.LNX.4.63.0701022211100.22628@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: How to commit removed file?","fromName":"Juergen Ruehle","fromEmail":"j.ruehle@bmiag.de","sentAt":"2007-01-02T21:49:23Z","receivedAt":"2007-01-02T21:49:23Z","isPatch":false,"sender":{"key":"j.ruehle@bmiag.de","avatar":null},"body":"Johannes Schindelin writes:\n > On Tue, 2 Jan 2007, Michael S. Tsirkin wrote:\n > \n > > > I'd like to remove a file and commit the removal while\n > > > leaving out other changes in repository/index.\n > > > \n > > > $git rm kernel_patches/fixes/ib_verbs_warning_fix.patch\n > > > rm 'kernel_patches/fixes/ib_verbs_warning_fix.patch'\n > > > \n > > > $ git commit kernel_patches/fixes/ib_verbs_warning_fix.patch\n > > > error: pathspec 'kernel_patches/fixes/ib_verbs_warning_fix.patch' did not match\n > > > any file(s) known to git.\n > > > Did you forget to 'git add'?\n > > > \n > > > A similiar thing works with \"git add\".\n > > \n > > Any ideas? Can this be done with git?\n > \n > Did you actually try the \"--\" thing I suggested in \n > http://article.gmane.org/gmane.comp.version-control.git/35699/?\n > \n > Besides, I just tested with current \"next\": \n > \n > $ git commit kernel_patches/fixes/ib_verbs_warning_fix.patch\n > Created commit 89a5bb5ac16fb8be9b6e061284e191cafb3e4da2\n >  1 files changed, 0 insertions(+), 22 deletions(-)\n >  delete mode 100644 a234\n\nBut (at least in next from yesterday or something -- having an old\nmodem here only:-) it doesn't work if you delete the file using\ngit-rm, because git-commit -o operates only on known files: one of the\nfirst things in this code path is a\n\n  git-ls-files --error-unmatch -- $@\n\nThis seems wrong because -o is supposed to bypass the index. It\nshould probably be doing ls-tree --name-only HEAD -- $@ instead, but\nls-tree doesn't have the --error-match functionality.\n"},{"id":"30710","messageId":"enel8u$n8g$2@sea.gmane.org","threadId":"6175","inReplyTo":"7vfyatt8di.fsf@assigned-by-dhcp.cox.net","subject":"Re: How to commit removed file?","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2007-01-02T22:13:45Z","receivedAt":"2007-01-02T22:13:45Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Junio C Hamano wrote:\n\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> \n>> On Tue, 2 Jan 2007, Michael S. Tsirkin wrote:\n>>\n>>>> I'd like to remove a file and commit the removal while\n>>>> leaving out other changes in repository/index.\n>>>> \n>>>> $git rm kernel_patches/fixes/ib_verbs_warning_fix.patch\n>>>> rm 'kernel_patches/fixes/ib_verbs_warning_fix.patch'\n>>>> \n>>>> $ git commit kernel_patches/fixes/ib_verbs_warning_fix.patch\n>>>> error: pathspec 'kernel_patches/fixes/ib_verbs_warning_fix.patch' did\nnot match\n>>>> any file(s) known to git.\n>>>> Did you forget to 'git add'?\n>>>> \n>>>> A similiar thing works with \"git add\".\n>>> \n>>> Any ideas? Can this be done with git?\n>>\n>> Did you actually try the \"--\" thing I suggested in \n>> http://article.gmane.org/gmane.comp.version-control.git/35699/?\n>>\n>> Besides, I just tested with current \"next\": \n>>\n>> $ git commit kernel_patches/fixes/ib_verbs_warning_fix.patch\n>> Created commit 89a5bb5ac16fb8be9b6e061284e191cafb3e4da2\n>>  1 files changed, 0 insertions(+), 22 deletions(-)\n>>  delete mode 100644 a234\n> \n> The difference is Michael did \"git rm\" to explicitly tell git to\n> forget about that path, while you used the vanilla \"/bin/rm\".\n> \n> Personally I never saw the point of having \"git rm\".  Maybe we\n> should remove it to prevent this confusion from happening.\n\nDoes this happen with new git-rm, which removes file also from\nworking directory?\n\nBTW. you probably can do this with git-update-index...\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"},{"id":"30713","messageId":"Pine.LNX.4.63.0701022318480.22628@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"6175","inReplyTo":"7vfyatt8di.fsf@assigned-by-dhcp.cox.net","subject":"Re: How to commit removed file?","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-01-02T22:20:29Z","receivedAt":"2007-01-02T22:20:29Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 2 Jan 2007, Junio C Hamano wrote:\n\n> The difference is Michael did \"git rm\" to explicitly tell git to forget \n> about that path, while you used the vanilla \"/bin/rm\".\n\nAh. In this case, it is enough to just say \"git commit\"...\n\n> Personally I never saw the point of having \"git rm\".  Maybe we should \n> remove it to prevent this confusion from happening.\n\nPeople seem so used to \"cvs remove\" that they had to have \"git rm\". Dunno. \nI never used it. (Except to verify that indeed even \"--\" does not work \nwith Michael's example.)\n\nCiao,\nDscho\n"},{"id":"30948","messageId":"87lkklgc8v.wl%cworth@cworth.org","threadId":"6175","inReplyTo":"7vfyatt8di.fsf@assigned-by-dhcp.cox.net","subject":"Re: How to commit removed file?","fromName":"Carl Worth","fromEmail":"cworth@cworth.org","sentAt":"2007-01-03T00:55:28Z","receivedAt":"2007-01-03T00:55:28Z","isPatch":false,"sender":{"key":"cworth@cworth.org","avatar":"https://gravatar.com/avatar/3746dc28cde609bdbd7f939058356e7e2bbd16d21e32274df0725eb3d998bc5b?d=mp&s=160"},"body":"On Tue, 02 Jan 2007 13:40:41 -0800, Junio C Hamano wrote:\n> Personally I never saw the point of having \"git rm\".  Maybe we\n> should remove it to prevent this confusion from happening.\n\nThe one place where it's really \"necessary\", (as opposed to some users\njust expecting it to be there), is to \"undo\" a git-add, (and I mean a\ngit-add that actually adds a new path to the index, not one of these\nnewfangled git-adds that simply updates content for an existing path).\n\nFor that scenario, without git-rm, the user would be forced to learn\nhow to use git-update-index to solve this problem.\n\n(And note, that this is also the one case where it's the _right_ thing\nfor git-rm to actually leave the file around. I haven't checked to see\nif the latest round of git-rm semantic cleanups still handle this use\ncase correctly.)\n\n-Carl\n"},{"id":"30726","messageId":"20070103060640.GD20259@mellanox.co.il","threadId":"6175","inReplyTo":"7vfyatt8di.fsf@assigned-by-dhcp.cox.net","subject":"Re: How to commit removed file?","fromName":"Michael S. Tsirkin","fromEmail":"mst@mellanox.co.il","sentAt":"2007-01-03T06:06:40Z","receivedAt":"2007-01-03T06:06:40Z","isPatch":false,"sender":{"key":"mst@kernel.org","avatar":null},"body":"Mutt Label Removed By VIM\n> Quoting r. Junio C Hamano <junkio@cox.net>:\n> Subject: Re: How to commit removed file?\n> \n> >> > I'd like to remove a file and commit the removal while\n> >> > leaving out other changes in repository/index.\n> >> > \n> >> > $git rm kernel_patches/fixes/ib_verbs_warning_fix.patch\n> >> > rm 'kernel_patches/fixes/ib_verbs_warning_fix.patch'\n> >> > \n> >> > $ git commit kernel_patches/fixes/ib_verbs_warning_fix.patch\n> >> > error: pathspec 'kernel_patches/fixes/ib_verbs_warning_fix.patch' did not match\n> >> > any file(s) known to git.\n> >> > Did you forget to 'git add'?\n> >> > \n> >> > A similiar thing works with \"git add\".\n> >> \n> >> Any ideas? Can this be done with git?\n> >\n> > Did you actually try the \"--\" thing I suggested in \n> > http://article.gmane.org/gmane.comp.version-control.git/35699/?\n> >\n> > Besides, I just tested with current \"next\": \n> >\n> > $ git commit kernel_patches/fixes/ib_verbs_warning_fix.patch\n> > Created commit 89a5bb5ac16fb8be9b6e061284e191cafb3e4da2\n> >  1 files changed, 0 insertions(+), 22 deletions(-)\n> >  delete mode 100644 a234\n> \n> The difference is Michael did \"git rm\" to explicitly tell git to\n> forget about that path, while you used the vanilla \"/bin/rm\".\n> \n> Personally I never saw the point of having \"git rm\".  Maybe we\n> should remove it to prevent this confusion from happening.\n\nBut won't the same problem appear with\n\nrm file\ngit-update-index file\ngit-commit file\n\n-- \nMST\n"},{"id":"30727","messageId":"7vhcv8r4ac.fsf@assigned-by-dhcp.cox.net","threadId":"6175","inReplyTo":"20070103060640.GD20259@mellanox.co.il","subject":"Re: How to commit removed file?","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-01-03T06:51:55Z","receivedAt":"2007-01-03T06:51:55Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Michael S. Tsirkin\" <mst@mellanox.co.il> writes:\n\n> But won't the same problem appear with\n>\n> rm file\n> git-update-index file\n> git-commit file\n\nIf you do index manipulation yourself using update-index, do not\njump the index at the commit time using \"git commit file...\"\nsyntax; the sole purpose of that misfeature is to handhold\nCVS-braindamaged people who want to make per-path partial\ncommits.\n\nWe bend backwards to allow index-jumping for most cases in\ngit-commit, and you found that \"most\" is not \"all\".  That's a\ngreat news.\n\nI am not interested to make it \"all\" myself -- if somebody else\ndoes it, that is fine, though ;-).\n"},{"id":"30730","messageId":"7vwt44pop0.fsf@assigned-by-dhcp.cox.net","threadId":"6175","inReplyTo":"7vhcv8r4ac.fsf@assigned-by-dhcp.cox.net","subject":"Re: How to commit removed file?","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-01-03T07:14:03Z","receivedAt":"2007-01-03T07:14:03Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <junkio@cox.net> writes:\n\n> ...  That's a\n> great news.\n>\n> I am not interested to make it \"all\" myself -- if somebody else\n> does it, that is fine, though ;-).\n\nJust in case you do not know me, sorry for too much negative\ntone in my message.  I was just venting. It was not like I was\noffended by something you said or anything like that.\n\nThe \"commit path...\" feature, while I would even agree that it\nsometimes is useful in simple cases, is something that goes\nquite against what git does normally, and anybody would\nunderstand why after inspecting what git-commit has to do to\nimplement that.  I personally hate that \"feature\".\n\nHaving said that, I am known to support features that I do not\nagree with myself for other people, and sometimes even implement\nthem myself.  But that does not mean I have to like them ;-).\n"},{"id":"30822","messageId":"20070104174119.GC2203@mellanox.co.il","threadId":"6175","inReplyTo":"7vwt44pop0.fsf@assigned-by-dhcp.cox.net","subject":"Re: How to commit removed file?","fromName":"Michael S. Tsirkin","fromEmail":"mst@mellanox.co.il","sentAt":"2007-01-04T17:41:19Z","receivedAt":"2007-01-04T17:41:19Z","isPatch":false,"sender":{"key":"mst@kernel.org","avatar":null},"body":"> > ...  That's a\n> > great news.\n> >\n> > I am not interested to make it \"all\" myself -- if somebody else\n> > does it, that is fine, though ;-).\n> \n> Just in case you do not know me, sorry for too much negative\n> tone in my message.  I was just venting. It was not like I was\n> offended by something you said or anything like that.\n> \n> The \"commit path...\" feature, while I would even agree that it\n> sometimes is useful in simple cases, is something that goes\n> quite against what git does normally, and anybody would\n> understand why after inspecting what git-commit has to do to\n> implement that.  I personally hate that \"feature\".\n> \n> Having said that, I am known to support features that I do not\n> agree with myself for other people, and sometimes even implement\n> them myself.  But that does not mean I have to like them ;-).\n\nWell, it's just a minor annoyance for me, so unless more people\nask for this to be fixed, I'm unlikely to invest time in this, either.\n\n-- \nMST\n"},{"id":"30951","messageId":"7vzm8wapdv.fsf@assigned-by-dhcp.cox.net","threadId":"6175","inReplyTo":"87lkklgc8v.wl%cworth@cworth.org","subject":"Re: How to commit removed file?","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-01-06T01:57:16Z","receivedAt":"2007-01-06T01:57:16Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Carl Worth <cworth@cworth.org> writes:\n\n> On Tue, 02 Jan 2007 13:40:41 -0800, Junio C Hamano wrote:\n>> Personally I never saw the point of having \"git rm\".  Maybe we\n>> should remove it to prevent this confusion from happening.\n>\n> The one place where it's really \"necessary\", (as opposed to some users\n> just expecting it to be there), is to \"undo\" a git-add, (and I mean a\n> git-add that actually adds a new path to the index, not one of these\n> newfangled git-adds that simply updates content for an existing path).\n\n\"git reset\" (i.e. --mixed) is the way to revert the index back\nto HEAD and start over.\n"},{"id":"31534","messageId":"877ivtxbt2.wl%cworth@cworth.org","threadId":"6175","inReplyTo":"7vzm8wapdv.fsf@assigned-by-dhcp.cox.net","subject":"Re: How to commit removed file?","fromName":"Carl Worth","fromEmail":"cworth@cworth.org","sentAt":"2007-01-12T01:40:09Z","receivedAt":"2007-01-12T01:40:09Z","isPatch":false,"sender":{"key":"cworth@cworth.org","avatar":"https://gravatar.com/avatar/3746dc28cde609bdbd7f939058356e7e2bbd16d21e32274df0725eb3d998bc5b?d=mp&s=160"},"body":"On Fri, 05 Jan 2007 17:57:16 -0800, Junio C Hamano wrote:\n> Carl Worth <cworth@cworth.org> writes:\n> > On Tue, 02 Jan 2007 13:40:41 -0800, Junio C Hamano wrote:\n> >> Personally I never saw the point of having \"git rm\".  Maybe we\n> >> should remove it to prevent this confusion from happening.\n> >\n> > The one place where it's really \"necessary\", (as opposed to some users\n> > just expecting it to be there), is to \"undo\" a git-add, (and I mean a\n> > git-add that actually adds a new path to the index, not one of these\n> > newfangled git-adds that simply updates content for an existing path).\n>\n> \"git reset\" (i.e. --mixed) is the way to revert the index back\n> to HEAD and start over.\n\nBut that's a lot more than I want.\n\nHere's something like one of the original use cases that I hit and had\nin mind (as best I recall) that motivated be to write the initial\ngit-rm command. It was something like adding a feature and a new\ntest-case at the same time:\n\n\tgit update-index src/Makefile\n\tgit update-index src/some-feature.c\n\tgit add test/feature-test.c\n\t# Hmm, wait, it'd be cleaner to add test/feature-test.c as a separate\n\t# commit. How can I undo that \"git add\" I just did?\n\nSo, at this point, I could git-reset and start over, but I wanted a\nway to undo just the \"add\" and leave all the other updates still in\nthe index.\n\nIt's not really all that important to be able to undo the add,\n(there's not really a corresponding way to selectively undo the other\nupdate-index calls without using git-reset for everything).\n\nBut now that I tried this case with a recent git (2a3a3c247) for which\ngit-rm does working-tree removal without -f, I see that it does\nirretrievably destroy information in this case:\n\n\t$ echo \"important stuff\" > new-file\n\t$ git add new-file\n\t$ git rm new-file\n\nThis now deletes new-file from the working tree and there's no copy of\nthe data inside git. The old git-rm would just return the file to it's\n\"untracked\" state in this case.\n\nI had thought the safety check was going to be that the index state\nmatched the HEAD state before git-rm would delete from the working\ntree.\n\n(Note, that I definitely agree that it's an improvement that git-rm\ndoes delete the working-tree file when the working-tree and index and\nHEAD all have the same content.)\n\n-Carl\n"},{"id":"31548","messageId":"eo7omq$1ap$1@sea.gmane.org","threadId":"6175","inReplyTo":"877ivtxbt2.wl%cworth@cworth.org","subject":"Re: How to commit removed file?","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2007-01-12T10:42:54Z","receivedAt":"2007-01-12T10:42:54Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Carl Worth wrote:\n\n> But now that I tried this case with a recent git (2a3a3c247) for which\n> git-rm does working-tree removal without -f, I see that it does\n> irretrievably destroy information in this case:\n> \n>         $ echo \"important stuff\" > new-file\n>         $ git add new-file\n>         $ git rm new-file\n> \n> This now deletes new-file from the working tree and there's no copy of\n> the data inside git. The old git-rm would just return the file to it's\n> \"untracked\" state in this case.\n> \n> I had thought the safety check was going to be that the index state\n> matched the HEAD state before git-rm would delete from the working\n> tree.\n\nThat is certainly bug in new git-rm; it should remove file _only_\nif it can be recovered with the same state as it was before git-rm. \n\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"}]}