You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@aurora.apache.org by wf...@apache.org on 2014/10/25 01:26:53 UTC

git commit: Allow the invoker to ignore patterns in git-clean.

Repository: incubator-aurora
Updated Branches:
  refs/heads/master 3ad0c5fb1 -> 3778330cd


Allow the invoker to ignore patterns in git-clean.

Reviewed at https://reviews.apache.org/r/27181/


Project: http://git-wip-us.apache.org/repos/asf/incubator-aurora/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-aurora/commit/3778330c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-aurora/tree/3778330c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-aurora/diff/3778330c

Branch: refs/heads/master
Commit: 3778330cd37bc8b96907654b496c15152dfecea7
Parents: 3ad0c5f
Author: Bill Farner <wf...@apache.org>
Authored: Fri Oct 24 16:26:07 2014 -0700
Committer: Bill Farner <wf...@apache.org>
Committed: Fri Oct 24 16:26:43 2014 -0700

----------------------------------------------------------------------
 build-support/jenkins/review_feedback.py | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/3778330c/build-support/jenkins/review_feedback.py
----------------------------------------------------------------------
diff --git a/build-support/jenkins/review_feedback.py b/build-support/jenkins/review_feedback.py
index 049f2ce..9d22358 100755
--- a/build-support/jenkins/review_feedback.py
+++ b/build-support/jenkins/review_feedback.py
@@ -56,8 +56,8 @@ class PatchApplyError(Exception):
   pass
 
 
-def _apply_patch(patch_data):
-  subprocess.check_call(['git', 'clean', '-fdx'])
+def _apply_patch(patch_data, clean_excludes):
+  subprocess.check_call(['git', 'clean', '-fdx'] + ['--exclude=%s' % e for e in clean_excludes])
   subprocess.check_call(['git', 'reset', '--hard', 'origin/master'])
 
   patch_file = 'diff.patch'
@@ -86,28 +86,28 @@ def main():
   parser = argparse.ArgumentParser()
   parser.add_argument('--server', dest='server', help='Review Board server.', required=True)
   parser.add_argument(
-      '--reviewboard_credentials_file',
+      '--reviewboard-credentials-file',
       type=argparse.FileType(),
-      dest='reviewboard_credentials_file',
       help='Review Board credentials file, formatted as <user>\\n<password>',
       required=True)
   parser.add_argument(
       '--repository',
-      dest='repository',
       help='Inspect reviews posted for this repository.',
       required=True)
   parser.add_argument(
       '--command',
-      dest='command',
       help='Build verification command.',
       required=True)
   parser.add_argument(
-      '--tail_lines',
-      dest='tail_lines',
+      '--tail-lines',
       type=int,
       default=20,
       help='Number of lines of command output to include in red build reviews.',
       required=True)
+  parser.add_argument(
+    '--git-clean-exclude',
+    help='Patterns to pass to git-clean --exclude.',
+    nargs='*')
   args = parser.parse_args()
 
   credentials = args.reviewboard_credentials_file.readlines()
@@ -142,7 +142,7 @@ def main():
         accept='text/x-patch')
     sha = subprocess.check_output(['git', 'rev-parse', '--short', 'HEAD']).strip()
     try:
-      _apply_patch(patch_data)
+      _apply_patch(patch_data, args.git_clean_exclude)
       print('Running build command.')
       build_output = 'build_output'
       command = args.command