From: Paul Gortmaker Date: Fri, 7 Dec 2012 00:47:18 +0000 (-0500) Subject: generate_git: fix up autoresume feature X-Git-Tag: v3.4.25-ltsi~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=980b21149775e094de73d0e776c689abcfa3c99e;p=platform%2Fkernel%2Flinux-stable.git generate_git: fix up autoresume feature The autoresume feature allows you to restart from wherever your current tree buildup last stopped (i.e. a git am fail that you have since fixed, etc.) It does this by looking for a unique upstream commit ID if there is one in the current top commit. If not, then it falls back to rummaging around in the patches for something with a matching diffstat to the top commit. This was code I borrowed from another script I wrote, in which all the patches were peers to the series file, i.e. no subdirs of patches. But the LTSI has subdirs. So teach autoresume where to find the patches. An example usage: ltsi-test$git reset --hard HEAD~4 HEAD is now at 4eddc87 codel: use u16 field instead of 31bits for rec_inv_sqrt ltsi-test$~/git/ltsi-kernel/scripts/generate_git -a resuming from current "patches.codel/codel-use-u16-field-instead-of-31bits-for-rec_inv_sq.patch" (671/674) Applying: net/codel: Add missing #include (672/674) Applying: net: codel: fix build errors (673/674) Applying: fq_codel: should use qdisc backlog as threshold (674/674) Applying: codel: refine one condition to avoid a nul rec_inv_sqrt ltsi-test$ Signed-off-by: Paul Gortmaker Signed-off-by: Greg Kroah-Hartman --- diff --git a/scripts/generate_git b/scripts/generate_git index cb1053d2ef88..9cdaf37412af 100755 --- a/scripts/generate_git +++ b/scripts/generate_git @@ -60,7 +60,7 @@ if [ -n "$AUTORESUME" ]; then DS1=`mktemp` DS2=`mktemp` git show | diffstat -p0 > $DS1 - for i in $DIR/*\.patch ; do + for i in $DIR/patches\.*/*\.patch ; do cat $i | diffstat -p0 > $DS2 cmp -s $DS1 $DS2 if [ $? = 0 ]; then @@ -85,7 +85,7 @@ if [ -n "$AUTORESUME" ]; then exit 1 fi - START=`basename $START` + START=`echo $START|sed 's/^.*patches\./patches./'` echo resuming from current \"$START\" fi