From 9cf6121b34fedb8a8c0be59fcdf44651d59cb381 Mon Sep 17 00:00:00 2001 From: Elijah Newren Date: Mon, 3 Oct 2022 15:04:52 -0700 Subject: [PATCH] lint-history: fix broken --refs option Commit 3e153806ff47 (lint-history: Add --refs argument, 2021-12-30) added a --refs argument to lint-history, but attempting to inject it directly into the parsed args fields, bypassing some of the important logic from FilteringOptions.parse_args() -- particularly the bit where it translates an empty --refs into a request for '--all' as as list of references. I somehow overlooked this in my earlier review. Fix the problem now. Signed-off-by: Elijah Newren --- contrib/filter-repo-demos/lint-history | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/contrib/filter-repo-demos/lint-history b/contrib/filter-repo-demos/lint-history index 504d83c..61967b7 100755 --- a/contrib/filter-repo-demos/lint-history +++ b/contrib/filter-repo-demos/lint-history @@ -160,9 +160,11 @@ if lint_args.relevant: exec('def is_relevant(filename):\n '+'\n '.join(body.splitlines()), globals()) lint_args.filenames_important = True -args = fr.FilteringOptions.default_options() +input_args = [] +if lint_args.refs: + input_args = ["--args",] + lint_args.refs +args = fr.FilteringOptions.parse_args(input_args, error_on_empty = False) args.force = True -args.refs = lint_args.refs if lint_args.refs is not None else [] if lint_args.filenames_important: tmpdir = tempfile.mkdtemp().encode() cat_file_process = subprocess.Popen(['git', 'cat-file', '--batch'],