gitui icon indicating copy to clipboard operation
gitui copied to clipboard

refactor file history lookup into AsyncFileLogJob

Open extrawurst opened this issue 3 years ago • 4 comments

followup on #841

The idea is to abstract the job of fetching the revlog commits touching the file in question and parallelise this with look up of the commits that match to figure out what was the subject line,author... and the file modification type. right now this is all happening in the application level code which is not ideal and harder to unittest.

The simple solution is to build this in phases: 1) revlog 2) commit Infos 3) diffs (for the modification type) The downside of this approach is: we only all all the information of the file log once everything is done and not in iterative batches.

The more complex but nicer solution: The AsyncJob spawns another Thread-Worker. While the AsyncJob does the revwalk we send every commitId we find to match into a queue and the Worker picks it up and does the info and diff lookup. As soon as the worker is done with one CommitId this will popup right away in the file history list. This should give a very reactive and fast feeling.

@cruessler what do you think?

extrawurst avatar Jan 30 '22 18:01 extrawurst

@extrawurst I think the second option sounds like it gives the best user experience. Is something like this already implemented somewhere so that it could serve as a starting point?

cruessler avatar Feb 01 '22 18:02 cruessler

you can checkout the other examples of the AsyncJob being implemented. none of them is spawning a child thread though but that should not be much more complicated. think you want to try it? I can help you once you have a draft

extrawurst avatar Feb 01 '22 22:02 extrawurst

This issue has been automatically marked as stale because it has not had any activity half a year. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Aug 13 '22 02:08 stale[bot]

I’ve started addressing the issue in #1267.

cruessler avatar Aug 13 '22 12:08 cruessler

This issue has been automatically marked as stale because it has not had any activity half a year. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Mar 18 '23 06:03 stale[bot]