[PATCH aiaiai 7/9] aiaiai: don't display log output from git-find-base

Jacob Keller jacob.e.keller at intel.com
Wed Apr 9 15:26:11 PDT 2014


git-find-base outputs a large amount of data, given the number of
projects in a cfgfile. This can cause systemd to overload with too much
information. This patch alleviates the issue by only displaying the
output of git-find-base if it fails.

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

diff --git a/email/aiaiai-email-autodetect-project b/email/aiaiai-email-autodetect-project
index 7be707b304b4..aee5a7c74e6a 100755
--- a/email/aiaiai-email-autodetect-project
+++ b/email/aiaiai-email-autodetect-project
@@ -69,6 +69,7 @@ parse_config "$cfgfile"
 
 # Create a temporary directory for storage of any files we might need
 tmpdir="$(mktemp --tmpdir="$cfg_workdir" -dt "$PROG.XXXX")"
+tmp_find_base="$tmpdir/git-find-base.out"
 
 # Get the expected project from the patch email
 to="$(fetch_header "To" < "$mbox")"
@@ -100,7 +101,7 @@ for prj in $expected_prj $(get_cfgfile_projects_list "$cfgfile"); do
 	# supplied, otherwise use the parent(s) of pcfg_branch as the limiter.
 	# This enables only checking a small range instead of having to check
 	# the full history.
-	commit="$(git --git-dir="$(git_dir "$pcfg_path")" find-base "$pcfg_branch" "${branch_base:-$pcfg_branch}^!" < "$mbox" \
+	commit="$(git --git-dir="$(git_dir "$pcfg_path")" find-base "$pcfg_branch" "${branch_base:-$pcfg_branch}^!" 2>>"$tmp_find_base" < "$mbox" \
 		|| verbose "No matching base commit in project $prj" )"
 
 	# Break out of loop once we find a base
@@ -117,6 +118,10 @@ if [ -n "$commit" ]; then
 	printf "%s\n" "X-Aiaiai-Commit: $commit"
 else
 	if [ -z "$expected_prj" ]; then
+
+	verbose "No project found. Output of git-find-base:"
+	cat "$tmp_find_base" 1>&2
+
 	cat <<EOF
 Aiaiai was unable to correctly determine the project for your patch submission.
 Normally the diff index information provided by git's diff mechanism is enough.
-- 
1.8.3.1




More information about the aiaiai mailing list