mark: A photo of Mark kneeling on top of the Taal Volcano in the Philippines. It was a long hike. (Default)
Mark Smith ([staff profile] mark) wrote in [site community profile] dw_dev2012-09-23 02:14 pm
Entry tags:

Important: Update to "dwu"

If you use the "dwu" script from the wiki, you will need to update your local copy. I've made some changes because the last version of the script would merge changes from both develop and master, leading to broken environments and GitHub repositories.

http://wiki.dwscoalition.org/wiki/index.php/Dev_Maintenance#dwu_-_Updating_the_repos

Please use the updated script.

If you have gotten yourself into a broken state, let me know and I can walk you through fixing it. There is some force pushing involved, sadly.

[personal profile] swaldman 2012-09-25 09:42 pm (UTC)(link)
If I might suggest a refinement to the new script,

I was getting irritated at always ending up on the master branch after running it. So I put

oldbranch=$(git symbolic-ref --short -q HEAD)

before each pull & push section, and

git checkout $oldbranch

after.

It seems to work for me, but I haven't updated the wiki because I suck at git and at bash scripting, and I don't want to break other peoples' hacks! In particular, it will probably do weird things if either repo has a detached HEAD.
If anybody who does know what they're doing with bash would like to refine this to do it properly, I'd be most grateful :-)