{"thread":{"id":"3036","subject":"Checking git-cherry-pick Use Case","startedAt":"2006-01-11T16:46:07Z","lastAt":"2006-01-11T19:29:58Z","messageCount":2,"participants":["Jon Loeliger","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"14475","messageId":"1136997967.29751.198.camel@cashmere.sps.mot.com","threadId":"3036","inReplyTo":null,"subject":"Checking git-cherry-pick Use Case","fromName":"Jon Loeliger","fromEmail":"jdl@freescale.com","sentAt":"2006-01-11T16:46:07Z","receivedAt":"2006-01-11T16:46:07Z","isPatch":false,"sender":{"key":"jdl@jdl.com","avatar":"https://gravatar.com/avatar/75ce9a10b151acd2c28ec4ab2136dba7b2ff1634530bd04b155981a749d08a64?d=mp&s=160"},"body":"Guys,\n\nCould you sanity check me on two issues with\nmy \"work flow\" here, please?  Maybe I could do\nsomething better/easier?\n\nI have a repo with a bunch of commits coming from\nseveral different places (me, co-worker, remote repo, etc).\nI'm applying co-worker's patches into \"cow\" branch.\nI'm applying my changes directly to \"jdl\" branch\"\nI'm pulling in \"origin\" crude.\n\nUltimately, I want to do development against the \"sum total\nset of all known patches supplied by anyone\".  Oh yeah.\nSo I make a \"dev\" branch that has \"cow\" + \"jdl\" + \"origin\".\n\nHowever, at the end of the development day, I want to send\njust _my_ patches upstream.  Thus, I need to have my changes\nsitting around neatly on the \"jdl\" branch.\n\nI don't want to develop in the \"jdl\" branch, as it doesn't\nhave everything needed to test stuff properly (missing \"cow\"\ncode, eg.).  So I actually edit and commit in the \"dev\"\nbranch where everything is unioned.\n\nTo isolate just my changes out of the \"dev\" branch into \nthe \"jdl\" branch, I cherry pick them like this:\n\n    $ git checkout dev\n    $     <do edit-compile-test cycle until all is well>\n    $ git commit -m \"Stuff jdl made up and committed\"\n\nNow, things look, in part, like this:\n\n        ! [dev] Stuff jdl made up and committed\n         * [jdl] Early stuff jdl made up\n          ! [origin] Original stuff\n        ---\n        +   [dev] Stuff jdl made up and committed\n        +   [dev^] Merge branch 'jdl'\n        ++  [jdl] Early stuff jdl made up\n        +++ [origin] Original stuff\n\nThen I pull that last \"dev\" commit over to \"jdl\":\n\n    $ git checkout jdl\n    $ git cherry-pick -r dev\n\nNow it looks like this:\n\n        ! [dev] Stuff jdl made up and committed\n         * [jdl] Early stuff jdl made up\n          ! [origin] Original stuff\n        ---\n         +  [jdl] Stuff jdl made up and committed\n        +   [dev] Stuff jdl made up and committed\n        +   [dev^] Merge branch 'jdl'\n        ++  [jdl^] Early stuff jdl made up\n        +++ [origin] Original stuff\n\nMy first question is that I expected to see \nsomething more like this (hand edited):\n\n\t! [dev] Stuff jdl made up and committed\n         * [jdl] Early stuff jdl made up\n          ! [origin] Original stuff\n        ---\n        ++  [dev] Stuff jdl made up and committed\n        +   [dev^] Merge branch 'jdl'\n        ++  [jdl^] Early stuff jdl made up\n        +++ [origin] Original stuff\n\nThat is, the _same_ commit is now in both the \"dev\"\nand \"jdl\" branches, so why does it have two lines here?\n\nAnd finally, the \"general\" question:  Is this a sane\nwork-flow used by anyone else?  Or is there a different\nperhaps even better way to do what I described above?\n\nThanks,\njdl\n"},{"id":"14487","messageId":"7v3bjuv9zd.fsf@assigned-by-dhcp.cox.net","threadId":"3036","inReplyTo":"1136997967.29751.198.camel@cashmere.sps.mot.com","subject":"Re: Checking git-cherry-pick Use Case","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-01-11T19:29:58Z","receivedAt":"2006-01-11T19:29:58Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jon Loeliger <jdl@freescale.com> writes:\n\n> My first question is that I expected to see \n> something more like this (hand edited):\n>\n> \t! [dev] Stuff jdl made up and committed\n>          * [jdl] Early stuff jdl made up\n>           ! [origin] Original stuff\n>         ---\n>         ++  [dev] Stuff jdl made up and committed\n>         +   [dev^] Merge branch 'jdl'\n>         ++  [jdl^] Early stuff jdl made up\n>         +++ [origin] Original stuff\n>\n> That is, the _same_ commit is now in both the \"dev\"\n> and \"jdl\" branches, so why does it have two lines here?\n\nBecause they are not the same commit; they are two separate\ncommits, that happen to have the same commit log message and\nauthorship information, and perhaps even result to show the same\n\"diff\" if asked by 1-parameter git-diff-tree, but they are\ndifferent commit objects nevertheless.\n\nFunnily enough, I think I sent out almost exactly the same\nmessage as yours the last couple of days regarding workflows,\nafter I hacked a bit on gitweb ;-).\n"}]}