From 239d8cd6189be2cacd46219dfb0d61c8dd9cc743 Mon Sep 17 00:00:00 2001 From: "Brett T. Warden" Date: Mon, 15 Apr 2024 17:13:34 -0700 Subject: [PATCH] Limit diff to ~10 lines Also include content of added files. --- autospec/tarball.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/autospec/tarball.py b/autospec/tarball.py index 65d8d784..38092a20 100644 --- a/autospec/tarball.py +++ b/autospec/tarball.py @@ -446,5 +446,8 @@ def process(self, filemanager): autogenerated_src.extract(os.path.join(self.base_path, 'autogenerated-tmp')) # Move the autogenerated source to a non-version-named directory for consistent diffs call(f"mv autogenerated-tmp/{autogenerated_src.prefix} autogenerated", check=True, cwd=self.base_path) - call("diff -u -r ../autogenerated ./", - logfile="archive.diff", check=False, cwd=os.path.join(self.base_path, main_src.prefix)) + call("diff -u -r --unidirectional-new-file ../autogenerated ./", + logfile="archive.diff.in", check=False, cwd=os.path.join(self.base_path, main_src.prefix)) + call("grep -A14 -E '^(diff|Only in)' archive.diff.in", + logfile="archive.diff", check=False, cwd=os.getcwd()) + call("rm archive.diff.in", check=False, cwd=os.getcwd())