{"thread":{"id":"1509","subject":"(cogito) Branch offf from older commit?","startedAt":"2005-08-14T15:50:05Z","lastAt":"2005-08-14T17:03:34Z","messageCount":2,"participants":["Wolfgang Denk","Linus Torvalds"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"7247","messageId":"20050814155005.6492A353BBF@atlas.denx.de","threadId":"1509","inReplyTo":null,"subject":"(cogito) Branch offf from older commit?","fromName":"Wolfgang Denk","fromEmail":"wd@denx.de","sentAt":"2005-08-14T15:50:05Z","receivedAt":"2005-08-14T15:50:05Z","isPatch":false,"sender":{"key":"wd@denx.de","avatar":null},"body":"Is there (in cogito) a way to  start  a  branch  off  from  an  older\ncommit?\n\nAssume I receive a patch whichis based on an old version which I want\nto test first (and resolve problems) in a separate branch.\n\nThis was what I tried:\n\n* Clone main repo:\n\t-> cg-clone /git/u-boot u-boot-testing \n* Identify wanted branch point and seek to it:\n\t-> cd u-boot-testing\n\t-> cg-seek 024447b186cca55c2d803ab96b4c8f8674363b86\n* Apply patch\n\nNow how to proceed?\n\nI can add  new  files  created  by  the  patch  using  \"cg-add\",  but\ncg-status  says  \"Changes recording BLOCKED: seeked from master\", and\ncg-commit says \"committing blocked: seeked from master\", too.\n\nHowever, when I now seek back I get this:\n\n\t-> cg-seek\n\tWarning: uncommitted local changes, trying to bring them along\n\nwhich then results in a couple of conflicts which are probably to  be\nexpected.\n\n\n\nSo I tried this (after throwing away and re-creating my cloned repo):\n\n* Uncommit the commit following the one I want to keep:\n\t-> cg-admin-uncommit 342717f72a2f92a14b9c823546e5bcec244f8bf4\n\t-> cg-reset\n* cg-status reports a couple of unknown files (those added later to\n  the tree); I manually removed these\n* Apply patch\n* Check in modifications\n* Clone another tree\n\t-> cg-clone /git/u-boot u-boot-test-merge\n\t-> cd u-boot-test-merge\n* Create branch for the stuff to be tested\n\t-> cg-branch-add testing-NAND /work/u-boot-testing\n* Pull and merge:\n\t-> cg-pull testing-NAND\n\t-> cg-merge testing-NAND\n\n\nThis works as intended, but seems to be a bit  circuitous  to  me;  I\nthink this is probably a pretty common situation and there might be a\nsimpler approach which I am missing?\n\n[If possible I'd like to use cogito only, but if there  is  a  clever\nway to do this using git-core commands I'm interested, too.]\n\n\nBest regards,\n\nWolfgang Denk\n\n-- \nSoftware Engineering:  Embedded and Realtime Systems,  Embedded Linux\nPhone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de\nThe price of curiosity is a terminal experience.\n                         - Terry Pratchett, _The Dark Side of the Sun_\n"},{"id":"7248","messageId":"Pine.LNX.4.58.0508140950270.3553@g5.osdl.org","threadId":"1509","inReplyTo":"20050814155005.6492A353BBF@atlas.denx.de","subject":"Re: (cogito) Branch offf from older commit?","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2005-08-14T17:03:34Z","receivedAt":"2005-08-14T17:03:34Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Sun, 14 Aug 2005, Wolfgang Denk wrote:\n>\n> Is there (in cogito) a way to  start  a  branch  off  from  an  older\n> commit?\n\nYou should be able to just use the git commands, and cogito should be \nperfectly happy.\n\nIOW, if you do\n\n\tgit checkout -b newbranch <starting-point-sha1>\n\nyou'll switch to a \"newbranch\" that was created at the starting point, and\nas far as I can tell, this is all very cogito-friendly indeed. So now you\ncan work in that \"newbranch\" - commit things, do anything you want, and\nall with cogito (ie it's only this one raw git command you need to set\nthings up, after that you're back in cogito-land).\n\nYou can switch back with \"git checkout master\" (again, I don't think\ncogito does the local git branches yet, but once you've switched back\nyou're golden), and if you're in the \"master\" branch, you can merge with \nyour new-branch with\n\n\n\tgit resolve master newbranch \"Merge my work on xyz\"\n\nor similar.\n\nAnd always remember \"gitk --all\", since that's a very useful thing to \nvisualize where you are.\n\n> \t-> cg-seek 024447b186cca55c2d803ab96b4c8f8674363b86\n\nNo, cg-seek doesn't start a new branch, so the result is \"locked\". You \ncan't commit on top of the seek-point, because the branch you are in \nalready _has_ a child of that point.\n\n(Actually, these days cg-seek does use a fixed local git branch for the\nseek target, so that's not _technically_ true any more. I suspect Pasky is \nworking on exposing the general local branch interfaces)\n\n\t\tLinus\n"}]}