Skip to content

Instantly share code, notes, and snippets.

@idlecool
Created August 29, 2011 21:25
Show Gist options
  • Save idlecool/1179450 to your computer and use it in GitHub Desktop.
Save idlecool/1179450 to your computer and use it in GitHub Desktop.
Zips diff files for GSoC code submission
#!/bin/bash
# Author: Shiv Deepak <idlecool@gmail.com>
# Bazaar GSoC Zipper
# I basically wrote this script to generate diff files for my project
# from parent banch (which is `vita` for me ), for most of you it will
# be `trunk`, just get a fresh copy of trunk and run this script inside it.
# Ex:
#
# Step 1: Get a fresh copy of trunk
# $ bzr branch lp:sahana-eden eden
# $ cd eden
#
# Step 2: Move this script into the trunk
# $ mv ~/Downloads/bzr-gsoc-zipper.sh .
#
# Step 3: Just modify variables `revisions`, `branch`, `student_name`
# $ emacs bzr-gsoc-zipper.sh
#
# Step 4: execute the script
# $ bash bzr-gsoc-zipper.sh
#
# Step 5: Save the tarball and cleanup
# $ cp Given_Name_Surname.tar.gz ~/
# $ rm bzr-gsoc-zipper.sh*
#
# > Enter Your Revisions
revisions=( 1583 1663 1664 1665 1716 1718 1746 1773 1824 1840 )
# > Enter Branch Name
branch="trunk"
# > Enter Student Name from melange profile
student_name="Given_Name_Surname"
dirname=$student_name
mkdir $dirname
for each_revision in ${revisions[@]}
do
previous_revision=$(($each_revision-1))
bzr diff -r$previous_revision..$each_revision > $dirname/$branch-r$each_revision.txt
done
tar -pczf $student_name.tar.gz $dirname
rm -rf $dirname
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment