generate_git: fix up autoresume feature
authorPaul Gortmaker <paul.gortmaker@windriver.com>
Fri, 7 Dec 2012 00:47:18 +0000 (19:47 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Dec 2012 17:23:24 +0000 (09:23 -0800)
commit980b21149775e094de73d0e776c689abcfa3c99e
tree6b17e317fecc4aabd71766c25e1c83074f6aa9a4
parent32d2fedfad1b1fe5133dbea05580aabc47b4cfb9
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 <linux/prefetch.h>
  (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 <paul.gortmaker@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
scripts/generate_git