aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/misc/sync-gist.sh
blob: 86cca0413ea03dcea916045912a8f01af114c55f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#! /bin/bash

set -o pipefail
set -e

repo=~/gist/b0d2e7e67aa50298fdf8111ae7466b56

while read -r commit; do

  cd $repo
  git checkout $commit
  message="$(git show $commit | sed -n '1,4 d; /^diff/ q; s/^    //p')"

  cd ~/git/Bash-Snippets
  cp $repo/gist gist/gist
  git add gist/gist && git commit -m "$message" || true
done

cd $repo
git checkout master