Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat(blame): Support customrev_opts for blame#1485

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Byron merged 1 commit intogitpython-developers:mainfromthehale:blame/rev-opts
Aug 31, 2022

Conversation

thehale
Copy link
Contributor

Thegit blame CLI offers a repeated-C option that can be used to detect
lines that move within/between files. While a slower operation, it yields more
accurate authorship reports.
https://git-scm.com/docs/git-blame#Documentation/git-blame.txt--Cltnumgt

While GitPython does enable passing custom kwargs to the command linegit
invocation, the fact that kwargs is a dictionary (i.e. no duplicate keys) means
that there was no way to request the-C option ingit blame more than once.

This commit adds an optionalrev_opts parameter to theblame method which
accepts a list of strings to propagate to the CLI invocation ofgit blame. By
using aList[str] forrev_opts, users of GitPython can pass now the-C
option multiple times to get more detailed authorship reports fromgit blame.

@thehale
Copy link
ContributorAuthor

At this point, I would appreciate a second pair of eyes to help diagnose why the test suite keeps failing on Python 3.7.

The one test that's currently failing was passing in my second commit (c0225b3), and my latest commit only re-wrote a small portion of the new test I added as part of the original PR.

Is this a flaky test that just needs a re-run? or is there something deeper that I'm somehow polluting in my latest revision?

@Byron
Copy link
Member

Thanks for your contribution, it's appreciated.

I retried the CI a couple of times but it appears to consistently fail. Now tryingmain again to see if this is a new general issue, as I also wouldn't think this test should break after this change.

@Byron
Copy link
Member

Andthe results are in:main is still working, which means something here has broken this one one test, consistently across python versions:test/test_base.py::TestBase::test_with_rw_remote_and_rw_repo.

As it still makes no sense to me, could you revert all your changes so this branch is the same content as main to see if this fixes it? I'd expect not, but I don't know what else to try. It appears anls-remote call has afile-not-found error, and generally it can't connect to the server running at localhost, which probably means it crashed or shut down.

The `git blame` CLI offers a repeated `-C` option that can be used to detectlines that move within/between files. While a slower operation, it yields moreaccurate authorship reports.https://git-scm.com/docs/git-blame#Documentation/git-blame.txt--CltnumgtWhile GitPython does enable passing custom kwargs to the command line `git`invocation, the fact that kwargs is a dictionary (i.e. no duplicate keys) meansthat there was no way to request the `-C` option in `git blame` more than once.This commit adds an optional `rev_opts` parameter to the `blame` method whichaccepts a list of strings to propagate to the CLI invocation of `git blame`. Byusing a `List[str]` for `rev_opts`, users of GitPython can pass now the `-C`option multiple times to get more detailed authorship reports from `git blame`.
@thehale
Copy link
ContributorAuthor

Isaw earlier that you aren't a fan of force-pushes, but in this case, I found it much easier to squash my three commits into the one logical change that they are, then revert that single commit.

As expected, reverting this branch back to the code inmain ispassing on all counts, so there definitely seems to be some unexpected coupling between the testtest_with_rw_remote_and_rw_repo and my strictly additive change to theblame() function.


something here has broken this one test, consistently across python versions

Was there a CI run where Python 3.9 was broken? I'm only seeing failures forPython 3.7 andPython 3.8 and 3.10.

I'm not sure if that observation is helpful or not. Like you, I'm trying to scrounge up anything reproducible related to this failing test.

@thehale
Copy link
ContributorAuthor

thehale commentedAug 31, 2022
edited
Loading

Well... reverting the revertappears to be passing. Do you see anything that explains that behavior?

@thehale
Copy link
ContributorAuthor

Theoretically, if the reverted revert passes, then so should the standalone squashed commit. Would you like me to force push the branch with just the squashed commit, or just keep the double revert in the history?

@Byron
Copy link
Member

Thanks so much for your help! Force pushing should do the job.
My guess is that it’s about the number of commits, as the test suite sees the GitPython repository, it’s not isolated unfortunately.

@thehale
Copy link
ContributorAuthor

Thanks so much for your help! Force pushing should do the job.

Done, and it looks like tests passed again!

My guess is that it’s about the number of commits, as the test suite sees the GitPython repository, it’s not isolated unfortunately.

Well, at least it's an effective way to require PRs to stay small! XD


Thanks for your generosity with debugging this PR and open sourcing this powerful library!

@ByronByron added this to thev3.1.28 - Bugfixes milestoneAug 31, 2022
@Byron
Copy link
Member

🎉 Thanks for pulling through, this was much harder than it should have been 😅.

@ByronByron merged commitbec6157 intogitpython-developers:mainAug 31, 2022
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
@thehale@Byron

[8]ページ先頭

©2009-2025 Movatter.jp