git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Carlos Martín Nieto" <cmn@elego.de>
To: Alfredo Palhares <masterkorp@masterkorp.net>
Cc: git <git@vger.kernel.org>
Subject: Re: Strange behauviour on Cherry-Pick
Date: Fri, 09 Mar 2012 18:20:12 +0100	[thread overview]
Message-ID: <1331313612.21444.46.camel@beez.lab.cmartin.tk> (raw)
In-Reply-To: <1331296972-sup-5028@masterkorp.net>

On Fri, 2012-03-09 at 15:11 +0100, Alfredo Palhares wrote:
> 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.
> 

[cherry-pick two commits from 'boobierack' into 'master']

> 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 

The master branch was untouched because you didn't tell git to do
anything with it.

>   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.

The diffs between branches don't matter when fetching, but this is only
part of what you are doing here. Pull is fetch + merge and as you
specified a remote and no branch, it took the remote's default branch,
which seems to be 'master', and merged it into your current branch. What
you show is precisely what one would expect to see. Those two commits
that you cherry-picked are on each branch (or rather, their equivalents)
and then you have a merge between that remote and branch 'boobierack'
which you were on when you told git to merge origin's default branch.

This however doesn't seem to be what you were trying to do. What were
you trying to achieve with the pull? It seems to make sense that you'd
want to merge the master branch, as you yourself said that it had
changes that would never get merged back to 'master'.

   cmn

      reply	other threads:[~2012-03-09 17:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-09 14:11 Strange behauviour on Cherry-Pick Alfredo Palhares
2012-03-09 17:20 ` Carlos Martín Nieto [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1331313612.21444.46.camel@beez.lab.cmartin.tk \
    --to=cmn@elego.de \
    --cc=git@vger.kernel.org \
    --cc=masterkorp@masterkorp.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).