[aiaiai] autodetect-project: limit search to nearest annotated tag

Jacob Keller jacob.e.keller at intel.com
Wed Aug 26 03:50:43 PDT 2015

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

Signed-off-by: Jacob Keller <jacob.e.keller at intel.com>
 email/aiaiai-email-autodetect-project | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/email/aiaiai-email-autodetect-project b/email/aiaiai-email-autodetect-project
index 6756ab741e54..057a0dc0b921 100755
--- a/email/aiaiai-email-autodetect-project
+++ b/email/aiaiai-email-autodetect-project
@@ -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

More information about the aiaiai mailing list