Skip to content

Instantly share code, notes, and snippets.

@optedoblivion
Created May 10, 2011 23:48
Show Gist options
  • Save optedoblivion/965630 to your computer and use it in GitHub Desktop.
Save optedoblivion/965630 to your computer and use it in GitHub Desktop.
Repo Sync and Show Diff
#!/bin/bash
#
#
# repo forall -c "script.sh"
#
#
OUTPUT="$HOME/reposync.log"
echo "" > $OUTPUT
LASTHASH=$(git log --pretty=oneline|awk '{ print $1 }'| head -n 1)
git pull --rebase
HASHLIST=$(git log --pretty=oneline|awk '{print $1 }' | xargs)
echo "$HASHLIST" | while read hash;
do
if [ "$hash" == "$LASTHASH" ]; then
exit
fi
git rev-list $hash --count=1 --pretty=oneline >> $OUTPUT
done
@koush
Copy link

koush commented May 11, 2011

git rev-list github/gingerbread --count=1

@optedoblivion
Copy link
Author

thx now it can just show the logs. Someone in cm-dev wanted this, so meh.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment