Skip to content

Commit 280d814

Browse files
committed
Test revert to 91608f2 (lint-history: make it possible to specify --refs and command, 2024-07-03)
Signed-off-by: Elijah Newren <[email protected]>
1 parent 571f1c1 commit 280d814

File tree

11 files changed

+72
-118
lines changed

11 files changed

+72
-118
lines changed

.github/dependabot.yml

Lines changed: 0 additions & 7 deletions
This file was deleted.

Documentation/git-filter-repo.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -572,9 +572,11 @@ history rewrite are roughly as follows:
572572
hosting provider about how to remove any server-side references
573573
to the old commits (example:
574574
https://docs.gitlab.com/ee/user/project/repository/reducing_the_repo_size_using_git.html[GitLab's
575-
excellent docs on reducing repository size], or
576-
https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/removing-sensitive-data-from-a-repository#fully-removing-the-data-from-github[the
577-
first and second steps under "Fully removing the data from GitHub"]).
575+
excellent docs on reducing repository size], or just the warning
576+
box that references "GitHub support" from
577+
https://docs.github.com/en/github/authenticating-to-github/removing-sensitive-data-from-a-repository[GitHub's
578+
otherwise dangerously out-of-date docs on removing sensitive
579+
data]).
578580

579581
6. (Optional) Some additional considerations
580582

Makefile

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,14 +130,15 @@ github_release: update_docs
130130

131131
pypi_release: # Has an implicit dependency on github_release because...
132132
# Upload to PyPI, automatically picking tag created by github_release
133-
python3 -m venv venv
134-
venv/bin/pip install --upgrade pip
135-
venv/bin/pip install build twine
136-
venv/bin/pyproject-build
133+
cd release && python3 -m venv venv
134+
cd release && venv/bin/pip3 install --upgrade setuptools pip
135+
cd release && venv/bin/pip3 install twine wheel
136+
cd release && venv/bin/python3 setup.py sdist bdist_wheel
137137
# Note: hope you remember password for pypi, but username is 'newren'
138-
venv/bin/twine upload dist/*
138+
cd release && venv/bin/twine upload dist/*
139139
# Remove temporary file(s)
140-
rm -rf dist/ venv/ git_filter_repo.egg-info/
140+
cd release && rm -f README.md git-filter-repo git_filter_repo.py
141+
cd release && rm -rf .eggs/ build/ venv/ git_filter_repo.egg-info/
141142

142143
# NOTE TO FUTURE SELF: If you accidentally push a bad release, you can remove
143144
# all but the git-filter-repo-$VERSION.tar.xz asset with

contrib/filter-repo-demos/clean-ignore

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,8 @@ class CheckIgnores:
5555
if not source and not linenum and not pattern:
5656
self.okay.add(name)
5757
else:
58-
if pattern[0:1] == b"!":
59-
self.okay.add(name)
60-
else:
61-
self.ignored.add(name)
62-
ignored.add(name)
58+
self.ignored.add(name)
59+
ignored.add(name)
6360

6461
return ignored
6562

contrib/filter-repo-demos/lint-history

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ near the top of git-filter-repo.
3131
# about filenames, then this program could be replaced by a "one-liner"; e.g.
3232
# git filter-repo --force --blob-callback '
3333
# if not b"\0" in blob.data[0:8192]:
34-
# filename = ".git/info/tmpfile"
34+
# filename = '.git/info/tmpfile'
3535
# with open(filename, "wb") as f:
3636
# f.write(blob.data)
3737
# subprocess.check_call(["lint_program", "--some", "arg", filename])
@@ -164,7 +164,7 @@ if lint_args.relevant:
164164
lint_args.filenames_important = True
165165
input_args = []
166166
if lint_args.refs:
167-
input_args = ["--refs",] + lint_args.refs
167+
input_args = ["--args",] + lint_args.refs
168168
args = fr.FilteringOptions.parse_args(input_args, error_on_empty = False)
169169
args.force = True
170170
if lint_args.filenames_important:

git-filter-repo

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,6 @@ __all__ = ["Blob", "Reset", "FileChange", "Commit", "Tag", "Progress",
5151
"string_to_date", "date_to_string",
5252
"record_id_rename", "GitUtils", "FilteringOptions", "RepoFilter"]
5353

54-
# The globals to make visible to callbacks. They will see all our imports for
55-
# free, as well as our public API.
56-
public_globals = ["__builtins__", "argparse", "collections", "fnmatch",
57-
"gettext", "io", "os", "platform", "re", "shutil",
58-
"subprocess", "sys", "time", "textwrap", "tzinfo",
59-
"timedelta", "datetime"] + __all__
60-
6154
deleted_hash = b'0'*40
6255
write_marks = True
6356
date_format_permissive = True
@@ -2851,11 +2844,9 @@ class RepoFilter(object):
28512844

28522845
def _handle_arg_callbacks(self):
28532846
def make_callback(argname, str):
2854-
callback_globals = {g: globals()[g] for g in public_globals}
2855-
callback_locals = {}
28562847
exec('def callback({}, _do_not_use_this_var = None):\n'.format(argname)+
2857-
' '+'\n '.join(str.splitlines()), callback_globals, callback_locals)
2858-
return callback_locals['callback']
2848+
' '+'\n '.join(str.splitlines()), globals())
2849+
return callback #namespace['callback']
28592850
def handle(type):
28602851
callback_field = '_{}_callback'.format(type)
28612852
code_string = getattr(self._args, type+'_callback')

pyproject.toml

Lines changed: 0 additions & 45 deletions
This file was deleted.

release/setup.cfg

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
[metadata]
2+
name = git-filter-repo
3+
url = https://github.com/newren/git-filter-repo
4+
project_urls =
5+
Source = https://github.com/newren/git-filter-repo
6+
Issues = https://github.com/newren/git-filter-repo/issues/
7+
description = Quickly rewrite git repository history
8+
long_description = file: README.md
9+
long_description_content_type = text/markdown
10+
classifiers =
11+
Development Status :: 4 - Beta
12+
Operating System :: OS Independent
13+
Programming Language :: Python
14+
License :: OSI Approved :: MIT License
15+
Programming Language :: Python :: 3.5
16+
Programming Language :: Python :: 3.6
17+
Programming Language :: Python :: 3.7
18+
Programming Language :: Python :: 3.8
19+
Programming Language :: Python :: 3
20+
Programming Language :: Python :: Implementation :: CPython
21+
Programming Language :: Python :: Implementation :: PyPy
22+
platforms = any
23+
license = MIT
24+
25+
[options]
26+
scripts = git-filter-repo
27+
py_modules = git_filter_repo
28+
python_requires = >= 3.5
29+
setup_requires = setuptools_scm
30+
31+
[bdist_wheel]
32+
universal = 1

release/setup.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
from setuptools import setup
2+
import os
3+
4+
5+
def link_parent(src, target=None):
6+
if target is None:
7+
target = src
8+
try:
9+
os.symlink(os.path.join("..", src), target)
10+
except FileExistsError:
11+
pass
12+
13+
14+
for f in ['git-filter-repo', 'README.md']:
15+
link_parent(f)
16+
17+
link_parent('git-filter-repo', 'git_filter_repo.py')
18+
19+
20+
setup(use_scm_version=dict(root="..", relative_to=__file__),
21+
entry_points={'console_scripts': ['git-filter-repo = git_filter_repo:main']})

t/run_coverage

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ exitcode=$?
2626
set -e
2727

2828
cd $tmpdir
29-
coverage3 combine -q
29+
coverage3 combine
3030
coverage3 html -d $orig_dir/report
3131
coverage3 report -m
3232
cd $orig_dir

0 commit comments

Comments
 (0)