Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test random changes (DO NOT MERGE) #580

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions .github/dependabot.yml

This file was deleted.

8 changes: 5 additions & 3 deletions Documentation/git-filter-repo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -572,9 +572,11 @@ history rewrite are roughly as follows:
hosting provider about how to remove any server-side references
to the old commits (example:
https://docs.gitlab.com/ee/user/project/repository/reducing_the_repo_size_using_git.html[GitLab's
excellent docs on reducing repository size], or
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
first and second steps under "Fully removing the data from GitHub"]).
excellent docs on reducing repository size], or just the warning
box that references "GitHub support" from
https://docs.github.com/en/github/authenticating-to-github/removing-sensitive-data-from-a-repository[GitHub's
otherwise dangerously out-of-date docs on removing sensitive
data]).

6. (Optional) Some additional considerations

Expand Down
13 changes: 7 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -130,14 +130,15 @@ github_release: update_docs

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

# NOTE TO FUTURE SELF: If you accidentally push a bad release, you can remove
# all but the git-filter-repo-$VERSION.tar.xz asset with
Expand Down
7 changes: 2 additions & 5 deletions contrib/filter-repo-demos/clean-ignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,8 @@ class CheckIgnores:
if not source and not linenum and not pattern:
self.okay.add(name)
else:
if pattern[0:1] == b"!":
self.okay.add(name)
else:
self.ignored.add(name)
ignored.add(name)
self.ignored.add(name)
ignored.add(name)

return ignored

Expand Down
2 changes: 1 addition & 1 deletion contrib/filter-repo-demos/lint-history
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ near the top of git-filter-repo.
# about filenames, then this program could be replaced by a "one-liner"; e.g.
# git filter-repo --force --blob-callback '
# if not b"\0" in blob.data[0:8192]:
# filename = ".git/info/tmpfile"
# filename = '.git/info/tmpfile'
# with open(filename, "wb") as f:
# f.write(blob.data)
# subprocess.check_call(["lint_program", "--some", "arg", filename])
Expand Down
13 changes: 2 additions & 11 deletions git-filter-repo
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,6 @@ __all__ = ["Blob", "Reset", "FileChange", "Commit", "Tag", "Progress",
"string_to_date", "date_to_string",
"record_id_rename", "GitUtils", "FilteringOptions", "RepoFilter"]

# The globals to make visible to callbacks. They will see all our imports for
# free, as well as our public API.
public_globals = ["__builtins__", "argparse", "collections", "fnmatch",
"gettext", "io", "os", "platform", "re", "shutil",
"subprocess", "sys", "time", "textwrap", "tzinfo",
"timedelta", "datetime"] + __all__

deleted_hash = b'0'*40
write_marks = True
date_format_permissive = True
Expand Down Expand Up @@ -2851,11 +2844,9 @@ class RepoFilter(object):

def _handle_arg_callbacks(self):
def make_callback(argname, str):
callback_globals = {g: globals()[g] for g in public_globals}
callback_locals = {}
exec('def callback({}, _do_not_use_this_var = None):\n'.format(argname)+
' '+'\n '.join(str.splitlines()), callback_globals, callback_locals)
return callback_locals['callback']
' '+'\n '.join(str.splitlines()), globals())
return callback #namespace['callback']
def handle(type):
callback_field = '_{}_callback'.format(type)
code_string = getattr(self._args, type+'_callback')
Expand Down
45 changes: 0 additions & 45 deletions pyproject.toml

This file was deleted.

32 changes: 32 additions & 0 deletions release/setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[metadata]
name = git-filter-repo
url = https://github.com/newren/git-filter-repo
project_urls =
Source = https://github.com/newren/git-filter-repo
Issues = https://github.com/newren/git-filter-repo/issues/
description = Quickly rewrite git repository history
long_description = file: README.md
long_description_content_type = text/markdown
classifiers =
Development Status :: 4 - Beta
Operating System :: OS Independent
Programming Language :: Python
License :: OSI Approved :: MIT License
Programming Language :: Python :: 3.5
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3
Programming Language :: Python :: Implementation :: CPython
Programming Language :: Python :: Implementation :: PyPy
platforms = any
license = MIT

[options]
scripts = git-filter-repo
py_modules = git_filter_repo
python_requires = >= 3.5
setup_requires = setuptools_scm

[bdist_wheel]
universal = 1
21 changes: 21 additions & 0 deletions release/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
from setuptools import setup
import os


def link_parent(src, target=None):
if target is None:
target = src
try:
os.symlink(os.path.join("..", src), target)
except FileExistsError:
pass


for f in ['git-filter-repo', 'README.md']:
link_parent(f)

link_parent('git-filter-repo', 'git_filter_repo.py')


setup(use_scm_version=dict(root="..", relative_to=__file__),
entry_points={'console_scripts': ['git-filter-repo = git_filter_repo:main']})
2 changes: 1 addition & 1 deletion t/run_coverage
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ exitcode=$?
set -e

cd $tmpdir
coverage3 combine -q
coverage3 combine
coverage3 html -d $orig_dir/report
coverage3 report -m
cd $orig_dir
Expand Down
2 changes: 1 addition & 1 deletion t/t9391-filter-repo-lib-usage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ test_expect_success 'lint-history' '
)
'

test_expect_success 'lint-history --refs' '
test_expect_success !WINDOWS 'lint-history --refs' '
test_create_repo lint-history-only-some-refs &&
(
cd lint-history-only-some-refs &&
Expand Down
4 changes: 3 additions & 1 deletion t/test-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1207,7 +1207,7 @@ yes () {
done
}

# Fix some commands on Windows
# Fix some commands on Windows, and other OS-specific things
uname_s=$(uname -s)
case $uname_s in
*MINGW*)
Expand All @@ -1229,6 +1229,7 @@ case $uname_s in
test_set_prereq NATIVE_CRLF
test_set_prereq SED_STRIPS_CR
test_set_prereq GREP_STRIPS_CR
test_set_prereq WINDOWS
GIT_TEST_CMP=mingw_test_cmp
;;
*CYGWIN*)
Expand All @@ -1237,6 +1238,7 @@ case $uname_s in
test_set_prereq CYGWIN
test_set_prereq SED_STRIPS_CR
test_set_prereq GREP_STRIPS_CR
test_set_prereq WINDOWS
;;
*)
test_set_prereq POSIXPERM
Expand Down
Loading