Skip to content

Conversation

@mbien
Copy link
Member

@mbien mbien commented Jan 9, 2026

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:

  1. init git repo with 3 commits: INIT, B and A
    • (changes of A and B should not be in conflict so that commit order can be easily changed)
  2. rebase the last two commits and swap B with A
  3. git log should show INIT, A, B, the NB file history tab will show INIT, B, A which is not the correct log order
    • note: the git ->show history action does always show the correct order, this is about the history mutiview tab

This 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

@mbien mbien added this to the NB29 milestone Jan 9, 2026
@mbien mbien added git [ci] enable versioning job ci:dev-build [ci] produce a dev-build zip artifact (7 days expiration, see link on workflow summary page) labels Jan 9, 2026
mbien added 2 commits January 11, 2026 06:56
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.
javac fixes, dead code removal, language updates and other minor
improvements.
@mbien mbien added the Code cleanup Label for cleanup done on the Netbeans IDE label Jan 11, 2026
@mbien mbien force-pushed the git-file-history-order branch from 6de5430 to 55dc033 Compare January 11, 2026 07:04
@mbien mbien marked this pull request as ready for review January 11, 2026 07:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:dev-build [ci] produce a dev-build zip artifact (7 days expiration, see link on workflow summary page) Code cleanup Label for cleanup done on the Netbeans IDE git [ci] enable versioning job

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant