[LRUG] git question

Chris Mear chrismear at gmail.com
Thu Aug 20 04:32:19 PDT 2009


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

>
>
> 2009/8/20 Tom Stuart <tom at experthuman.com>
>> How are you actually creating the patches?
>
> oh - and I tried several ways to make the patches...
> What I had expected to find was that somebody would have nicely made  
> it possible to use gitk and go "I want that commit, and that commit  
> and that one... now go make me a patch" ;)
>
> Unfortunately nobody had done that for me (damn!), so I had to  
> fiddle with SHA1 ids and since/until and --committer to pull out my  
> commits
>
> thinking about that a little more - it's entirely possible that the  
> patches I created completely ignored the merge/rebases I did...
>
> not to mention that I found out the hard way that "since..until" is  
> non-inclusive :P
>
> I think I used "git-log -p" to actually make the patch as it seemed  
> the easiest to actually pull out what I wanted... after have read  
> through reams of man-pages on the various git-commands and several  
> tutorials... this all seems way less easy that just an svn-diff :P


Yes, it is way less easy if you're putting yourself in a situation  
where you've having to cherry-pick individual commits to put into a  
patch. You really, really want to set things up so that all your  
related commits are in a branch by themselves, off master. Not only  
does that make it easier to keep track of things while you're working  
on a feature (or multiple features on multiple branches), it also  
means you can get a patch for those commits just by doing:

git format-patch master --stdout > your-patch-file.diff

If you can explain why you needed to pull out individual commits and  
combine them into a patch, then we can suggest ways you can reorganise  
your branches to make this easier in future.

Chris




More information about the Chat mailing list