* RFE: git rm @ 2005-10-24 19:02 Jeff Garzik 2005-10-24 19:04 ` H. Peter Anvin 2005-10-24 20:40 ` Junio C Hamano 0 siblings, 2 replies; 6+ messages in thread From: Jeff Garzik @ 2005-10-24 19:02 UTC (permalink / raw) To: Git Mailing List It would be nice to say "git rm files..." and have two operations occur: * list of files is passed to rm(1) * list of files is passed to git-update-index --remove ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: RFE: git rm 2005-10-24 19:02 RFE: git rm Jeff Garzik @ 2005-10-24 19:04 ` H. Peter Anvin 2005-10-24 20:40 ` Junio C Hamano 1 sibling, 0 replies; 6+ messages in thread From: H. Peter Anvin @ 2005-10-24 19:04 UTC (permalink / raw) To: Jeff Garzik; +Cc: Git Mailing List Jeff Garzik wrote: > > It would be nice to say "git rm files..." and have two operations occur: > > * list of files is passed to rm(1) > * list of files is passed to git-update-index --remove > Install cogito and you have the above as "cg-rm". -hpa ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: RFE: git rm 2005-10-24 19:02 RFE: git rm Jeff Garzik 2005-10-24 19:04 ` H. Peter Anvin @ 2005-10-24 20:40 ` Junio C Hamano 2005-10-24 21:38 ` Daniel Barkalow 1 sibling, 1 reply; 6+ messages in thread From: Junio C Hamano @ 2005-10-24 20:40 UTC (permalink / raw) To: Jeff Garzik; +Cc: git Jeff Garzik <jgarzik@pobox.com> writes: > It would be nice to say "git rm files..." and have two operations occur: > > * list of files is passed to rm(1) > * list of files is passed to git-update-index --remove This is not a big problem *if* your index always matches the HEAD tree (i.e. no intermediate git-update-index in between commits) --- you can just say "rm -f files..." at the point of removal, continue your work, and either pass these files from the command line, or -a flag when running 'git commit'. Running git-update-index in between commits is a valid thing to do, and it helps reducing the clutter when viewing 'git diff' to see what your changes look like since your last update-index. The workflow would go like this: 1$ git checkout ... work work work ... what have I done so far? 2$ git diff ... the intermediate result looks OK, so record what we have ... done so far... 3$ git-update-index --add --remove files... ... work work work ... go back to step 2 as many times as needed. ... now what is the sum of changes since the last commit? 4$ git diff HEAD ... everything looks OK. record the last bits and commit. 5$ git-update-index --add --remove files... 6$ git commit Previously Linus stated that his index almost always matches the HEAD tree, and I personally do not do intermediate update-index ever myself, but I am curious how other people use git [*1*]. If some of you run update-index in between commits, "git rm files..." would make a lot of sense. [Footnote] *1* Cogito users do not count -- they are supposed to leave index file manipulation to Cogito's smart. ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: RFE: git rm 2005-10-24 20:40 ` Junio C Hamano @ 2005-10-24 21:38 ` Daniel Barkalow 2005-10-24 22:11 ` Junio C Hamano 0 siblings, 1 reply; 6+ messages in thread From: Daniel Barkalow @ 2005-10-24 21:38 UTC (permalink / raw) To: Junio C Hamano; +Cc: Jeff Garzik, git On Mon, 24 Oct 2005, Junio C Hamano wrote: > Jeff Garzik <jgarzik@pobox.com> writes: > > > It would be nice to say "git rm files..." and have two operations occur: > > > > * list of files is passed to rm(1) > > * list of files is passed to git-update-index --remove > > This is not a big problem *if* your index always matches the > HEAD tree (i.e. no intermediate git-update-index in between > commits) --- you can just say "rm -f files..." at the point of > removal, continue your work, and either pass these files from > the command line, or -a flag when running 'git commit'. > > Running git-update-index in between commits is a valid thing to > do, and it helps reducing the clutter when viewing 'git diff' to > see what your changes look like since your last update-index. > The workflow would go like this: > > 1$ git checkout > ... work work work > > ... what have I done so far? > 2$ git diff > ... the intermediate result looks OK, so record what we have > ... done so far... > 3$ git-update-index --add --remove files... > > ... work work work > ... go back to step 2 as many times as needed. > > ... now what is the sum of changes since the last commit? > 4$ git diff HEAD > > ... everything looks OK. record the last bits and commit. > 5$ git-update-index --add --remove files... > 6$ git commit > > Previously Linus stated that his index almost always matches the > HEAD tree, and I personally do not do intermediate update-index > ever myself, but I am curious how other people use git [*1*]. > If some of you run update-index in between commits, "git rm > files..." would make a lot of sense. I often do "git add something" when I happen to think of it, not necessarily right before committing, which means that I have these files changed in my index while working. I may quit this, however, now that git status lists the ones I missed. Incidentally, the new git status entry for --others really ought to say something different from "Ignored files", like "Exist but not tracked", since it doesn't include the contents of .gitignore, which you'd expect to be "Ignored". (And, of course, any files it lists are hardly being ignored.) -Daniel *This .sig left intentionally blank* ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: RFE: git rm 2005-10-24 21:38 ` Daniel Barkalow @ 2005-10-24 22:11 ` Junio C Hamano 2005-10-24 22:22 ` Daniel Barkalow 0 siblings, 1 reply; 6+ messages in thread From: Junio C Hamano @ 2005-10-24 22:11 UTC (permalink / raw) To: Daniel Barkalow; +Cc: git Daniel Barkalow <barkalow@iabervon.org> writes: > I often do "git add something" when I happen to think of it, not > necessarily right before committing, which means that I have these files > changed in my index while working. I may quit this, however, now that git > status lists the ones I missed. Oh, I do 'git add' myself; otherwise I'd surely forget by the time I commit. And I did not mean to tell you to quit doing it. If any of you took what I said as "Linus does not do it, I do not do it, so you should not be doing update-index in the middle", then that was not my intention and I apologize for causing confusion. I think update-index in the middle is a valid workflow. The only drawback I can think of is that you cannot merge or apply others' patches once you do it until you commit. I was just curious how people use git, weighing the pros and cons of that (pros: git-diff-files is easier to read and the index gives you a good anchoring point; cons: you cannot do merge or patch application). > Incidentally, the new git status entry for --others really ought to say > something different from "Ignored files", like "Exist but not tracked", > since it doesn't include the contents of .gitignore, which you'd expect to > be "Ignored". (And, of course, any files it lists are hardly being > ignored.) Good point. Something like this? ------------ Clarify git status output. What we list as "Ignored files" are not "ignored". Rather, it is the list of "not listed in the to-be-ignored files, but exists -- you may be forgetting to add them". Pointed out by Daniel. Signed-off-by: Junio C Hamano <junkio@cox.net> --- diff --git a/git-status.sh b/git-status.sh index 29c2b11..62a24a9 100755 --- a/git-status.sh +++ b/git-status.sh @@ -90,7 +90,7 @@ perl -e '$/ = "\0"; s|\n|\\n|g; s/^/# /; if (!$shown) { - print "#\n# Ignored files:\n"; + print "#\n# Untracked files:\n"; print "# (use \"git add\" to add to commit)\n#\n"; $shown = 1; } ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: RFE: git rm 2005-10-24 22:11 ` Junio C Hamano @ 2005-10-24 22:22 ` Daniel Barkalow 0 siblings, 0 replies; 6+ messages in thread From: Daniel Barkalow @ 2005-10-24 22:22 UTC (permalink / raw) To: Junio C Hamano; +Cc: git On Mon, 24 Oct 2005, Junio C Hamano wrote: > Daniel Barkalow <barkalow@iabervon.org> writes: > > > I often do "git add something" when I happen to think of it, not > > necessarily right before committing, which means that I have these files > > changed in my index while working. I may quit this, however, now that git > > status lists the ones I missed. > > Oh, I do 'git add' myself; otherwise I'd surely forget by the > time I commit. > > And I did not mean to tell you to quit doing it. If any of you > took what I said as "Linus does not do it, I do not do it, so > you should not be doing update-index in the middle", then that > was not my intention and I apologize for causing confusion. Actually, I'm thinking of quitting that because I'm actually more likely to realize I need to add something when I see it in the untracked list than any other time. Now that the untracked list is right there, I probably won't bother to think about it until that point. That is, the new feature makes my old habit unnecessary. (I obviously don't care what other people do; I'm still using multiple working trees with the same repository, which AFAIK nobody else has done for months.) For that matter, it helps, if I find I've done two things that I want to commit separately in the same working tree if the first commit doesn't have to include the addition of all the new files. > > Incidentally, the new git status entry for --others really ought to say > > something different from "Ignored files", like "Exist but not tracked", > > since it doesn't include the contents of .gitignore, which you'd expect to > > be "Ignored". (And, of course, any files it lists are hardly being > > ignored.) > > Good point. Something like this? Looks like what I was thinking, yes. -Daniel *This .sig left intentionally blank* ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2005-10-24 22:23 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2005-10-24 19:02 RFE: git rm Jeff Garzik 2005-10-24 19:04 ` H. Peter Anvin 2005-10-24 20:40 ` Junio C Hamano 2005-10-24 21:38 ` Daniel Barkalow 2005-10-24 22:11 ` Junio C Hamano 2005-10-24 22:22 ` Daniel Barkalow
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).