← Winnitude! Search  ·  Reader Mode (1231 ms)
Links: Stay in Reader Retro Site Converter Retro Mode: OFF Original Page ↗
GITHUB · 91 LINKS

FIx issue #464 corrupt log file by barry-scott · Pull Request #469 · gitpython-developers/GitPython

Repository navigation

FIx issue #464 corrupt log file - #469


Merged
Byron merged 9 commits into gitpython-developers:master from barry-scott:master Aug 2, 2016
Merged

FIx issue #464 corrupt log file #469 Byron merged 9 commits into gitpython-developers:master from barry-scott:master

Conversation

barry-scott commented Jun 13, 2016



Copy link Copy Markdown
Contributor

Must only append the first line of the commit to the log
Otherwise the log file is not parsable by GitPython.

barry-scott added 2 commits June 13, 2016 15:26 Fix corruption of the ref logs file e0eafc4
It must only have the first line of the
commit messages, not the while multiple line log.
fix flake8 found problems a7f403b Byron added the waiting for feedback label Jun 14, 2016 Byron added this to the v2.0.6 - Bugfixes milestone Jun 14, 2016

Byron commented Jun 14, 2016



Copy link Copy Markdown
Member

Do you think it's possible for you to write a test which goes red if the change is not there ? The current test-suite should be a good starting-point for a fixture-based test.

Byron mentioned this pull request Jun 14, 2016 GitPython Commit corrupts .git/logs/refs/heads/pr-cmd-raise-with-stderr-on-error #464 Closed

barry-scott commented Jun 14, 2016



Copy link Copy Markdown
Contributor

Author

Please don't wait for me to write the test. I have a lot of work on my plate at moment.
Maybe merge this and leave the bug open awiting a test case?

How I detected the bug was:

  1. Use GitPython to commit to a repo - causing the fault
  2. Use GitPython to scan the log ref file - detecting the fault
Byron added help wanted and removed waiting for feedback labels Jun 18, 2016 nvie modified the milestones: v2.0.6 - Bugfixes , v2.0.7 - Bugfixes Jun 20, 2016 Merge branch 'master' of https://github.com/gitpython-developers/GitP... b4b5ecc
...ython
Byron modified the milestones: v2.0.7 - Bugfixes , v2.0.8 - Bugfixes Jul 17, 2016 barry-scott added 2 commits July 29, 2016 11:33 Merge remote-tracking branch 'upstream/master' 1116ef7 Prevent CMD windows being shown when starting git in a subprocess. 0d93908
This fixes a UI problem with using GitPython from a GUI python probgram.
Each repo that is opened creates a git cat-file processs and that provess will create
a console window with out this change.

barry-scott commented Jul 29, 2016



Copy link Copy Markdown
Contributor

Author

I'm not sure how to write the tests you want.

Can you point to docs on what is required?

Byron reviewed Jul 30, 2016 View reviewed changes Comment thread git/cmd.py
Outdated
else:
creationflags = None

p = Popen(['ps', '--ppid', str(pid)], stdout=PIPE, creationflags)

Byron commented Jul 30, 2016



Copy link Copy Markdown
Member

Now this PR contains two distinct and independent changes. The most recent one is hard to test, and I'd be fine without one.
As for the first set of changes, I believe I already referred to the respective test-suite. Generally, you want to write a test that fails until your changes are applied. This is the whole trick. The suite in question should already contain everything you need to setup your own.

Byron mentioned this pull request Jul 30, 2016 CMD windows created for Windows GUI python programs #495 Closed Must pass creationflags as a keywork d79951f

barry-scott commented Aug 1, 2016



Copy link Copy Markdown
Contributor

Author

I fixed the keyword parameter passing.

barry-scott added 2 commits August 1, 2016 11:09 creationflags must be set to 0 on non-windows platforms 572ebd6 add test to detect the corrupt log 8bde103
- add a second line to commit messages with the "BAD MESSAGE" text
- read in the log and confirm that the seond line is not in the log file

barry-scott commented Aug 1, 2016



Copy link Copy Markdown
Contributor

Author

I have added a basic test by changing one of the existing test_repo.py tests.

You can see the test fail by undoing the first line fix and running the test.

fix flake8 problems d8ef023 Byron merged commit d8ef023 into gitpython-developers : master Aug 2, 2016

Byron commented Aug 2, 2016



Copy link Copy Markdown
Member

@barry-scott Thank you, looks very good now ! I am particularly excited about the test, and hope in future you can give test-first development a shot as well.

barry-scott commented Aug 2, 2016



Copy link Copy Markdown
Contributor

Author

To get the test as one patch and the the test + fix as a second you will have to fix the dependency of the tests on master. Use of master means that you do not have a reproducible test. Its inputs depend on what the user did to create there master.

I suspect that if you had to create the test data that you use master for you might have found this bugs ages ago.

EliahKagan mentioned this pull request Dec 22, 2023 USE_SHELL = True not needed since 2.0.8 but still suggested for Windows #1781 Closed EliahKagan mentioned this pull request Jan 16, 2024 Fix two remaining Windows untrusted search path cases #1792 Merged Sign up for free to join this conversation on GitHub . Already have an account? Sign in to comment

Labels

help wanted

3 participants