[git-users] Re: There may be a mistake in book Pro Git about rebase

2015-04-21 Thread Thomas Ferris Nicolaisen
On Tuesday, April 21, 2015 at 2:04:40 PM UTC+2, Deew Lew wrote:

 chapter 3.6 :Git Branching - Rebasing 


For the record, the URL 
is http://git-scm.com/book/en/v2/Git-Branching-Rebasing
 


 the book says:

 This basically says, “Check out the client branch, figure out the patches 
 from the common ancestor of the client and server branches, and then 
 replay them onto master.”

 I think then replay them onto master  should be then replay them onto 
 client start from the common ancestor patch of the client server and 
 master ?

 I test like this: 
 three branches: master server client 
 master:c0
 server:c0 - c1 - c4 - c5
 client:c0 - c1 - c2 - c3
 then i did : 
 git rebase --onto master server client 
 the three branches were:
 master:c0
 server:c0 - c1 - c4 - c5
 client:c0 - c2 - c3

 See it ,the client branch changed , not the master !

 And i'm weak at English, maybe original is right . And the problem is my 
 understanding :) 


Your understanding is correct, but I don't think your sentence reads so 
well. I agree with you that the sentence in the book does not sound optimal 
either. Here's what I would write:

Original:

 This basically says, “Check out the client branch, figure out the patches 
 from the common ancestor of the client and server branches, and then replay 
 them onto master.” 


Suggestion:

 This basically says, “Take the client branch, figure out the patches since 
 it diverged from the master branch, and replay these patches in the client 
 branch as if it was based directly off the master branch instead. In other 
 words: transplant the client branch to be based off the master branch 
 instead of server. 


If you want to suggest concrete changes to the book, the right way to go 
about is by submitting pull-requests on its GitHub repository. The file in 
question is located here, so you can just use the Edit button to suggest 
the change:

https://github.com/progit/progit2/blob/master/book/03-git-branching/sections/rebasing.asc

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] Re: There may be a mistake in book Pro Git about rebase

2015-04-21 Thread Konstantin Khomoutov
On Tue, 21 Apr 2015 06:08:46 -0700 (PDT)
Thomas Ferris Nicolaisen tfn...@gmail.com wrote:

[...]
 Your understanding is correct, but I don't think your sentence reads
 so well. I agree with you that the sentence in the book does not
 sound optimal either. Here's what I would write:
 
 Original:
 
  This basically says, “Check out the client branch, figure out the
  patches from the common ancestor of the client and server branches,
  and then replay them onto master.” 
 
 
 Suggestion:
 
  This basically says, “Take the client branch, figure out the
  patches since it diverged from the master branch, and replay these
  patches in the client branch as if it was based directly off the
  master branch instead. In other words: transplant the client
  branch to be based off the master branch instead of server.

I like your version much better!

By the way, in the hope to be useful to the OP, here's my attempt to
explain to someone the difference between cherry-picking and rebasing
[1] which extensively touches on how rebasing replays commits on a
branch which that branch has on top of where it's being rebased onto.
It uses the pictures from the book being discussed. ;-)

1. http://stackoverflow.com/a/11837630/720999

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[git-users] Re: There may be a mistake in book Pro Git about rebase

2015-04-21 Thread Deew Lew

Yeah , thanks for your reply ! 

Sorry for forgot give the URL : ) 

 

On Tuesday, April 21, 2015 at 9:08:46 PM UTC+8, Thomas Ferris Nicolaisen 
wrote:

 On Tuesday, April 21, 2015 at 2:04:40 PM UTC+2, Deew Lew wrote:

 chapter 3.6 :Git Branching - Rebasing 


 For the record, the URL is 
 http://git-scm.com/book/en/v2/Git-Branching-Rebasing
  


 the book says:

 This basically says, “Check out the client branch, figure out the patches 
 from the common ancestor of the client and server branches, and then 
 replay them onto master.”

 I think then replay them onto master  should be then replay them onto 
 client start from the common ancestor patch of the client server and 
 master ?

 I test like this: 
 three branches: master server client 
 master:c0
 server:c0 - c1 - c4 - c5
 client:c0 - c1 - c2 - c3
 then i did : 
 git rebase --onto master server client 
 the three branches were:
 master:c0
 server:c0 - c1 - c4 - c5
 client:c0 - c2 - c3

 See it ,the client branch changed , not the master !

 And i'm weak at English, maybe original is right . And the problem is my 
 understanding :) 


 Your understanding is correct, but I don't think your sentence reads so 
 well. I agree with you that the sentence in the book does not sound optimal 
 either. Here's what I would write:

 Original:

 This basically says, “Check out the client branch, figure out the patches 
 from the common ancestor of the client and server branches, and then replay 
 them onto master.” 


 Suggestion:

 This basically says, “Take the client branch, figure out the patches 
 since it diverged from the master branch, and replay these patches in the 
 client branch as if it was based directly off the master branch instead. 
 In other words: transplant the client branch to be based off the master 
 branch instead of server. 


 If you want to suggest concrete changes to the book, the right way to go 
 about is by submitting pull-requests on its GitHub repository. The file in 
 question is located here, so you can just use the Edit button to suggest 
 the change:


 https://github.com/progit/progit2/blob/master/book/03-git-branching/sections/rebasing.asc



-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.