Commit Graph

12 Commits

Author SHA1 Message Date
Elijah Newren
9cf6121b34 lint-history: fix broken --refs option
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>
2022-10-03 15:04:52 -07:00
Elijah Newren
5651f62f4c Merge branch 'rh/lint-history-refs-option'
Signed-off-by: Elijah Newren <newren@gmail.com>
2022-09-29 09:24:26 -07:00
Robert Haschke
3e153806ff lint-history: Add --refs argument
Signed-off-by: Robert Haschke <rhaschke@techfak.uni-bielefeld.de>
2022-09-29 15:23:19 +02:00
Elijah Newren
e5d8938d48 lint-history: explain how TMPDIR can be used
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>
2021-06-05 11:57:44 -07:00
Elijah Newren
ccc37d3423 lint-history: explain filename paths
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>
2021-06-05 11:57:44 -07:00
Elijah Newren
8683d6fe48 Merge branch 'js/windows-fixes'
Signed-off-by: Elijah Newren <newren@gmail.com>
2021-04-01 12:28:37 -07:00
Johannes Schindelin
fbaab1704c lint-history: do decode bytes
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>
2021-04-01 12:28:17 -07:00
Elijah Newren
97a1613f81 lint-history: fix binary blob detection
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>
2021-03-29 23:23:39 -07:00
Elijah Newren
23bec32283 contrib, docs: make discovery of code formatting and linting easier
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>
2020-06-06 11:54:28 -07:00
Elijah Newren
46549e7d3f lint-history: point people to issue with more linting examples
Signed-off-by: Elijah Newren <newren@gmail.com>
2020-02-18 21:59:28 -08:00
Elijah Newren
9d3d99593c lint-history: avoid dying when we get file deletions
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>
2020-02-06 13:02:12 -08:00
Elijah Newren
6d231c0a94 contrib: simple examples of tools based on filter-repo
Signed-off-by: Elijah Newren <newren@gmail.com>
2019-08-13 14:25:29 -07:00