]> www.infradead.org Git - users/dedekind/aiaiai.git/commitdiff
autodetect-project: limit search to nearest annotated tag
authorJacob Keller <jacob.e.keller@intel.com>
Tue, 25 Aug 2015 23:31:22 +0000 (16:31 -0700)
committerJacob Keller <jacob.e.keller@intel.com>
Tue, 25 Aug 2015 23:31:22 +0000 (16:31 -0700)
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>
email/aiaiai-email-autodetect-project

index 6756ab741e5421af93d5ba94633b479b95e757fd..057a0dc0b92191e9bbeb1fb75e43ffb1ccd79bda 100755 (executable)
@@ -100,8 +100,10 @@ for prj in $expected_prj $(get_cfgfile_projects_list "$cfgfile"); do
        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