Skip to content

Add test for commits not ordered chronologically #1823

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

Conversation

cruessler
Copy link
Contributor

This test covers a case that I came across working on #1743. Git doesn’t guarantee commits are ordered by commit date, so this adds a test for that specific case. In order to facilitate review, I decided to go with this small and targeted PR.

Since I keep adding tests to make_blame_repo.sh, I started wondering whether this was the best way of organizing the different test cases or whether it would be beneficial to spread them across multiple smaller files. What do you think?

Copy link
Member

@Byron Byron left a comment

Choose a reason for hiding this comment

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

That's wonderful, and I should really keep an eye out for the topo-order !+date-order case myself.

It's something to keep in mind when implementing any kind of traversal for sure. The main problem about traversals for me certainly is that I forget everything about them very quickly.

Regarding test-organization, I think it's up to your preference. I keep finding myself working with possibly big and ever-growing 'thematic' fixtures. And since the theme here is blame, and the test-cases seem to be nicely isolated despite sharing a single repository, tree and commit-graph, I'd not change a thing.

In fact, it's probably great to have a complex commit-graph to lure out strange bugs.

@Byron Byron enabled auto-merge February 1, 2025 14:28
@Byron Byron merged commit 18e163e into GitoxideLabs:main Feb 1, 2025
21 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.

2 participants