git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Strange behauviour on Cherry-Pick

From
APAlfredo Palhares <masterkorp@masterkorp.net>
Date
Mar 9, 2012, 14:11 UTC
Message-ID
<1331296972-sup-5028@masterkorp.net>
Hello, 

I have a repository[1] with my home files that i keep track off on my machines. Until now ive been having everything in the same branch across all the computers, but now i have a machine that requires diferences on some files.

So what i did i branched out and keep control the commits i want to the other branch trough cherry-picking.

So there's how i did it.
  Create the new branch
  $ git checkout -b boobierack 
  Start by removing files i dont need in this machine (one of the reasons  i will not merge this branch)
  $ git rm files
  $ git commit -m "remove files"
  Now editing things i only need here
  $ vim file
  $ git commit -m "Edit file to feature X work in this machine"
  Now i have some sweet weechat configs in this machine i want to committ
  $ git add .weecchat/conffiles
  $ git commit -m "Add swet weechat configs"
  I also added tmux
  ...
  Now i added some sup config files i only need in this branch
  $ git add .sup/whateves
  $ git commit -m "Add sup configs"
  Push branch up
  $ git push origin boobierack
On another computer:
  I wanted that tmux config but i didn't want to merge the branch, so i cherry picked the commit 
  (Maybe this is not the best way to this use case, if so i am open to sugestions, but keep reading
  because i want to know why this is happening ) 
  Since cherry pick gets the diff introduced by that commit, i think using it woulbe nice.
  $ git pull origin
  On branch master
  $ git cherry-pick refspectotmuxcommit
  Maybe those weechat config would be handy in another computers
  $ git cherry-pick refscectoweechatconfigs
  Pushed the commits
  $ git push origin
  Everything seemed ok both on master[2] and boobierack[3] branches
Back to the boobierack machine:
  Pull the commits before adding more stuff
  $ git pull origin 
  remote: Counting objects: 20, done.
  remote: Compressing objects: 100% (13/13), done.
  remote: Total 18 (delta 2), reused 18 (delta 2)
  Unpacking objects: 100% (18/18), done.
  From github.com:masterkorp/Home-files
   * branch            HEAD       -> FETCH_HEAD
   Merge made by recursive.
  I got like... OK ? 
  On branh boobierack
  $ git log --pretty=format:'''%h : %s''' --date-order --graph -n 6
  *   4d7b2e8 : Merge github.com:masterkorp/Home-files into boobierack
  |\  
  | * 9937a0a : Fancier tmux
  * | 811355b : Add sup config files
  * | 9de92a2 : Fancier tmux
  | * aac85ac : Add weechat config files
  * | 90a6162 : Add weechat config files
  And master branch was untouched, i read on recursive merging on man page, but 
  i can't even understand why is git using that method in the first place, since 
  the hashes are diferent and git doesn't care about the diff when fetching iirc.
  Any help would be deeply apreciated.

[1] https://github.com/masterkorp/Home-files [2] https://github.com/masterkorp/Home-files/commits/master [3] https://github.com/masterkorp/Home-files/commits/boobierack

-- Regards, Alfredo Palhares

Next: Carlos Martín Nieto
Message 1 of 2 in “Strange behauviour on Cherry-Pick”
  1. Alfredo PalharesMar 9, 2012
  2. Carlos Martín NietoMar 9, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.