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

Add safeguard around git diff scan #168

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

mpaulmier
Copy link
Contributor

This is to prevent the scan to be run multiple times and show more than once in Magit's buffer

Fixes #145 && #127 (reopening of #154)

alphapapa and others added 2 commits September 26, 2024 19:52
This is to prevent the scan to be run multiple times and show more than once in
Magit's buffer

Fixes alphapapa#145 && alphapapa#127

Modified-by: Adam Porter <[email protected]>
@alphapapa
Copy link
Owner

I've rebased this on master, but now I see a minor problem: if the branch-diff scanner takes quite a long time (e.g. if there is a lot of diff output to scan), and the branch-diff scan is aborted by refreshing the status buffer before the scan finished, the branch-diff section will be inserted with whatever matches are found in the partially complete scan output. Then when the uninterrupted scan finishes, it inserts another section with all of the matches. This is confusing, as the first section implies that there are only that many matches, and the user may not know that there's another scan still running, which may insert a section with a different number of matches.

So we need to find a way to prevent the aborted scan from inserting results.

@alphapapa alphapapa self-assigned this Sep 27, 2024
@alphapapa alphapapa added the bug Something isn't working label Sep 27, 2024
@alphapapa alphapapa added this to the v1.9 milestone Sep 27, 2024
@mpaulmier
Copy link
Contributor Author

Hello, sorry for the late response, I haven't looked at this package for quite some time now tbh so I haven't had the chance to test my branch again. I'll see if I can give it a try on a weekend and fix the issue you are reporting.

I've quickly tested on a project at work today and wasn't able to observe the behaviour you're describing. Maybe the diff wasn't large enough. To me the TODOs sections don't appear at all until the scans are done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Branched todos section may appear multiple times when reloading too quickly
2 participants