Skip to content

Instantly share code, notes, and snippets.

@Pistos
Created October 27, 2011 14:32
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Pistos/e4c9721f262005d71c0b to your computer and use it in GitHub Desktop.
Save Pistos/e4c9721f262005d71c0b to your computer and use it in GitHub Desktop.
Creates a version of Diaspora based off diaspora/master, containing other unofficial branches
pg_dump -i -o -O -U diaspora -h localhost diaspora_production | bzip2 -c > diaspora_production-`date -I`.sql.bz2
diasp0ra.ca-homepage
rename-stream
text-tweaks
comment-preview-2
view-own-profile-button
post-hint-in-notifications
reshare-link-for-already-reshared-2011-11-06
issue-2382-expand-shortened-urls
issue-2224-shorten-bare-urls
pod-neutral
hide-comments-from-ignored-3
hide-reshares-from-ignored-3
diasp0ra.ca-user-notice-2
less-jargon
redis-config-refactor-3
federation-subscription-3
maxwell--fix-photo-feature
trending-postgresql
tag-exclusions
diasp0ra.ca-error-page
vcuculo--2488-fix-oembed
rekado--show-full-post-in-single-post-view-2
import-contacts
dont-mark-unread-when-showing-dropdown
unread-button
remove-unnecessary-resque-failures
hovercard-fit-long-ids
remote-comment-and-like
show-all-comment-likers
groups
postgresql-adjustments
# diasp0ra.ca-homepage
rename-stream
text-tweaks
comment-preview-2
view-own-profile-button
post-hint-in-notifications
reshare-link-for-already-reshared-2011-11-06
issue-2382-expand-shortened-urls
issue-2224-shorten-bare-urls
pod-neutral
hide-comments-from-ignored-3
hide-reshares-from-ignored-3
# diasp0ra.ca-user-notice-2
less-jargon
redis-config-refactor-3
federation-subscription-3
maxwell--fix-photo-feature
# trending-postgresql
tag-exclusions
# diasp0ra.ca-error-page
vcuculo--2488-fix-oembed
rekado--show-full-post-in-single-post-view-2
import-contacts
dont-mark-unread-when-showing-dropdown
unread-button
remove-unnecessary-resque-failures
hovercard-fit-long-ids
remote-comment-and-like
show-all-comment-likers
groups
# postgresql-adjustments
#!/bin/bash
# Exit on any error
set -e
build_from_master=0
if [ -z "$version_root" ]; then
echo 'Please specify version_root env var. e.g. export version_root="diasp0ra.ca" # for a resultant branch like diasp0ra.ca-1.0.0'
exit 1
fi
if [ ! -s 'branches-to-merge.txt' ]; then
echo 'Could not read branches-to-merge.txt . Please list branch names in branches-to-merge.txt .'
exit 2
fi
while getopts ":m" opt; do
case $opt in
m)
build_from_master=1
;;
\?)
echo "Invalid option: -$OPTARG" >&2
;;
esac
done
# Check if working copy is dirty, or there are unstaged changes
git diff-index --quiet HEAD || ( echo 'Working copy is dirty; aborting.' && exit 3 )
if [ "$#" -ne 1 ]; then
version=`git branch | egrep "${version_root}-[0-9]" | sort | tail -n 1 | ruby -ne 'print $_[/([0-9.]+)$/, 1].succ'`
else
version=$1
fi
if [ -z "$version" ]; then
echo "Please specify the first version as an argument. e.g. ${0} 1.0.0"
exit 4
fi
version_branch="${version_root}-${version}"
echo "** Building ${version_branch}"
echo
if [ ${build_from_master} -eq 1 ]; then
# Freshen from mainline repository (Diaspora core devs)
git checkout master
git fetch diaspora
git merge --ff-only diaspora/master
fi
# Create version branch off master
git checkout -b ${version_branch}
# Merge all branches listed in branches-to-merge.txt
grep -v '#' branches-to-merge.txt | while read branchname ; do
echo
echo "----- Merging: ${branchname}"
git merge --rerere-autoupdate "${branchname}" \
|| ( git diff --quiet && git commit -m "Merge branch '${branchname}' into ${version_branch}" ) \
|| ( echo && echo '*****************' && echo "Failed to merge ${branchname}; aborting." && exit 5 )
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment