{"thread":{"id":"16932","subject":"RE: for newbs = little exercise / tutorial / warmup for windows and other non-sophisticated new Git users :-) [Scanned]","startedAt":"2008-12-30T22:21:06Z","lastAt":"2008-12-31T02:22:07Z","messageCount":4,"participants":["Conor Rafferty","Boyd Stephen Smith Jr.","Daniel Barkalow","Jeff Whiteside"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"99004","messageId":"BB5F02FD3789B54E8964D38D6775E718242D31@ALTMORE-SVR.altmore.local","threadId":"16932","inReplyTo":null,"subject":"RE: for newbs = little exercise / tutorial / warmup for windows and other non-sophisticated new Git users :-) [Scanned]","fromName":"Conor Rafferty","fromEmail":"conor.rafferty@altmore.co.uk","sentAt":null,"receivedAt":"2008-12-30T22:21:06Z","isPatch":false,"sender":{"key":"conor.rafferty@altmore.co.uk","avatar":null},"body":"I don't understand, sorry. I thought I'd already removed all files from\nthe local tree, in the $ rm *.* move just above the checkout  \n\n-----Original Message-----\nFrom: Boyd Stephen Smith Jr. [mailto:bss@iguanasuicide.net] \nSent: 30 December 2008 21:49\nTo: Conor Rafferty\nCc: git@vger.kernel.org\nSubject: Re: for newbs = little exercise / tutorial / warmup for windows\nand other non-sophisticated new Git users :-) [Scanned]\n\nOn Tuesday 2008 December 30 15:27:33 you wrote:\n> conorr@KINKLADZE /w/GITPLATFORM/swproj $ git status # On branch master\n\n> nothing to commit (working directory clean)\n>\n> conorr@KINKLADZE /w/GITPLATFORM/swproj $ git checkout versionA .\n>\n> conorr@KINKLADZE /w/GITPLATFORM/swproj $ ls ABC.txt  AC.txt\n>\n> conorr@KINKLADZE /w/GITPLATFORM/swproj $ rm *.*\n>\n> conorr@KINKLADZE /w/GITPLATFORM/swproj $ git checkout versionB .\n>\n> conorr@KINKLADZE /w/GITPLATFORM/swproj $ ls ABC.txt  AC.txt  BC.txt\n\nNot a bug.  git checkout <commit> <paths> does not delete files by\ndesign.  \nTry using \"git checkout versionB\" instead (no paths specified), and it\nwill properly remove AC.txt from your working tree as well as warning\nyou that \"You're Doing It Wrong\" (tm).\n-- \nBoyd Stephen Smith Jr.                     ,= ,-_-. =. \nbss@iguanasuicide.net                     ((_/)o o(\\_))\nICQ: 514984 YM/AIM: DaTwinkDaddy           `-'(. .)`-' \nhttp://iguanasuicide.net/                      \\_/     \n"},{"id":"99017","messageId":"200812301731.40572.bss@iguanasuicide.net","threadId":"16932","inReplyTo":"BB5F02FD3789B54E8964D38D6775E718242D31@ALTMORE-SVR.altmore.local","subject":"Re: for newbs = little exercise / tutorial / warmup for windows and other non-sophisticated new Git users :-) [Scanned]","fromName":"Boyd Stephen Smith Jr.","fromEmail":"bss@iguanasuicide.net","sentAt":"2008-12-30T23:31:36Z","receivedAt":"2008-12-30T23:31:36Z","isPatch":false,"sender":{"key":"bss@iguanasuicide.net","avatar":"https://gravatar.com/avatar/84b95eeff194b816c1568b1339e63e4b229825298664a9037b9f1ec713ead1e3?d=mp&s=160"},"body":"On Tuesday 2008 December 30 16:36:19 Conor Rafferty wrote:\n> I don't understand, sorry. I thought I'd already removed all files from\n> the local tree, in the $ rm *.* move just above the checkout\n\nYeah, I guess I missed that, and I am seeing some \"odd\" behavior from git \ncheckout <treeish> <path>, but I'm not an expert on exactly what that is \nsupposed to do, particularly when applied to a directory.\n\nThe description is:\n\"When <paths> are given, this command does not switch branches. It\nupdates the named paths in the working tree from the index file, or from a \nnamed commit.  [...]  <tree-ish> argument can be used to specify a\nspecific tree-ish to update the index for\nthe given paths before updating the working tree.\"\n\nI'm guess what is happening here is that the index is getting updated in a way \nthat includes both the files from the HEAD tree and from the named tree.  \nThen the modified index is written out, outputting all of them, effectively \ndoing some sort of \"theirs\" merge.  It's not quite what I would expect but I \ndon't normally use git checkout <treeish> <path> when path indicates a \ndirectory.\n\nYou should do a \"git status\" when you get ls output that is \"unexpected\".  \nHere, it confirms that the index has been updated (git thinks I've staged \nsome changes).\n\nPersonally, I expected \"git checkout <treeish> <paths>\" to bypass the index \nentirely, the way \"git commit <paths>\" does, but this way also makes sense -- \nat least when applied to a single file.  (And probably saves a good number of \ngit add commands...).\n\nIn short, while I can't say for sure, I'm pretty sure you don't want the \"git \ncommit <treeish> <path>\" form and want the \"git commit <treeish>\" form \ninstead.\n-- \nBoyd Stephen Smith Jr.                     ,= ,-_-. =. \nbss@iguanasuicide.net                     ((_/)o o(\\_))\nICQ: 514984 YM/AIM: DaTwinkDaddy           `-'(. .)`-' \nhttp://iguanasuicide.net/                      \\_/     \n"},{"id":"99019","messageId":"alpine.LNX.1.00.0812301859100.19665@iabervon.org","threadId":"16932","inReplyTo":"BB5F02FD3789B54E8964D38D6775E718242D31@ALTMORE-SVR.altmore.local","subject":"RE: for newbs = little exercise / tutorial / warmup for windows and other non-sophisticated new Git users :-) [Scanned]","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2008-12-31T00:15:14Z","receivedAt":"2008-12-31T00:15:14Z","isPatch":false,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"On Tue, 30 Dec 2008, Conor Rafferty wrote:\n\n> I don't understand, sorry. I thought I'd already removed all files from\n> the local tree, in the $ rm *.* move just above the checkout  \n\nThat removes them from the filesystem, but they're still in the index. And \n\"git checkout <something> .\" first gets everything that *is* in \".\" in\n<something> into the index, and then gets everything from \".\" in the index \ninto the filesystem.\n\nI suppose it is questionable as to whether it ought to copy paths that \naren't in versionA from the index into the filesystem.\n\nTo see this in a bit more detail, do:\n\n$ rm *.*\n$ git status\n(notice that the deletes are in the \"won't be committed\" section)\n\nNow, \"git checkout <path>\" will discard any changes in the \"won't be \ncommitted\" section for that path. Maybe \"git checkout versionA <path>\" \nshould only discard changes that are in the \"won't be committed\" section \nfor filenames that match that path and are in versionA (or are \n*different* in versionA and not removed?), but I think it's an area where, \nif you're expecting any particular behavior out of that command, you're \nlikely to be surprised in some way in some situation.\n\n\t-Daniel\n*This .sig left intentionally blank*\n"},{"id":"99024","messageId":"3ab397d0812301822p34a021b1w6799a9de9a4ffeb4@mail.gmail.com","threadId":"16932","inReplyTo":"alpine.LNX.1.00.0812301859100.19665@iabervon.org","subject":"Re: for newbs = little exercise / tutorial / warmup for windows and other non-sophisticated new Git users :-) [Scanned]","fromName":"Jeff Whiteside","fromEmail":"jeff.m.whiteside@gmail.com","sentAt":"2008-12-31T02:22:07Z","receivedAt":"2008-12-31T02:22:07Z","isPatch":false,"sender":{"key":"jeff.m.whiteside@gmail.com","avatar":null},"body":"wtf is wrong with\n\ngit checkout <something>\n\n??\n\nif you must have\n\ngit checkout <something> <paths>\n\nthen instead use\n\ngit checkout <something> <paths>\ngit clean\n\nbut you will lose other files that aren't part of the repo but are\nstill in the project's dir (i.e. untracked files).\n\nOn Tue, Dec 30, 2008 at 4:15 PM, Daniel Barkalow <barkalow@iabervon.org> wrote:\n> On Tue, 30 Dec 2008, Conor Rafferty wrote:\n>\n>> I don't understand, sorry. I thought I'd already removed all files from\n>> the local tree, in the $ rm *.* move just above the checkout\n>\n> That removes them from the filesystem, but they're still in the index. And\n> \"git checkout <something> .\" first gets everything that *is* in \".\" in\n> <something> into the index, and then gets everything from \".\" in the index\n> into the filesystem.\n>\n> I suppose it is questionable as to whether it ought to copy paths that\n> aren't in versionA from the index into the filesystem.\n>\n> To see this in a bit more detail, do:\n>\n> $ rm *.*\n> $ git status\n> (notice that the deletes are in the \"won't be committed\" section)\n>\n> Now, \"git checkout <path>\" will discard any changes in the \"won't be\n> committed\" section for that path. Maybe \"git checkout versionA <path>\"\n> should only discard changes that are in the \"won't be committed\" section\n> for filenames that match that path and are in versionA (or are\n> *different* in versionA and not removed?), but I think it's an area where,\n> if you're expecting any particular behavior out of that command, you're\n> likely to be surprised in some way in some situation.\n>\n>        -Daniel\n> *This .sig left intentionally blank*\n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n>\n"}]}