-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Allow viewing past commits in Zed #27636
Conversation
1221802
to
c8d53cf
Compare
c8d53cf
to
9e7a120
Compare
80e5951
to
872dabc
Compare
@maxbrunsfeld : Isn't the tab size too big? |
@maxbrunsfeld : File sorting is different than github uses, by folder from what I understand. |
By mistake, clicking multiple times opens the tab multiple times, which I think shouldn't happen, if it's already open there's no point in opening it. Also, there's no informative tooltip when you move over the tab. Registrazione.schermo.2025-03-31.alle.18.48.16.mov |
You mean the width of the tab (due to the commit message)? What character limit do you think we should impose? |
I think that for now, I'd like to leave the same path sorting as in other multi-buffers. Maybe separately from this we could revisit how that sorting works in Zed across the board. It looks like they are sorting |
@maxbrunsfeld : Show only the first seven characters of the |
45e210b
to
d4c1cf1
Compare
(like commit view)
4c751a3
to
8aee7d0
Compare
I left a little bit of the commit message in the tab - I think it helps to identify the commit a bit better than just the SHA, even if we truncate it. |
This PR adds functionality for loading the diff for an arbitrary git commit, and displaying it in a tab. To retrieve the diff for the commit, I'm using a single `git cat-file --batch` invocation to efficiently load both the old and new versions of each file that was changed in the commit. Todo * Features * [x] Open the commit view when clicking the most recent commit message in the commit panel * [x] Open the commit view when clicking a SHA in a git blame column * [x] Open the commit view when clicking a SHA in a commit tooltip * [x] Make it work over RPC * [x] Allow buffer search in commit view * [x] Command palette action to open the commit for the current blame line * Styling * [x] Add a header that shows the author, timestamp, and the full commit message * [x] Remove stage/unstage buttons in commit view * [x] Truncate the commit message in the tab * Bugs * [x] Dedup commit tabs within a pane * [x] Add a tooltip to the tab Release Notes: - Added the ability to show past commits in Zed. You can view the most recent commit by clicking its message in the commit panel. And when viewing a git blame, you can show any commit by clicking its sha.
@maxbrunsfeld : Why do you only show the first sixteen characters of the sha in the tooltip? There are a few things about this part that I would like to discuss, are you available? |
Follow-up to #27636 Release Notes: - N/A
My thought was that otherwise, the tooltip gets quite large, but I'm open to showing the whole SHA.
Yeah, email me at max at zed dot dev, and we can make a plan. |
This PR adds functionality for loading the diff for an arbitrary git commit, and displaying it in a tab. To retrieve the diff for the commit, I'm using a single
git cat-file --batch
invocation to efficiently load both the old and new versions of each file that was changed in the commit.Todo
Release Notes: