pre-upload: allow different --rerun-since argument interpretations

When passing the --rerun-since command line option, date is not the
easiest to specify time limit when trying to determine how many
patches should be checked.

Let's allow specifying different arguments to this command line
option, adding sha1 of an existing patch and number of patches to

The following heuristics are used: if the value is shorter than 3
symbols, it must be the number of patches to check. If the value has
dashes in it, it must be a date. Otherwise it must be a SHA1.

TEST=verified that --rerun-since properly checks patches
     with any of all three formats.

Change-Id: I4a9383e820fa1c74fb7d26241d82495233d68969
Signed-off-by: Vadim Bendebury <>
Reviewed-by: Mike Frysinger <>
1 file changed