Commit 3e153806ff (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 <newren@gmail.com>
Some users may want to take advantage of setting TMPDIR to another
location that might be faster for the linting process.
Reported-by: @ruv on GitHub
Signed-off-by: Elijah Newren <newren@gmail.com>
It was not clear for some users that the filenames would be relative
paths from the toplevel of the repository. Add some text to explain
this.
Reported-by: @ruv on GitHub
Signed-off-by: Elijah Newren <newren@gmail.com>
This fixes the "TypeError: a bytes-like object is required, not 'str'"
problem on Windows, letting t9391 pass.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
We had a lingering issue in the conversion from python2 to python3; as
reported by @thebrandre on GitHub:
any(x==b'1' for x in b"123")
# returns True in Python2 and False in Python3 because different
# types are returned on iteration:
[type(x) for x in b"123"]
# Python2: [<type 'str'>, <type 'str'>, <type 'str'>]
# Python3: [<class 'int'>, <class 'int'>, <class 'int'>]
Replace the
any(x==b"0" for x in blob.data[0:8192])
construct with
b"\0" in blob.data[0:8192]
to fix this.
Suggested-by: @thebrandre on GitHub
Signed-off-by: Elijah Newren <newren@gmail.com>
The desire to format or lint code throughout history has arisen several
times. It's more natural to do this in filter-branch since it somewhat
forces people to run external commands, but we have an example contrib
demo that shows how to run an external command on each file in history
that I created even before any of these requests came in and yet I still
periodically get requests about it.
Make lint-history ever-so-slightly easier to apply to a subset of
filenames, and include its usage as an extra cheat sheet comparison for
filter-branch-vs-filter-repo commands.
Signed-off-by: Elijah Newren <newren@gmail.com>
When a file is deleted, there is nothing to lint, so we can just keep
the deletion as-is.
Reported-by: Thorben Kröger <dev@thorben.net>
Signed-off-by: Elijah Newren <newren@gmail.com>