{"thread":{"id":"2210","subject":"RFE: git rm","startedAt":"2005-10-24T19:02:56Z","lastAt":"2005-10-24T22:22:33Z","messageCount":6,"participants":["Jeff Garzik","H. Peter Anvin","Junio C Hamano","Daniel Barkalow"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"10547","messageId":"435D2FE0.3060307@pobox.com","threadId":"2210","inReplyTo":null,"subject":"RFE: git rm","fromName":"Jeff Garzik","fromEmail":"jgarzik@pobox.com","sentAt":"2005-10-24T19:02:56Z","receivedAt":"2005-10-24T19:02:56Z","isPatch":false,"sender":{"key":"jgarzik@pobox.com","avatar":null},"body":"\nIt would be nice to say \"git rm files...\" and have two operations occur:\n\n* list of files is passed to rm(1)\n* list of files is passed to git-update-index --remove\n"},{"id":"10548","messageId":"435D304D.2070306@zytor.com","threadId":"2210","inReplyTo":"435D2FE0.3060307@pobox.com","subject":"Re: RFE: git rm","fromName":"H. Peter Anvin","fromEmail":"hpa@zytor.com","sentAt":"2005-10-24T19:04:45Z","receivedAt":"2005-10-24T19:04:45Z","isPatch":false,"sender":{"key":"hpa@zytor.com","avatar":null},"body":"Jeff Garzik wrote:\n> \n> It would be nice to say \"git rm files...\" and have two operations occur:\n> \n> * list of files is passed to rm(1)\n> * list of files is passed to git-update-index --remove\n> \n\nInstall cogito and you have the above as \"cg-rm\".\n\n\t-hpa\n"},{"id":"10549","messageId":"7virvmodhz.fsf@assigned-by-dhcp.cox.net","threadId":"2210","inReplyTo":"435D2FE0.3060307@pobox.com","subject":"Re: RFE: git rm","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-10-24T20:40:08Z","receivedAt":"2005-10-24T20:40:08Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff Garzik <jgarzik@pobox.com> writes:\n\n> It would be nice to say \"git rm files...\" and have two operations occur:\n>\n> * list of files is passed to rm(1)\n> * list of files is passed to git-update-index --remove\n\nThis is not a big problem *if* your index always matches the\nHEAD tree (i.e. no intermediate git-update-index in between\ncommits) --- you can just say \"rm -f files...\" at the point of\nremoval, continue your work, and either pass these files from\nthe command line, or -a flag when running 'git commit'.\n\nRunning git-update-index in between commits is a valid thing to\ndo, and it helps reducing the clutter when viewing 'git diff' to\nsee what your changes look like since your last update-index.\nThe workflow would go like this:\n\n    1$ git checkout\n    ... work work work\n\n    ... what have I done so far?\n    2$ git diff\n    ... the intermediate result looks OK, so record what we have\n    ... done so far...\n    3$ git-update-index --add --remove files...\n\n    ... work work work\n    ... go back to step 2 as many times as needed.\n\n    ... now what is the sum of changes since the last commit?\n    4$ git diff HEAD\n\n    ... everything looks OK.  record the last bits and commit.\n    5$ git-update-index --add --remove files...\n    6$ git commit\n\nPreviously Linus stated that his index almost always matches the\nHEAD tree, and I personally do not do intermediate update-index\never myself, but I am curious how other people use git [*1*].\nIf some of you run update-index in between commits, \"git rm\nfiles...\"  would make a lot of sense.\n\n\n[Footnote]\n\n*1* Cogito users do not count -- they are supposed to leave\nindex file manipulation to Cogito's smart.\n"},{"id":"10554","messageId":"Pine.LNX.4.64.0510241725370.25300@iabervon.org","threadId":"2210","inReplyTo":"7virvmodhz.fsf@assigned-by-dhcp.cox.net","subject":"Re: RFE: git rm","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2005-10-24T21:38:25Z","receivedAt":"2005-10-24T21:38:25Z","isPatch":false,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"On Mon, 24 Oct 2005, Junio C Hamano wrote:\n\n> Jeff Garzik <jgarzik@pobox.com> writes:\n> \n> > It would be nice to say \"git rm files...\" and have two operations occur:\n> >\n> > * list of files is passed to rm(1)\n> > * list of files is passed to git-update-index --remove\n> \n> This is not a big problem *if* your index always matches the\n> HEAD tree (i.e. no intermediate git-update-index in between\n> commits) --- you can just say \"rm -f files...\" at the point of\n> removal, continue your work, and either pass these files from\n> the command line, or -a flag when running 'git commit'.\n> \n> Running git-update-index in between commits is a valid thing to\n> do, and it helps reducing the clutter when viewing 'git diff' to\n> see what your changes look like since your last update-index.\n> The workflow would go like this:\n> \n>     1$ git checkout\n>     ... work work work\n> \n>     ... what have I done so far?\n>     2$ git diff\n>     ... the intermediate result looks OK, so record what we have\n>     ... done so far...\n>     3$ git-update-index --add --remove files...\n> \n>     ... work work work\n>     ... go back to step 2 as many times as needed.\n> \n>     ... now what is the sum of changes since the last commit?\n>     4$ git diff HEAD\n> \n>     ... everything looks OK.  record the last bits and commit.\n>     5$ git-update-index --add --remove files...\n>     6$ git commit\n> \n> Previously Linus stated that his index almost always matches the\n> HEAD tree, and I personally do not do intermediate update-index\n> ever myself, but I am curious how other people use git [*1*].\n> If some of you run update-index in between commits, \"git rm\n> files...\"  would make a lot of sense.\n\nI often do \"git add something\" when I happen to think of it, not \nnecessarily right before committing, which means that I have these files \nchanged in my index while working. I may quit this, however, now that git \nstatus lists the ones I missed.\n\nIncidentally, the new git status entry for --others really ought to say \nsomething different from \"Ignored files\", like \"Exist but not tracked\", \nsince it doesn't include the contents of .gitignore, which you'd expect to \nbe \"Ignored\". (And, of course, any files it lists are hardly being \nignored.)\n\n\t-Daniel\n*This .sig left intentionally blank*\n"},{"id":"10556","messageId":"7vr7aalg57.fsf@assigned-by-dhcp.cox.net","threadId":"2210","inReplyTo":"Pine.LNX.4.64.0510241725370.25300@iabervon.org","subject":"Re: RFE: git rm","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-10-24T22:11:16Z","receivedAt":"2005-10-24T22:11:16Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Daniel Barkalow <barkalow@iabervon.org> writes:\n\n> I often do \"git add something\" when I happen to think of it, not \n> necessarily right before committing, which means that I have these files \n> changed in my index while working. I may quit this, however, now that git \n> status lists the ones I missed.\n\nOh, I do 'git add' myself; otherwise I'd surely forget by the\ntime I commit.\n\nAnd I did not mean to tell you to quit doing it.  If any of you\ntook what I said as \"Linus does not do it, I do not do it, so\nyou should not be doing update-index in the middle\", then that\nwas not my intention and I apologize for causing confusion.\n\nI think update-index in the middle is a valid workflow.  The\nonly drawback I can think of is that you cannot merge or apply\nothers' patches once you do it until you commit.  I was just\ncurious how people use git, weighing the pros and cons of that\n(pros: git-diff-files is easier to read and the index gives you\na good anchoring point; cons: you cannot do merge or patch\napplication).\n\n> Incidentally, the new git status entry for --others really ought to say \n> something different from \"Ignored files\", like \"Exist but not tracked\", \n> since it doesn't include the contents of .gitignore, which you'd expect to \n> be \"Ignored\". (And, of course, any files it lists are hardly being \n> ignored.)\n\nGood point.  Something like this?\n\n ------------\nClarify git status output.\n\nWhat we list as \"Ignored files\" are not \"ignored\".  Rather, it\nis the list of \"not listed in the to-be-ignored files, but\nexists -- you may be forgetting to add them\".\n\nPointed out by Daniel.\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n\n---\ndiff --git a/git-status.sh b/git-status.sh\nindex 29c2b11..62a24a9 100755\n--- a/git-status.sh\n+++ b/git-status.sh\n@@ -90,7 +90,7 @@ perl -e '$/ = \"\\0\";\n \t\ts|\\n|\\\\n|g;\n \t\ts/^/#\t/;\n \t\tif (!$shown) {\n-\t\t\tprint \"#\\n# Ignored files:\\n\";\n+\t\t\tprint \"#\\n# Untracked files:\\n\";\n \t\t\tprint \"#   (use \\\"git add\\\" to add to commit)\\n#\\n\";\n \t\t\t$shown = 1;\n \t\t}\n"},{"id":"10557","messageId":"Pine.LNX.4.64.0510241812530.25300@iabervon.org","threadId":"2210","inReplyTo":"7vr7aalg57.fsf@assigned-by-dhcp.cox.net","subject":"Re: RFE: git rm","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2005-10-24T22:22:33Z","receivedAt":"2005-10-24T22:22:33Z","isPatch":false,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"On Mon, 24 Oct 2005, Junio C Hamano wrote:\n\n> Daniel Barkalow <barkalow@iabervon.org> writes:\n> \n> > I often do \"git add something\" when I happen to think of it, not \n> > necessarily right before committing, which means that I have these files \n> > changed in my index while working. I may quit this, however, now that git \n> > status lists the ones I missed.\n> \n> Oh, I do 'git add' myself; otherwise I'd surely forget by the\n> time I commit.\n> \n> And I did not mean to tell you to quit doing it.  If any of you\n> took what I said as \"Linus does not do it, I do not do it, so\n> you should not be doing update-index in the middle\", then that\n> was not my intention and I apologize for causing confusion.\n\nActually, I'm thinking of quitting that because I'm actually more likely \nto realize I need to add something when I see it in the untracked list \nthan any other time. Now that the untracked list is right there, I \nprobably won't bother to think about it until that point. That is, the new \nfeature makes my old habit unnecessary. (I obviously don't care what other \npeople do; I'm still using multiple working trees with the same \nrepository, which AFAIK nobody else has done for months.)\n\nFor that matter, it helps, if I find I've done two things that I want to \ncommit separately in the same working tree if the first commit doesn't \nhave to include the addition of all the new files.\n\n> > Incidentally, the new git status entry for --others really ought to say \n> > something different from \"Ignored files\", like \"Exist but not tracked\", \n> > since it doesn't include the contents of .gitignore, which you'd expect to \n> > be \"Ignored\". (And, of course, any files it lists are hardly being \n> > ignored.)\n> \n> Good point.  Something like this?\n\nLooks like what I was thinking, yes.\n\n\t-Daniel\n*This .sig left intentionally blank*\n"}]}