Fix git file history log order #9128
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
To get a git log for a file, history entries can't be simply sorted by date. Common actions like rebase may change commit order, commits could also have the same commit date and still be valid etc.
This change adds a position field to the fetched history entries which is now used in the UI comparator instead of dates.
Comparisons between local and git history items still use timestamps.
first commit has the modifications, second is for cleanup in related files.
reproducer:
INIT,BandAAandBshould not be in conflict so that commit order can be easily changed)BwithAgit logshould showINIT,A,B, the NB file history tab will showINIT,B,Awhich is not the correct log ordergit ->show historyaction does always show the correct order, this is about the history mutiview tabThis is a minimal attempt to resolve this issue. UI-wise we should probably do more and swap the revision and date columns (and probably don't allow to sort by date at all).
draft since i have to test this better and I might add a cleanup commit,feedback still welcome