{"thread":{"id":"3152","subject":"how to import stuff?","startedAt":"2006-01-25T23:40:39Z","lastAt":"2006-01-26T00:16:01Z","messageCount":4,"participants":["Ian Molton","J. Bruce Fields","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"15126","messageId":"43D80C77.70207@f2s.com","threadId":"3152","inReplyTo":null,"subject":"how to import stuff?","fromName":"Ian Molton","fromEmail":"spyro@f2s.com","sentAt":"2006-01-25T23:40:39Z","receivedAt":"2006-01-25T23:40:39Z","isPatch":false,"sender":{"key":"spyro@f2s.com","avatar":null},"body":"Hi.\n\nI'd like to track the -mm tree in git.\n\nI already have a linux git tree cloned from kernel.org, so I thought I'd try\n\ngit checkout -b v2.6.16-rc1 v2.6.16-rc1\ngit checkout -b v2.6.16-rc1-mm3\npatch -Np1 < 2.6.16-rc1-mm3\n\nSo far so good - I have a tree with the patches applied\n\nbut then how do I add / remove new / deleted files?\n\ngit update-index --add --remove --refresh --ignore-missing\n\nseems to generate a list of said files, but I cant seem to figure out \nhow to get it to actually do anything useful with them.\n\ngit add . adds all the new files, but there seems to be no equivalent to \nremove files\n\nand I really dont want to run git updat-index on *every single file* \nthat changed by hand.\n\nSurely Im missing something, but I cant see what for the life of me. The \n  'everyday git' document seems to focus on small changes to one or two \nfiles.\n\nmanaging files not yet in or removed from the source isnt something \neffectively covered in the document (or if it is, I missed it somehow).\n\nIts probably obvious that Im new to this kind of SCM - and I've not got \non with SCMs generally... they never seem to be logical to me.\n\nTIA!\n\n-Ian\n"},{"id":"15127","messageId":"20060125234239.GA5426@fieldses.org","threadId":"3152","inReplyTo":"43D80C77.70207@f2s.com","subject":"Re: how to import stuff?","fromName":"J. Bruce Fields","fromEmail":"bfields@fieldses.org","sentAt":"2006-01-25T23:42:39Z","receivedAt":"2006-01-25T23:42:39Z","isPatch":false,"sender":{"key":"bfields@citi.umich.edu","avatar":null},"body":"On Wed, Jan 25, 2006 at 11:40:39PM +0000, Ian Molton wrote:\n> git add . adds all the new files, but there seems to be no equivalent to \n> remove files\n\nThat happens on commit without the need for any special command.\n\n--b.\n"},{"id":"15130","messageId":"7vvew7kfog.fsf@assigned-by-dhcp.cox.net","threadId":"3152","inReplyTo":"43D80C77.70207@f2s.com","subject":"Re: how to import stuff?","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-01-26T00:15:27Z","receivedAt":"2006-01-26T00:15:27Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ian Molton <spyro@f2s.com> writes:\n\n> git checkout -b v2.6.16-rc1 v2.6.16-rc1\n\nYou are creating a branch called v2.6.16-rc1 while you have a\ntag with the same name.  From this point on, when you say\nv2.6.16-rc1 when git expects an arbitrary revision name, the\ncommit Linus tagged with that name is used.  When git expects\nyou to use it a branch name, it uses the branch head commit of\nthe branch you created here.  Once you create a new commit in\nthat branch, these two will refer to different commits depending\non the context.  Unless you really understand what you are\ndoing, this would confuse you, so do not do this.  Use some\nother branch name.  Better yet...\n\n> git checkout -b v2.6.16-rc1-mm3\n\nStarting from a vanilla clone from Linus, up to this point you\ncould probably have done:\n\n\t$ git checkout -b v2.6.16-rc1-mm3 v2.6.16-rc1\n\nYou do not need v2.6.16-rc1 branch if you immediately create\nanother branch, which is the branch you would want to work on.\n\n> patch -Np1 < 2.6.16-rc1-mm3\n> So far so good - I have a tree with the patches applied\n\n        $ git apply --index 2.6.16-rc1-mm3\n\nIf the patch you are using cleanly applies without fuzz, this\nwould apply them to the working tree, and all the new and/or\nremoved files are registered to the index, without you having to\nsay \"git update-index\".\n\n> git update-index --add --remove --refresh --ignore-missing\n>\n> seems to generate a list of said files, but I cant seem to figure out\n> how to get it to actually do anything useful with them.\n\nI have no idea what this update-index line with only the\nflags means, so let's forget about that.\n\nAfter applying the patch with \"patch -p1 -E\" on top of the\nvanilla version:\n\n\t$ git add .\n\nwould add all the new files.  Then\n\n\t$ git commit -a -m '2.6.16-rc1-mm3'\n\nwould notice removed and modified files as well when making a\ncommit.\n\nHOWEVER.\n\nI honestly do not understand what value you are expecting to get\nout of git, if you are rolling the whole thing from -mm series\ninto a singe commit.  Commit is designed to be easily handled as\nan atomic change, and being able to pick and choose only parts\nof it was never part of its design goal, so I do not understand\nwhat useful things you are expecting to do, after you create\nthat commit.\n\nIOW, there is a reason -mm series is available as individual\nbroken-out/ files.\n"},{"id":"15131","messageId":"7vr76vkfni.fsf@assigned-by-dhcp.cox.net","threadId":"3152","inReplyTo":"20060125234239.GA5426@fieldses.org","subject":"Re: how to import stuff?","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-01-26T00:16:01Z","receivedAt":"2006-01-26T00:16:01Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"J. Bruce Fields\" <bfields@fieldses.org> writes:\n\n> On Wed, Jan 25, 2006 at 11:40:39PM +0000, Ian Molton wrote:\n>> git add . adds all the new files, but there seems to be no equivalent to \n>> remove files\n>\n> That happens on commit without the need for any special command.\n>\n> --b.\n\n... as long as you say \"git commit -a\", that is.\n"}]}