Skip to content
mark-young-atg edited this page Jan 6, 2025 · 6 revisions

Welcome to the geocoder wiki!

This is a fork of alexreisner/geocoder which has been customised to utilise the provider getAddress().

The master branch here tracks the upstream repository. sm-web customisations live in a branch named after the upstream release and the Jira ticket, e.g get_address_1.8.2-sma1970 and get_address_1.8.4-msma3589

To get setup initially

git clone git@github.com:salesmaster/geocoder.git
cd geocoder
git remote add upstream https://github.com/alexreisner/geocoder.git
git fetch --all

When a new version of geocoder is released the following steps can be used to prepare a new customised branch. The steps below demonstrate the branch names used when upgrading from v1.8.4 to v1.8.5. Next time 1.8.5 will be the branch to checkout and whatever the new version is will be used in the new branch name.

git merge upstream/master
git fetch upstream --tags
git checkout get_address_1.8.4-msma3589
git checkout -b get_address_1.8.5_msma3630
git rebase v1.8.5
git push --set-upstream origin get_address_1.8.5_msma3630

NOTES to reflect on.

I found that git rebase v1.8.2 threw up some challenging merges that were difficult to understand, so I used an alternate approach. I did the following

git checkout get_address_1.8.1-sm950
git checkout -b get_address_1.8.2-smXXX
git cherry-pick v1.8.1..v1.8.2

This repeated failed with messages such as

error: commit be846b8090fc0f33cb8bb3c0ea5f91912a200c66 is a merge but no -m option was given. fatal: cherry-pick failed

Which I ignored and repeatedly ran git cherry-pick --continue, at the end of which the diff between v1.8.1 and get_address_1.8.1-sm950 was basically the same as the diff between v1.8.2 and get_address_1.8.2-sma1970. I looked at the files changed in one of the merge commits and found that the same changes were present in my branch version of that file.

In hindsight the challenges of the git rebase v1.8.2 were solved by using 'Accept Theirs' in RubyMine, or keeping what was in the HEAD portion of the conflicts in the files.

Post rebase confirmation

Used the following steps to confirm the differences between the upstream v1.8.1 & v1.8.2 and our customised branch were the same, except for the commit numbers.

git diff v1.8.1 v1.8.2 > /tmp/gd_upstream_1812
git diff get_address_1.8.1-sm950 get_address_1.8.2-sma1970 > /tmp/gd_our_1812
diff /tmp/gd_upstream_1812 /tmp/gd_our_1812

In this case the only difference was in file lib/geocoder/lookup.rb which was changed in both branches and so the difference was expected.

A similar check can be performed from a different perspective

git diff v1.8.1 get_address_1.8.1-sm950 > /tmp/gd_181
git diff v1.8.2 get_address_1.8.2-sma1970 > /tmp/gd_182
vimdiff /tmp/gd_18[12]

Clone this wiki locally