]> www.infradead.org Git - users/dedekind/aiaiai.git/commitdiff
aiaiai: don't display log output from git-find-base
authorJacob Keller <jacob.e.keller@intel.com>
Wed, 9 Apr 2014 22:26:11 +0000 (15:26 -0700)
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Sat, 26 Apr 2014 00:29:22 +0000 (17:29 -0700)
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@intel.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
email/aiaiai-email-autodetect-project

index 7be707b304b44caa755b1d8954fdacb941ec957c..aee5a7c74e6a683eaec404dbfb0fa7703969da3f 100755 (executable)
@@ -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.