{"thread":{"id":"29895","subject":"Strange behauviour on Cherry-Pick","startedAt":"2012-03-09T14:11:54Z","lastAt":"2012-03-09T17:20:12Z","messageCount":2,"participants":["Alfredo Palhares","Carlos Martín Nieto"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"186565","messageId":"1331296972-sup-5028@masterkorp.net","threadId":"29895","inReplyTo":null,"subject":"Strange behauviour on Cherry-Pick","fromName":"Alfredo Palhares","fromEmail":"masterkorp@masterkorp.net","sentAt":"2012-03-09T14:11:54Z","receivedAt":"2012-03-09T14:11:54Z","isPatch":false,"sender":{"key":"masterkorp@masterkorp.net","avatar":null},"body":"Hello, \n\nI have a repository[1] with my home files that i keep track off on my machines. \nUntil now ive been having everything in the same branch across all the computers, \nbut now i have a machine that requires diferences on some files.\n\nSo what i did i branched out and keep control the commits i want to the other branch\ntrough cherry-picking.\n\nSo there's how i did it.\n\n  Create the new branch\n  $ git checkout -b boobierack \n  Start by removing files i dont need in this machine (one of the reasons  i will not merge this branch)\n  $ git rm files\n  $ git commit -m \"remove files\"\n  Now editing things i only need here\n  $ vim file\n  $ git commit -m \"Edit file to feature X work in this machine\"\n  Now i have some sweet weechat configs in this machine i want to committ\n  $ git add .weecchat/conffiles\n  $ git commit -m \"Add swet weechat configs\"\n  I also added tmux\n  ...\n  Now i added some sup config files i only need in this branch\n  $ git add .sup/whateves\n  $ git commit -m \"Add sup configs\"\n  Push branch up\n  $ git push origin boobierack\n\nOn another computer:\n  I wanted that tmux config but i didn't want to merge the branch, so i cherry picked the commit \n  (Maybe this is not the best way to this use case, if so i am open to sugestions, but keep reading\n  because i want to know why this is happening ) \n  Since cherry pick gets the diff introduced by that commit, i think using it woulbe nice.\n  $ git pull origin\n  On branch master\n  $ git cherry-pick refspectotmuxcommit\n  Maybe those weechat config would be handy in another computers\n  $ git cherry-pick refscectoweechatconfigs\n  Pushed the commits\n  $ git push origin\n  Everything seemed ok both on master[2] and boobierack[3] branches\n\nBack to the boobierack machine:\n  Pull the commits before adding more stuff\n  $ git pull origin \n  remote: Counting objects: 20, done.\n  remote: Compressing objects: 100% (13/13), done.\n  remote: Total 18 (delta 2), reused 18 (delta 2)\n  Unpacking objects: 100% (18/18), done.\n  From github.com:masterkorp/Home-files\n   * branch            HEAD       -> FETCH_HEAD\n   Merge made by recursive.\n\n  I got like... OK ? \n  On branh boobierack\n  $ git log --pretty=format:'''%h : %s''' --date-order --graph -n 6\n  *   4d7b2e8 : Merge github.com:masterkorp/Home-files into boobierack\n  |\\  \n  | * 9937a0a : Fancier tmux\n  * | 811355b : Add sup config files\n  * | 9de92a2 : Fancier tmux\n  | * aac85ac : Add weechat config files\n  * | 90a6162 : Add weechat config files\n\n  And master branch was untouched, i read on recursive merging on man page, but \n  i can't even understand why is git using that method in the first place, since \n  the hashes are diferent and git doesn't care about the diff when fetching iirc.\n\n  Any help would be deeply apreciated.\n\n[1] https://github.com/masterkorp/Home-files\n[2] https://github.com/masterkorp/Home-files/commits/master\n[3] https://github.com/masterkorp/Home-files/commits/boobierack\n\n--\nRegards, \nAlfredo Palhares\n"},{"id":"186573","messageId":"1331313612.21444.46.camel@beez.lab.cmartin.tk","threadId":"29895","inReplyTo":"1331296972-sup-5028@masterkorp.net","subject":"Re: Strange behauviour on Cherry-Pick","fromName":"Carlos Martín Nieto","fromEmail":"cmn@elego.de","sentAt":"2012-03-09T17:20:12Z","receivedAt":"2012-03-09T17:20:12Z","isPatch":false,"sender":{"key":"cmn@elego.de","avatar":"https://avatars.githubusercontent.com/u/335443?v=4"},"body":"On Fri, 2012-03-09 at 15:11 +0100, Alfredo Palhares wrote:\n> Hello, \n> \n> I have a repository[1] with my home files that i keep track off on my machines. \n> Until now ive been having everything in the same branch across all the computers, \n> but now i have a machine that requires diferences on some files.\n> \n> So what i did i branched out and keep control the commits i want to the other branch\n> trough cherry-picking.\n> \n\n[cherry-pick two commits from 'boobierack' into 'master']\n\n> Back to the boobierack machine:\n>   Pull the commits before adding more stuff\n>   $ git pull origin \n>   remote: Counting objects: 20, done.\n>   remote: Compressing objects: 100% (13/13), done.\n>   remote: Total 18 (delta 2), reused 18 (delta 2)\n>   Unpacking objects: 100% (18/18), done.\n>   From github.com:masterkorp/Home-files\n>    * branch            HEAD       -> FETCH_HEAD\n>    Merge made by recursive.\n> \n>   I got like... OK ? \n>   On branh boobierack\n>   $ git log --pretty=format:'''%h : %s''' --date-order --graph -n 6\n>   *   4d7b2e8 : Merge github.com:masterkorp/Home-files into boobierack\n>   |\\  \n>   | * 9937a0a : Fancier tmux\n>   * | 811355b : Add sup config files\n>   * | 9de92a2 : Fancier tmux\n>   | * aac85ac : Add weechat config files\n>   * | 90a6162 : Add weechat config files\n> \n>   And master branch was untouched, i read on recursive merging on man page, but \n\nThe master branch was untouched because you didn't tell git to do\nanything with it.\n\n>   i can't even understand why is git using that method in the first place, since \n>   the hashes are diferent and git doesn't care about the diff when fetching iirc.\n\nThe diffs between branches don't matter when fetching, but this is only\npart of what you are doing here. Pull is fetch + merge and as you\nspecified a remote and no branch, it took the remote's default branch,\nwhich seems to be 'master', and merged it into your current branch. What\nyou show is precisely what one would expect to see. Those two commits\nthat you cherry-picked are on each branch (or rather, their equivalents)\nand then you have a merge between that remote and branch 'boobierack'\nwhich you were on when you told git to merge origin's default branch.\n\nThis however doesn't seem to be what you were trying to do. What were\nyou trying to achieve with the pull? It seems to make sense that you'd\nwant to merge the master branch, as you yourself said that it had\nchanges that would never get merged back to 'master'.\n\n   cmn\n"}]}