diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..93c77d9 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,75 @@ +--- +kind: pipeline +type: docker +name: default + +steps: +# note zest does everything, including tagging! +- name: version-tag-changelog + image: python:3-bookworm + commands: + - pip install --no-cache-dir zest.releaser + - fullrelease --no-input + when: + branch: + - master + +- name: git-push + image: appleboy/drone-git-push + settings: + ssh_key: + from_secret: github_ssh_key + remote: ssh://git@github.com/${DRONE_REPO}.git + force: false + followtags: true + when: + branch: + - master + +- name: build + image: python:3-alpine + commands: + #- python -m pip install --upgrade build + - pip --no-cache-dir install build + - python -m build + # alternatively, using pipx instead of pip: + #- pipx install build + #- pyproject-build + when: + event: tag + +- name: github-release + image: plugins/github-release + settings: + api_key: + from_secret: github_token + files: + - dist/* + title: "${DRONE_TAG}" + #note: CHANGELOG.md + checksum: + - sha256 + when: + event: tag + +- name: pypi-publish + image: plugins/pypi + settings: + username: + from_secret: public_pypi_username + password: + from_secret: public_pypi_password + skip_build: true + distributions: + - sdist + - bdist_wheel + when: + event: tag + +trigger: + ref: + - refs/heads/master + #- refs/heads/develop + - refs/heads/feature/* + - refs/tags/* + diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..6719d0a --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,4 @@ +## 0.0.1 (unreleased) + + +- first release of our fork diff --git a/README.md b/README.md index 22809ad..c7d8e0c 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,13 @@ -**Git playback** is a `git` command to play back or step through, commit by commit, the history of any git-controlled file. Its name was inspired by [mmozuras/git-playback](https://github.com/mmozuras/git-playback). +**Git playback** is a `git` command to play back or step through, commit by commit, +the history of any git-controlled file. + +Note this is a fork of [jianli/git-playback](https://github.com/jianli/git-playback) +that hasn't been updated since 2016. + ## Installation ```sh -pip install git-playback +pipx install git-playback-ng ``` ## Usage @@ -12,7 +17,7 @@ cd ~/repo/ git playback path/to/file.py ``` -![git playback README.md](https://raw.github.com/jianli/git-playback/master/animation.gif "git playback README.md") +![git playback README.md](https://raw.github.com/laur89/git-playback-ng/master/animation.gif "git playback README.md") and then press the following keys to navigate: * `r`ewind diff --git a/playback/__init__.py b/playback/__init__.py index 8f4b94f..4717678 100755 --- a/playback/__init__.py +++ b/playback/__init__.py @@ -47,7 +47,7 @@ def function(window): curses.init_pair(1, curses.COLOR_RED, -1) curses.init_pair(2, curses.COLOR_GREEN, -1) - repo = git.Repo(os.getcwd()) + repo = git.Repo(os.getcwd(), search_parent_directories=True) top_level = repo.git.rev_parse(show_toplevel=True) file_path = os.path.relpath( os.path.join(os.getcwd(), sys.argv[1]), top_level) @@ -71,7 +71,7 @@ def function(window): rewinding = False diff = [] - while 1: + while True: # get keyboard input window.nodelay(1) # don't wait for input key = window.getch() diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..ef30580 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,8 @@ +[zest.releaser] +extra-message = [CI SKIP] +# do not push to git remote: +push-changes = false +# do not release to pypi: +release = false +history_format = md + diff --git a/setup.py b/setup.py index 9ad4985..08d1fd6 100644 --- a/setup.py +++ b/setup.py @@ -1,11 +1,10 @@ -from setuptools import find_packages -from setuptools import setup +from setuptools import setup, find_packages setup( - name='git-playback', - version='0.1.1', - url='https://github.com/jianli/git-playback', + name='git-playback-ng', + version='0.0.1.dev0', + url='https://github.com/laur89/git-playback-ng', description='A git command to play back file history.', packages=find_packages('.'), entry_points={ @@ -14,6 +13,6 @@ ), }, install_requires=[ - 'gitpython>=0.3.2.RC1', + 'GitPython', ], )