git more for personal projects and recently I came across a process hurdle that didn’t seem to have a simple solution:
git hosted as a private repo at GitHubdevelopment branchdevelopment contains many commits that we don’t want in master because of the differences between production and development environmentsdevelopment also contains code we don’t want to release yetmasterAll in all, it felt like this should be simple, right, surely I can just git checkout master && git merge development {path_to_folder_containing_code} right … well not really.
After a lot of searching around it seemed that the recommendation in general in our situation was to just “copy the changes files into a checkout of master and commit them”. I really didn’t want to do this because loosing direct attribution was a no go – yes we could review the branch history to work out who did what but I believe that everyone who participated should get attribution via their GitHub profile activity graph.
More searching led to a second option, which also sounded very painful, we could use git cherry-pick and cherry pick every single individual commit over into master. This ticked all of the boxes as far as what I wanted to achieve and the only downside was going to be the manual work of cherry picking.. it didn’t feel like it was going to be fun and certainly wasn’t going to be sustainable as we iterated further on the code.
So I set out to see if I could come up with a “simple” was to automate this process and so the following script was born:
#!/usr/bin/env bash -l #args - from-branch to-branch path FROMBRANCH=$1 TOBRANCH=$2 REPOPATH=$3 INIT=$4 git fetch git checkout $FROMBRANCH git pull git checkout $TOBRANCH git pull git checkout $FROMBRANCH if [[ 'init' = $INIT ]]; then COMMAND="git log --format="%H" --reverse --cherry-pick --no-merges $TOBRANCH..$FROMBRANCH $REPOPATH" else COMMAND="git log --after=`git log $TOBRANCH -n 1 --format="%aI"` --format="%H" --reverse --cherry-pick --no-merges $TOBRANCH..$FROMBRANCH $REPOPATH" fi CHERRIES=$(eval $COMMAND) git checkout $TOBRANCH for CHERRY in $CHERRIES do git cherry-pick --ff $CHERRY done
Basically this:
The script has two modes based on whether or not you have already existing code in the target location (if you don’t you pass the extra init argument to tell it to replay all the history).
Example usage: ~/bin/git-merge-path-from-branch-to-branch.sh development staging {path/to/folder}
This will merge everything over to a staging branch which can then be used to generate a pull request against master.
So far this has been working really well for us, the only time it has had issues are when someone makes changes to master outside of working in development first because then we end up with the wrong “last merge date” detection in the script.
This year I decided I wanted to branch out a little further and learn the basics of using the new sewing machine we purchased after moving house – finding ready-made curtains to hang on 8ft high windows is tricky and so we recruited help from my mother-in-law to sew extra fabric onto the bottom of the ones we found so they hang long enough, and for that we needed a sewing machine. I spent some time with my mother learning the basics on her machine but really I learn best by doing so I thought it was time to find a small project/class that would help me feel more confident. After thinking about what would make a good first project and the kind of things that I was most likely to want to make going forward I settled on the idea of finding an introductory quilting class. I have always found quilts fascinating, they make great gifts and they are also a great way to personalise your own home.
After a lot of searching, it turns out a lot of classes expect you to want to go big or go home, I finally settled on a 3 hour class run by a local fabric store with its own sewing studio and knitting lounge. The class was great fun and very accessible even for someone who has bared touched a sewing machine and only knows the basics. Aurora is a great teacher and had everything all setup ready for us to dive in with material to pick from all laid out on the table. As you can see from the photos below things progressed pretty easily over the 3 hour period and it was great to just be creative and not think about all the day-to-day stresses.
The only question now is…. what next?
]]>
]]>
]]>So, for this first foray I’ve settled on a fairly simple setup – Canon 7D with a 12mm Kenko Extension Tube and the EF 50mm f1/8 II. For the second two shots I also brought my trusty 580EX II into the mix because there wasn’t enough light in the kitchen to get any good shots otherwise. The shallow depth of field and narrow distance window at which the lens will focus in this setup make taking these photos a challenge.
I really love how the shallow depth of field in the first image really draws you into the Kingfishers eye while the background just blurs away.

The other two photos that I want to share from this experiment come from a recent days baking. These rocky piles of sugar have a magical sparkle, maybe they can be mined for diamonds ;).

This close up of the brownies came out really well. I love the bokeh and shallow depth of field.

Everything was captured using my Canon 7D and 16-35 f/4 IS L pairing and processed from RAW using Aperture.
]]>
]]>
]]>
]]>