Permalink
Browse files

Added empty so dir exists

  • Loading branch information...
1 parent 46d5d91 commit c89c779e7826ff74e54be3f481eb092fd6e93741 @kvz committed Oct 8, 2009
Showing with 193 additions and 24 deletions.
  1. +1 −0 .gitignore
  2. 0 _tools/_temp/empty
  3. +48 −0 getavatars.pl
  4. +26 −0 gittydown.sh
  5. +118 −0 gittyup.sh
  6. +0 −24 up.sh
View
@@ -2,3 +2,4 @@ _tools/_temp/*
nbproject
gitup.dat
.project
+.gitup.dat
View
No changes.
View
@@ -0,0 +1,48 @@
+#!/usr/bin/perl
+#fetch Gravatars
+
+use strict;
+use warnings;
+
+use LWP::Simple;
+use Digest::MD5 qw(md5_hex);
+
+my $size = 90;
+my $output_dir = '.git/avatar';
+
+system("no .git/ directory found in current path\n") unless -d '.git';
+
+mkdir($output_dir) unless -d $output_dir;
+
+open(GITLOG, q/git log --pretty=format:"%ae|%an" |/) or die("failed to read git-log: $!\n");
+
+my %processed_authors;
+
+while(<GITLOG>) {
+ chomp;
+ my($email, $author) = split(/\|/, $_);
+
+ next if $processed_authors{$author}++;
+
+ my $author_image_file = $output_dir . '/' . $author . '.png';
+
+ #skip images we have
+ next if -e $author_image_file;
+
+ #try and fetch image
+
+ my $grav_url = "http://www.gravatar.com/avatar.php?gravatar_id=".md5_hex(lc $email)."&d=404&size=".$size;
+
+ warn "fetching image for '$author' $email ($grav_url)...\n";
+
+ my $rc = getstore($grav_url, $author_image_file);
+
+ sleep(1);
+
+ if($rc != 200) {
+ unlink($author_image_file);
+ next;
+ }
+}
+
+close GITLOG;
View
@@ -0,0 +1,26 @@
+#!/bin/bash
+git pull origin master
+git submodule status
+git submodule update --init
+
+if [ "${1}" = "-modules" ]; then
+ for mod in `git submodule status | awk '{ print $2 }'`; do
+ if [ -z "${2}" ] || [ "${2}" = "${mod}" ]; then
+ changed=0
+ echo -n "${mod} "
+ cd ${mod}
+ git pull origin master && changed=1
+ git checkout master
+ cd -
+ if [ "${changed}" -ne 1 ]; then
+ echo "not changed."
+ else
+ echo "changed. updating references"
+ git add ${mod}
+ git commit -m "Updated submodule ${mod}"
+ fi
+ fi
+ done
+
+ exit 0
+fi
View
@@ -0,0 +1,118 @@
+#!/bin/bash
+
+function capinstall {
+ if [ ! -x /var/lib/gems/1.8/bin/cap ]; then
+ echo ""
+ read -p "Capistrano not installed. Install? (Y/n)" answer
+ if [ "${answer}" = "n" ] || [ "${answer}" = "N" ]; then
+ echo ".. Skipping capistrano. Deploys not possible but you can still commit & push."
+ exit 1
+ else
+ sudo echo "Please enter password to continue"
+ sudo aptitude -y install rubygems libopenssl-ruby || exit 1
+ sudo gem sources -a http://gems.github.com/ || exit 1
+ sudo gem -v || exit 1
+ sudo gem install capistrano || exit 1
+ sudo gem install leehambley-railsless-deploy
+ echo 'export PATH=$PATH:/var/lib/gems/1.8/bin' >> ~/.bashrc
+ fi
+ echo ""
+ fi
+}
+
+function gitoptions {
+ # Change according to: https://github.com/account
+ git config --global github.user kvz
+ git config --global github.token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+
+ git config --global user.name "Kevin van Zonneveld"
+ git config --global user.email "kevin@vanzonneveld.net"
+
+ # Pretty colors
+ git config --global color.ui true
+ git config --global color.status auto
+ git config --global color.diff auto
+ git config --global color.branch auto
+ git config --global color.interactive auto
+
+ # Handy Aliases
+ git config --global alias.st status
+ git config --global alias.ci commit
+ git config --global alias.co checkout
+
+ git config --global alias.lol 'log --pretty=oneline --abbrev-commit --graph --decorate'
+}
+
+function deploy {
+ capinstall
+
+ if [ ! -f ./Capfile ]; then
+ echo "No capfile. First run: "
+ echo " capify ."
+ echo ""
+ exit 1
+ fi
+
+ if [ "${1}" = "first" ]; then
+ cap deploy:setup
+ cap deploy:check
+ cap deploy:cold
+ fi
+ cap deploy
+}
+
+
+if [ "${1}" = "-deploy" ]; then
+ if [ "${2}" = "-first" ]; then
+ deploy "first"
+ fi
+ deploy
+ exit 0
+fi
+
+echo "Comparing working directory with .git database (TAKES LONG OVER NFS/SAMBA!!) ..."
+git status
+#status=$(git status)
+#x=$(echo "${status}" | grep 'working directory clean' |wc -l)
+##for line in ${status}; do
+# echo ${line}
+#done
+#if [ ${x} -ne 0 ]; then
+# exit 0
+#fi
+if [ -z "${1}" ]; then
+ PREV_COMMENT=""
+ if [ -f ~/.gitup.dat ]; then
+ PREV_COMMENT=$(cat ~/.gitup.dat)
+ fi
+ if [ -f .gitup.dat ]; then
+ PREV_COMMENT=$(cat .gitup.dat)
+ fi
+
+ if [ ! -f .gitignore ] || [ $(cat .gitignore |grep '.gitup.dat' |wc -l) -eq 0 ]; then
+ echo '.gitup.dat' >> .gitignore
+ git add .gitignore
+ git add ${0}
+ fi
+
+ echo "You are about to commit & gitup changes"
+ echo "Press CTRL+C now if you are unsure"
+ echo ""
+
+ while [ -z "${COMMENT}" ]; do
+ read -p "Please tell me what you've done: (default is: '${PREV_COMMENT}') " COMMENT
+ [ -z "${COMMENT}" ] && [ -n "${PREV_COMMENT}" ] && COMMENT="${PREV_COMMENT}"
+ done
+else
+ if [ -n "${21}" ]; then
+ echo "20 Words Max"
+ exit 1
+ fi
+ COMMENT="${1} ${2} ${3} ${4} ${5} ${6} ${7} ${8} ${9} ${10} ${11} ${12} ${13} ${14} ${15} ${16} ${17} ${18} ${19} ${20}"
+fi
+echo "${COMMENT}" > .gitup.dat
+echo "${COMMENT}" > ~/.gitup.dat
+
+echo "Committing: ${COMMENT}..."
+git commit -a -m "${COMMENT}" && git push origin master
+
View
24 up.sh
@@ -1,24 +0,0 @@
-#!/bin/bash
-if [ -z "${1}" ]; then
- PREV_COMMENT=""
- [ -f gitup.dat ] && PREV_COMMENT=$(cat gitup.dat)
-
- echo "You are about to commit & gitup changes"
- echo "Press CTRL+C now if you are unsure"
- echo ""
-
- while [ -z "${COMMENT}" ]; do
- read -p "Please tell me what you've done: (default is: '${PREV_COMMENT}') " COMMENT
- [ -z "${COMMENT}" ] && [ -n "${PREV_COMMENT}" ] && COMMENT="${PREV_COMMENT}"
- done
-else
- if [ -n "${21}" ]; then
- echo "20 Words Max"
- exit 1
- fi
- COMMENT="${1} ${2} ${3} ${4} ${5} ${6} ${7} ${8} ${9} ${10} ${11} ${12} ${13} ${14} ${15} ${16} ${17} ${18} ${19} ${20}"
-fi
-echo "${COMMENT}" > gitup.dat
-
-echo "Committing: ${COMMENT}..."
-git commit -a -m "${COMMENT}" && git push

0 comments on commit c89c779

Please sign in to comment.