From: Jacob Keller Date: Tue, 25 Aug 2015 23:31:22 +0000 (-0700) Subject: autodetect-project: limit search to nearest annotated tag X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=111034f1b9c7f5065dab8029d69ec42bbb4cc90d;p=users%2Fdedekind%2Faiaiai.git autodetect-project: limit search to nearest annotated tag 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 --- diff --git a/email/aiaiai-email-autodetect-project b/email/aiaiai-email-autodetect-project index 6756ab7..057a0dc 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