-
Notifications
You must be signed in to change notification settings - Fork 369
Git history for a selected file (#864) #980
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
Git history for a selected file (#864) #980
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot @navn-r This is great!
I commented in the code as much as possible. One UI comment - reusing the FileItem
component to display the file name at the history top is a good idea. It will probably require some styling to highlight it compare to the history list (a different background color maybe).
d3e9338
to
fb1ef73
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for quickly applying the suggestion.
Remaining points I see:
- Styling: the
FileItem
in the history panel should be styled- to stand out of the history commit list
- to not be hidden when the user scrolls on the commits list (maybe making it sticky would work)
- Not applying style through the style props (see comment in code)
- The diff file context menu item should be available for modified file (it is not currently). For such case it will be good to add a history item that allow to display uncommited changes (you can have a look at how VS Code is doing it in its timeline panel).
- Correct the tests and add new ones
Progress Update From this recent push... (styled and sticky selected file + Uncommitted changes commit node) Besides adding/fixing tests, these are the only things left, as requested by @adammclaurin:
From @fcollonval:
Tiny Update from me: I figured just adding a 'no history found' default to the side bar requires less effort yet delivers the same end-user value, compared to watching for the ignored files then trying to hide the history context button. |
Thanks for the update.
I would left this one out for a follow-up PR. This brings in already a big change. For how to do it (in the single file history view), using a context menu would be nice and/or a visual check box on the commit info top right - but this maybe complex because we need to enforce two nodes selection only and there is the notion of what are the reference and challenger. |
👍 We can open a new issue with enhancement proposal to deal with ignored files. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Co-authored-by: Frédéric Collonval <fcollonval@gmail.com>
- Covers git-ignored files edge case
Improve readability Co-authored-by: Frédéric Collonval <fcollonval@gmail.com>
fe40b6a
to
c67ebe1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @navn-r
Could you please add a Python unit test that check the git command executed and the parsing of the output?
The best starting point for that would be to duplicate jupyterlab_git/tests/test_detailed_log.py
and apply it to the single file case.
Thanks a lot @navn-r |
} | ||
protected _getFileChangedLabel(change: keyof typeof STATUS_CODES): string { | ||
return STATUS_CODES[change]; | ||
return STATUS_CODES[change] || 'Unmodified'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Translation missing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @krassowski
Added history context menu button in file browser
Displays Single File History in History Tab
Discard file history
button 'reverts' the history tab back to its usual repo historyTODO:
FileItem
in the history panel should be styledFixes #864