[LRUG] git question

Chris Mear chrismear at gmail.com
Thu Aug 20 04:24:28 PDT 2009


On 20 Aug 2009, at 12:20, Taryn East wrote:

>
>
> 2009/8/20 Tom Stuart <tom at experthuman.com>
>> On 20 Aug 2009, at 11:59, Taryn East wrote:
>>> Every couple of days I did a git pull and rebase.
>>> I had several chunks of functionality to send in - and wanted four  
>>> separate patches but the very first of these wouldn't apply as the  
>>> code of the underlying file (ActiveResource::Validations)  had  
>>> changed, so the patch was saying that it referred to line 8 - and  
>>> line 8 no longer matched where the changes had been made.
>>>
>> This is sort of a contradiction in terms if the rebase succeeded.  
>> Your commits are by definition a set of changes on top of the  
>> remote master (assuming you're up-to-date with it) so your patches  
>> should always apply. How are you actually creating the patches?
>
> Ok, so now I'm guessing that part of the issue is that I did:
> commit, commit,commit,commit... rebase...
> then created *several* patches - the first of which only used the  
> first commit... ie didn't include the rebase.
>
> Does that make sense?
>
> So in future, I should make sure I create my patches as I go along  
> and rebase just before I create each individual patch?

No, I think this is a red herring. There's no sense in which you can  
'include the rebase' in a patch -- doing a rebase is like a global  
operation that actually rewrites your commits, and that's it. It  
doesn't add a new node in the commit history in the same way that a  
merge commit does.

My general pattern of working is: commit, commit, commit, pull and  
rebase every now and again (to make sure I'm not getting too out of  
line with what's going on upstream), commit, commit... and when I'm  
ready to release, pull-rebase-patch. That should be sufficient.

Chris




More information about the Chat mailing list