Magellan Linux

Annotation of /trunk/pkgtools/git-get-patches.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2114 - (hide annotations) (download) (as text)
Mon May 13 11:44:18 2013 UTC (11 years ago) by niro
File MIME type: application/x-sh
File size: 430 byte(s)
-added git patches script
1 niro 2114 #!/bin/bash
2    
3     die() { echo "Error: $@"; exit 1; }
4    
5     SINCE="$1"
6     [[ -z ${SINCE} ]] && die "missing param SINCE"
7     PATCH_DIR="./patches"
8    
9     [[ ! -d ${PATCH_DIR} ]] && install -d ${PATCH_DIR}
10    
11     commit_list=( $(git log --since "${SINCE}" -p --reverse | grep '^commit' | sed 's:commit\ \(.*\):\1:') )
12    
13     count="${#commit_list[*]}"
14     for (( i=0; i<count;i++))
15     do
16     git show "${commit_list[${i}]}" > ${PATCH_DIR}/"${i}-${commit_list[$i]}.patch"
17     done