{"thread":{"id":"18624","subject":"newb questions: post-cherry-pick status cleanup, shared local repository permissions","startedAt":"2009-03-30T03:03:28Z","lastAt":"2009-03-30T04:30:09Z","messageCount":3,"participants":["Aaron Davies","Nicolas Sebrecht"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"109805","messageId":"c4e763ac0903292003j22934e7ax9f9ae986bdcd6abb@mail.gmail.com","threadId":"18624","inReplyTo":null,"subject":"newb questions: post-cherry-pick status cleanup, shared local repository permissions","fromName":"Aaron Davies","fromEmail":"aaron.davies@gmail.com","sentAt":"2009-03-30T03:03:28Z","receivedAt":"2009-03-30T03:03:28Z","isPatch":false,"sender":{"key":"aaron.davies@gmail.com","avatar":null},"body":"hi, i'm new to git, and have a couple questions which are probably\nvery stupid and/or indicate that i've been doing it wrong.\n\nfirst, a couple words about my setup/workflow: i'm currently sole\ndeveloper on a project which may at some point get some other coders.\nthe environment is three linux boxes, one for development and two for\nproduction, and three accounts, mine, dev, and prod. all homedirs are\nhosted on the network and are accessible from all three boxen.\n\ni have a \"central\" (i.e. bare) repository stored in dev's homedir, and\nregular copies in all three homedirs. the language involved is\ninterpreted, so the code tree is the deployment.\n\nmy main workflow is to hack on a branch in my homedir, then merge and\npush when i have a feature ready. then i go to the dev account and\npull, which constitutes dev deployment. once it's thoroughly tested, i\ndo the same in the prod account.\n\nnow, the questions: an exception to this workflow occurred a couple\nmonths ago, when i made some urgent bugfixes that needed to move to\nprod before other stuff that was currently being tested in dev. this\nwas done via cherry-picking some specific commits into prod. now, in\nprod, when i do \"git status\", it says \"# Your branch is ahead of\n'origin/master' by 8 commits.\" is there an easy way to get rid of\nthis? last time i tried it on my own, i attempted some sort of push\nfrom prod back to dev, wiped out most of the changes since those\ncherry-picks, and had to recover by restoring my repository from\nbackup.\n\nsecond, the ownership structure i currently have for the \"central\"\nrepository feels wrong to me--the whole thing is owned by my personal\naccount, depsite being hosted in dev's account. since i'm the only one\nwho ever pushes into it, this is not currently a problem, but it's\ncaused permissions issues on the rare occasions i've tried to push\nfrom other accounts (e.g. prod, above), and will presumably cause many\nmore if anyone else ever starts coding on this project.\n\nadvice?\n-- \nAaron Davies\naaron.davies@gmail.com\n"},{"id":"109810","messageId":"20090330042226.GA12907@vidovic","threadId":"18624","inReplyTo":"c4e763ac0903292003j22934e7ax9f9ae986bdcd6abb@mail.gmail.com","subject":"Re: newb questions: post-cherry-pick status cleanup, shared local repository permissions","fromName":"Nicolas Sebrecht","fromEmail":"nicolas.s-dev@laposte.net","sentAt":"2009-03-30T04:22:26Z","receivedAt":"2009-03-30T04:22:26Z","isPatch":false,"sender":{"key":"nicolas.s-dev@laposte.net","avatar":null},"body":"\nOn Mon, Mar 30, 2009 at 11:03:28AM +0800, Aaron Davies wrote:\n> \n> hi, i'm new to git, and have a couple questions which are probably\n> very stupid and/or indicate that i've been doing it wrong.\n> \n> first, a couple words about my setup/workflow: i'm currently sole\n> developer on a project which may at some point get some other coders.\n> the environment is three linux boxes, one for development and two for\n> production, and three accounts, mine, dev, and prod. all homedirs are\n> hosted on the network and are accessible from all three boxen.\n> \n> i have a \"central\" (i.e. bare) repository stored in dev's homedir, and\n> regular copies in all three homedirs. the language involved is\n> interpreted, so the code tree is the deployment.\n> \n> my main workflow is to hack on a branch in my homedir, then merge and\n> push when i have a feature ready. then i go to the dev account and\n> pull, which constitutes dev deployment. once it's thoroughly tested, i\n> do the same in the prod account.\n\nLooks sane. \n\nThat said, you could also work on branches (all in \"homedir\") for the\n    'working on feature' -> testing (dev) -> ready (prod) \nworkflow.\n\n> now, the questions: an exception to this workflow occurred a couple\n> months ago, when i made some urgent bugfixes that needed to move to\n> prod before other stuff that was currently being tested in dev. this\n> was done via cherry-picking some specific commits into prod. now, in\n> prod, when i do \"git status\", it says \"# Your branch is ahead of\n> 'origin/master' by 8 commits.\" is there an easy way to get rid of\n> this?\n\nWhat I would do is working on \"TOPIC\" branches. By this way, the bare,\ndev and prod repositories would not \"know\" of all the commits from mine\nbut only the urgent fixes.\n\nin \"mine\":\n- step 1\n    $ git checkout -b bugfixes master\n\n- step 2\n    $ git cherry-pick blabla\n    (and/or <hack, hack, hack>)\n\n- step 3\n    $ git checkout master\n    $ git merge bugfixes\n\n- step 4\n    $ git push origin master:master (to the bare repo)\n\n- step 5\n    $ git branch -d bugfixes\n    $ git checkout myworking\n    $ git rebase myworking master\n\n\nAt step 1, we create the new bugfixes branch from master:\n      (bugfixes)\n     /\no-o-o          (master)\n     \\\n      a-b-c-d  (myworking)\n\nAt step 2, we fix the bugs (cherry-picking and hack):\n      a-c-y-z  (bugfixes)\n     /\no-o-o          (master)\n     \\\n      a-b-c-d  (myworking)\n\nAt step 3, we merge the urgent fixes into master:\n      a-c-y-z  (bugfixes)\n     /\no-o-o-a-c-y-z  (master)\n     \\\n      a-b-c-d  (myworking)\n\nAt step 4, we push the urgent work as usual pushes.\nAt step 5, we come back to the usual work:\n\no-o-o-a-c-y-z  (master)\n             \\\n              b'-d'  (myworking)\n\n>From here, you update dev and prod as usual.\n\n-- \nNicolas Sebrecht\n"},{"id":"109813","messageId":"20090330043009.GB12907@vidovic","threadId":"18624","inReplyTo":"20090330042226.GA12907@vidovic","subject":"Re: newb questions: post-cherry-pick status cleanup, shared local repository permissions","fromName":"Nicolas Sebrecht","fromEmail":"nicolas.s-dev@laposte.net","sentAt":"2009-03-30T04:30:09Z","receivedAt":"2009-03-30T04:30:09Z","isPatch":false,"sender":{"key":"nicolas.s-dev@laposte.net","avatar":null},"body":"\nOn Mon, Mar 30, 2009 at 06:22:26AM +0200, Nicolas Sebrecht wrote:\n> \n> \n> On Mon, Mar 30, 2009 at 11:03:28AM +0800, Aaron Davies wrote:\n> > \n> > hi, i'm new to git, and have a couple questions which are probably\n> > very stupid and/or indicate that i've been doing it wrong.\n> > \n> > first, a couple words about my setup/workflow: i'm currently sole\n> > developer on a project which may at some point get some other coders.\n> > the environment is three linux boxes, one for development and two for\n> > production, and three accounts, mine, dev, and prod. all homedirs are\n> > hosted on the network and are accessible from all three boxen.\n> > \n> > i have a \"central\" (i.e. bare) repository stored in dev's homedir, and\n> > regular copies in all three homedirs. the language involved is\n> > interpreted, so the code tree is the deployment.\n> > \n> > my main workflow is to hack on a branch in my homedir, then merge and\n> > push when i have a feature ready. then i go to the dev account and\n> > pull, which constitutes dev deployment. once it's thoroughly tested, i\n> > do the same in the prod account.\n> \n> Looks sane. \n> \n> That said, you could also work on branches (all in \"homedir\") for the\n>     'working on feature' -> testing (dev) -> ready (prod) \n> workflow.\n> \n> > now, the questions: an exception to this workflow occurred a couple\n> > months ago, when i made some urgent bugfixes that needed to move to\n> > prod before other stuff that was currently being tested in dev. this\n> > was done via cherry-picking some specific commits into prod. now, in\n> > prod, when i do \"git status\", it says \"# Your branch is ahead of\n> > 'origin/master' by 8 commits.\" is there an easy way to get rid of\n> > this?\n> \n> What I would do is working on \"TOPIC\" branches. By this way, the bare,\n> dev and prod repositories would not \"know\" of all the commits from mine\n> but only the urgent fixes.\n> \n> in \"mine\":\n> - step 1\n>     $ git checkout -b bugfixes master\n> \n> - step 2\n>     $ git cherry-pick blabla\n>     (and/or <hack, hack, hack>)\n> \n> - step 3\n>     $ git checkout master\n>     $ git merge bugfixes\n> \n> - step 4\n>     $ git push origin master:master (to the bare repo)\n> \n> - step 5\n>     $ git branch -d bugfixes\n>     $ git checkout myworking\n>     $ git rebase myworking master\n\nMy bad:\n     $ git rebase master\n\n> At step 1, we create the new bugfixes branch from master:\n>       (bugfixes)\n>      /\n> o-o-o          (master)\n>      \\\n>       a-b-c-d  (myworking)\n> \n> At step 2, we fix the bugs (cherry-picking and hack):\n>       a-c-y-z  (bugfixes)\n>      /\n> o-o-o          (master)\n>      \\\n>       a-b-c-d  (myworking)\n> \n> At step 3, we merge the urgent fixes into master:\n>       a-c-y-z  (bugfixes)\n>      /\n> o-o-o-a-c-y-z  (master)\n>      \\\n>       a-b-c-d  (myworking)\n> \n> At step 4, we push the urgent work as usual pushes.\n> At step 5, we come back to the usual work:\n> \n> o-o-o-a-c-y-z  (master)\n>              \\\n>               b'-d'  (myworking)\n\nThen, you update dev and prod as usual from bare.\n\n-- \nNicolas Sebrecht\n"}]}