{"thread":{"id":"1688","subject":"cogito/git usage question","startedAt":"2005-08-29T10:45:33Z","lastAt":"2005-08-29T18:31:11Z","messageCount":4,"participants":["Bryan O'Donoghue","Linus Torvalds"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"7895","messageId":"4312E74D.5020203@eircom.net","threadId":"1688","inReplyTo":null,"subject":"cogito/git usage question","fromName":"Bryan O'Donoghue","fromEmail":"typedef@eircom.net","sentAt":"2005-08-29T10:45:33Z","receivedAt":"2005-08-29T10:45:33Z","isPatch":false,"sender":{"key":"typedef@eircom.net","avatar":null},"body":"Greetings all.\n\nI have a copy of\nhttp://www.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git\nwhich is currently at revision 2.6.13 as at this morning.\n\ncg-tag-ls lists every version from 2.6.11 to the current 2.6.13\ninclusive. cg-tag-ls also lists kernel version 2.6.13-rc6. What I'm\nwondering is how exactly I set copy of the tree to that version, so that\nI can apply the -mm patchset ?\n\nI've asked uncle Google and searched the git mailing list archives, as\nwell as looking through the git and cogito documentation, however, it is\nnot immediately obvious to me at this point what the correct command to\ndo this is. I'd be very grateful, if somebody could point that out.\n\nBest Regards,\nBryan\n\n-- \n\"Fiery the angels fell. Deep thunder rolled around their shores, burning\nwith the fires of Orc.\" -- Roy Batty, Blade Runner.\n"},{"id":"7899","messageId":"Pine.LNX.4.58.0508290804570.3243@g5.osdl.org","threadId":"1688","inReplyTo":"4312E74D.5020203@eircom.net","subject":"Re: cogito/git usage question","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2005-08-29T15:19:16Z","receivedAt":"2005-08-29T15:19:16Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Mon, 29 Aug 2005, Bryan O'Donoghue wrote:\n> \n> cg-tag-ls lists every version from 2.6.11 to the current 2.6.13\n> inclusive. cg-tag-ls also lists kernel version 2.6.13-rc6. What I'm\n> wondering is how exactly I set copy of the tree to that version, so that\n> I can apply the -mm patchset ?\n\nYou need to start a new branch at the right point in time, and check it\nout. Let's call it \"bryan-mm\", and then it looks something like this:\n\n\tgit checkout -b bryan-mm v2.6.13-rc6\n\n(mental footnote: pronounce it as \"git checkout new branch 'bryan-mm' at\nv2.6.13-rc3\").\n\n[ You can also do the exact same thing by\n\n\tgit branch bryan-mm v2.6.13-rc6\n\tgit checkout bryan-mm\n\n  and it's entirely a matter of taste whether you usually want to create \n  the branches first, and switch to them later, or create-and-switch in \n  one go ]\n\nSo then you can apply any -mm patches to that tree.\n\nIf you want to merge the result (ie you want to have _both_ the -mm \npatches _and_ the changes from the final 2.6.13 release), you might want \nto create yet another branch so that you can easily switch between the \ndifferent states, and then do a \"resolve\":\n\n\tgit checkout -b bryan-mm-merged\n\tgit resolve HEAD v2.6.13 \"Merge 2.6.13-rc7-mm1 and final 2.6.13\"\n\nwhich will hopefully have no conflicts, and commit the end result. If it \ndid have conflicts, you'll have to fix it up by hand (all the normal \nmarkers from CVS: \"<<<<\" one side \"=====\" other side \">>>>>\"), and then \ncommit it by hand with \"git commit --all\".\n\n[ Notice how in this second \"git checkout -b\" we only gave the new branch \n  name, not where to start. That's because we just wanted to start from \n  the same point where we already were in in the original bryan-mm branch ]\n\nFinally, use \"gitk --all\" to get a better mental visualization for what\nthe hell you just did. I keep repeating that command, because just\ndoing the commands may not give you the same understanding of what \nactually happened, but \"gitk --all\" is really good for visualizing what's \nup (less so when the branches aren't close to each other, but still..)\n\nAnd then you can switch between the different branches with just a simple\n\n\tgit checkout <branch>\n\nand off you go.\n\n\t\t\tLinus\n"},{"id":"7900","messageId":"4313369B.5060508@eircom.net","threadId":"1688","inReplyTo":"Pine.LNX.4.58.0508290804570.3243@g5.osdl.org","subject":"Re: cogito/git usage question","fromName":"Bryan O'Donoghue","fromEmail":"typedef@eircom.net","sentAt":"2005-08-29T16:23:55Z","receivedAt":"2005-08-29T16:23:55Z","isPatch":false,"sender":{"key":"typedef@eircom.net","avatar":null},"body":"Linus Torvalds wrote:\n\n<snip>\n\n> \tgit checkout -b bryan-mm v2.6.13-rc6\n> \n> (mental footnote: pronounce it as \"git checkout new branch 'bryan-mm' at\n> v2.6.13-rc3\").\n> \n> [ You can also do the exact same thing by\n> \n> \tgit branch bryan-mm v2.6.13-rc6\n> \tgit checkout bryan-mm\n\n<snip>\n\n> And then you can switch between the different branches with just a simple\n> \n> \tgit checkout <branch>\n\nHaving re-read your email, six times or so, I believe those two\nincantations finally make sense.\n\nIf I'm understanding, I update to a given git repository, branch locally\nbased on tags and then I can checkout a branch locally, to make that the\nactive branch.\n\nThank you for the input !\n\n\nBest,\nBryan\n\n-- \n\"Fiery the angels fell. Deep thunder rolled around their shores, burning\nwith the fires of Orc.\" -- Roy Batty, Blade Runner.\n"},{"id":"7913","messageId":"Pine.LNX.4.58.0508291106510.3243@g5.osdl.org","threadId":"1688","inReplyTo":"4313369B.5060508@eircom.net","subject":"Re: cogito/git usage question","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2005-08-29T18:31:11Z","receivedAt":"2005-08-29T18:31:11Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Mon, 29 Aug 2005, Bryan O'Donoghue wrote:\n> \n> If I'm understanding, I update to a given git repository, branch locally\n> based on tags and then I can checkout a branch locally, to make that the\n> active branch.\n\nExactly. This is the difference between a tag and a branch: a tag is an\n\"immobile\" point in time, while branches are \"heads of active development\"\n(there's a bit more detail to this: you _can_ change a tag, so it's not\nlike it's totally fixed in stone, but the point is that it's not a dynamic\nentity - it's some fairly static thing that you've protected).\n\nSo you can't start new development off a tag directly: you need to create\na new branch that just starts off at the point that the tag points to.  \nSo if you really think of a branch as that \"head of active development\"\nand tags as \"static points in time\" this all makes tons of sense.\n\nBtw, you don't need to branch based on tags: you can branch based of _any_ \nkind of local reference. A tag is just a common one. But you can branch \nbased on your current state too, ie a command line like\n\n\tgit branch -b fixup HEAD^\n\nmeans that you will create a \"fixup\" branch that starts not at a tag, but \nat the \"parent of HEAD\". In particular, let's say that you just committed \nsomething, and realized that you need to work on something else without \nthe new thing disturbing you (you have a patch that applies in the same \narea, or whatever), something like the above works fine.\n\nOr just use \"gitk\" to visually find a place, and when you decide to start \na new branch somewhere, select that commit in gitk, and use the \ncut-and-paste facility to just paste the SHA1 directly into\n\n\tgit branch -b working <any-random-point-sha1>\n\nso it's not like the tags are important per se, they're just short-hand \nsymbolc way-markers.\n\n\t\t\tLinus\n"}]}