From 980b21149775e094de73d0e776c689abcfa3c99e Mon Sep 17 00:00:00 2001 From: Paul Gortmaker Date: Thu, 6 Dec 2012 19:47:18 -0500 Subject: [PATCH] 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 --- scripts/generate_git | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 -- 2.34.1