Compare commits

..

5 Commits

Author SHA1 Message Date
GitHub Action
2a9d86a6bf Release version 0.54.0 2025-12-03 02:17:59 +00:00
Jose Diaz-Gonzalez
4fd3ea9e3c Merge pull request #457 from Iamrodos/readme-updates
docs: update README testing section and add fetch vs pull explanation
2025-12-02 21:15:33 -05:00
Jose Diaz-Gonzalez
041dc013f9 Merge pull request #458 from Iamrodos/fix-logging
fix: send INFO/DEBUG to stdout, WARNING/ERROR to stderr
2025-12-02 21:14:49 -05:00
Rodos
12802103c4 fix: send INFO/DEBUG to stdout, WARNING/ERROR to stderr
Fixes #182
2025-12-01 16:11:11 +11:00
Rodos
bf28b46954 docs: update README testing section and add fetch vs pull explanation 2025-12-01 15:55:00 +11:00
4 changed files with 56 additions and 6 deletions

View File

@@ -1,10 +1,25 @@
Changelog Changelog
========= =========
0.53.0 (2025-11-30) 0.54.0 (2025-12-03)
------------------- -------------------
------------------------ ------------------------
Fix
~~~
- Send INFO/DEBUG to stdout, WARNING/ERROR to stderr. [Rodos]
Fixes #182
Other
~~~~~
- Docs: update README testing section and add fetch vs pull explanation.
[Rodos]
0.53.0 (2025-11-30)
-------------------
Fix Fix
~~~ ~~~
- Case-sensitive username filtering causing silent backup failures. - Case-sensitive username filtering causing silent backup failures.

View File

@@ -308,6 +308,25 @@ Skip existing on incomplete backups
The ``--skip-existing`` argument will skip a backup if the directory already exists, even if the backup in that directory failed (perhaps due to a blocking error). This may result in unexpected missing data in a regular backup. The ``--skip-existing`` argument will skip a backup if the directory already exists, even if the backup in that directory failed (perhaps due to a blocking error). This may result in unexpected missing data in a regular backup.
Updates use fetch, not pull
---------------------------
When updating an existing repository backup, ``github-backup`` uses ``git fetch`` rather than ``git pull``. This is intentional - a backup tool should reliably download data without risk of failure. Using ``git pull`` would require handling merge conflicts, which adds complexity and could cause backups to fail unexpectedly.
With fetch, **all branches and commits are downloaded** safely into remote-tracking branches. The working directory files won't change, but your backup is complete.
If you look at files directly (e.g., ``cat README.md``), you'll see the old content. The new data is in the remote-tracking branches (confusingly named "remote" but stored locally). To view or use the latest files::
git show origin/main:README.md # view a file
git merge origin/main # update working directory
All branches are backed up as remote refs (``origin/main``, ``origin/feature-branch``, etc.).
If you want to browse files directly without merging, consider using ``--bare`` which skips the working directory entirely - the backup is just the git data.
See `#269 <https://github.com/josegonzalez/python-github-backup/issues/269>`_ for more discussion.
Github Backup Examples Github Backup Examples
====================== ======================
@@ -357,7 +376,12 @@ A huge thanks to all the contibuters!
Testing Testing
------- -------
This project currently contains no unit tests. To run linting:: To run the test suite::
pip install pytest
pytest
To run linting::
pip install flake8 pip install flake8
flake8 --ignore=E501 flake8 --ignore=E501

View File

@@ -16,12 +16,23 @@ from github_backup.github_backup import (
retrieve_repositories, retrieve_repositories,
) )
logging.basicConfig( # INFO and DEBUG go to stdout, WARNING and above go to stderr
format="%(asctime)s.%(msecs)03d: %(message)s", log_format = logging.Formatter(
fmt="%(asctime)s.%(msecs)03d: %(message)s",
datefmt="%Y-%m-%dT%H:%M:%S", datefmt="%Y-%m-%dT%H:%M:%S",
level=logging.INFO,
) )
stdout_handler = logging.StreamHandler(sys.stdout)
stdout_handler.setLevel(logging.DEBUG)
stdout_handler.addFilter(lambda r: r.levelno < logging.WARNING)
stdout_handler.setFormatter(log_format)
stderr_handler = logging.StreamHandler(sys.stderr)
stderr_handler.setLevel(logging.WARNING)
stderr_handler.setFormatter(log_format)
logging.basicConfig(level=logging.INFO, handlers=[stdout_handler, stderr_handler])
def main(): def main():
args = parse_args() args = parse_args()

View File

@@ -1 +1 @@
__version__ = "0.53.0" __version__ = "0.54.0"