This patch limits the search for patching patch-id commits to only check
commits since the most recent tag. This works well for the Linux kernel,
as we only worry about exact resubmissions of recent work, that may have
been applied before aiaiai could test it. This may not work for all
projects, and probably some sort of configurable setting should be
created.
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
branch_base="$(ini_config_get "$cfgfile" "prj_$prj" "branch_base")"
# use git-patch-id to check if the patch has already been applied the
- # branch_base and reject the patch in this case.
- for rev in $(git --git-dir="$(git_dir "$pcfg_path")" rev-list "$branch_base"); do
+ # branch_base and reject the patch in this case. To prevent searching
+ # an entire project's history, limit the search to commits since the
+ # nearest annotated tag using git-describe.
+ for rev in $(git --git-dir="$(git_dir "$pcfg_path")" rev-list "$(git describe --abbrev=0 $branch_base)".."$branch_base"); do
revid="$(git --git-dir="$(git_dir "$pcfg_path")" show $rev | git patch-id --stable | awk '{print $1}')"
# Skip revisions with no patch id