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

Use local branch if newer than remote branch #33

Merged

Conversation

KyleFromNVIDIA
Copy link
Contributor

@KyleFromNVIDIA KyleFromNVIDIA commented May 16, 2024

If upstream is a user's fork that doesn't get updated, we want to instead use the local branch, which is more likely to be up to date.

Fixes: #32

If upstream is a user's fork that doesn't get updated, we want to
instead use the local branch, which is more likely to be up to date.
@KyleFromNVIDIA KyleFromNVIDIA requested a review from a team as a code owner May 16, 2024 19:52
Copy link
Member

@jameslamb jameslamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is exactly the behavior that I was looking for in #32, thanks!

I left some comments about structure and documentation for your consideration. While you consider those, I'll pull this branch and test if it would have fixed the issue I was seeing on my rmm branch.

src/rapids_pre_commit_hooks/copyright.py Show resolved Hide resolved
src/rapids_pre_commit_hooks/copyright.py Outdated Show resolved Hide resolved
@jameslamb jameslamb self-requested a review May 16, 2024 20:30
Copy link
Member

@jameslamb jameslamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just tested this in the situation that led me to create #32, and found that as of these changes the hook works exactly as described there!

Namely, I saw these 2 commits in commits_to_try:

[<git.Commit "cab7e06cc40eaf9dc98f5563a8cc399fbc876388">, <git.Commit "9e6db746f1a4a6361fb9fadf381f749dc52faaea">]

And then the hook preferring the newer one on my local branch (cab7e0) to the older one on the branch on my fork (9e6db7).

Nice work!

@jameslamb
Copy link
Member

I tested this again after the recent commits, still works perfectly. Let's merge it 😁

@KyleFromNVIDIA KyleFromNVIDIA merged commit 9bec08c into rapidsai:main May 16, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

verify-copyright should consider local and remote branches when determining target branch upstream commit
3 participants