mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-13 05:42:59 +00:00
7f54935324
This adds a new action to the editor: `editor: toggle git blame`. When used it turns on a sidebar containing `git blame` information for the currently open buffer. The git blame information is updated when the buffer changes. It handles additions, deletions, modifications, changes to the underlying git data (new commits, changed commits, ...), file saves. It also handles folding and wrapping lines correctly. When the user hovers over a commit, a tooltip displays information for the commit that introduced the line. If the repository has a remote with the name `origin` configured, then clicking on a blame entry opens the permalink to the commit on the code host. Users can right-click on a blame entry to get a context menu which allows them to copy the SHA of the commit. The feature also works on shared projects, e.g. when collaborating a peer can request `git blame` data. As of this PR, Zed now comes bundled with a `git` binary so that users don't have to have `git` installed locally to use this feature. ### Screenshots ![screenshot-2024-03-28-13 57 43@2x](https://github.com/zed-industries/zed/assets/1185253/ee8ec55d-3b5e-4d63-a85a-852da914f5ba) ![screenshot-2024-03-28-14 01 23@2x](https://github.com/zed-industries/zed/assets/1185253/2ba8efd7-e887-4076-a87a-587a732b9e9a) ![screenshot-2024-03-28-14 01 32@2x](https://github.com/zed-industries/zed/assets/1185253/496f4a06-b189-4881-b427-2289ae6e6075) ### TODOs - [x] Bundling `git` binary ### Release Notes Release Notes: - Added `editor: toggle git blame` command that toggles a sidebar with git blame information for the current buffer. --------- Co-authored-by: Antonio <antonio@zed.dev> Co-authored-by: Piotr <piotr@zed.dev> Co-authored-by: Bennet <bennetbo@gmx.de> Co-authored-by: Mikayla <mikayla@zed.dev>
135 lines
No EOL
3.8 KiB
JSON
135 lines
No EOL
3.8 KiB
JSON
[
|
|
{
|
|
"sha": "c8d34ae30c87e59aaa5eb65f6c64d6206f525d7c",
|
|
"range": {
|
|
"start": 5,
|
|
"end": 6
|
|
},
|
|
"original_line_number": 7,
|
|
"author": "Thorsten Ball",
|
|
"author_mail": "<mrnugget@example.com>",
|
|
"author_time": 1709808710,
|
|
"author_tz": "+0100",
|
|
"committer": "Thorsten Ball",
|
|
"committer_mail": "<mrnugget@example.com>",
|
|
"committer_time": 1709808710,
|
|
"committer_tz": "+0100",
|
|
"summary": "Make a commit",
|
|
"previous": "6ad46b5257ba16d12c5ca9f0d4900320959df7f4 index.js",
|
|
"filename": "index.js"
|
|
},
|
|
{
|
|
"sha": "6ad46b5257ba16d12c5ca9f0d4900320959df7f4",
|
|
"range": {
|
|
"start": 1,
|
|
"end": 2
|
|
},
|
|
"original_line_number": 2,
|
|
"author": "Joe Schmoe",
|
|
"author_mail": "<joe.schmoe@example.com>",
|
|
"author_time": 1709741400,
|
|
"author_tz": "+0100",
|
|
"committer": "Joe Schmoe",
|
|
"committer_mail": "<joe.schmoe@example.com>",
|
|
"committer_time": 1709741400,
|
|
"committer_tz": "+0100",
|
|
"summary": "Joe's cool commit",
|
|
"previous": "486c2409237a2c627230589e567024a96751d475 index.js",
|
|
"filename": "index.js"
|
|
},
|
|
{
|
|
"sha": "6ad46b5257ba16d12c5ca9f0d4900320959df7f4",
|
|
"range": {
|
|
"start": 3,
|
|
"end": 4
|
|
},
|
|
"original_line_number": 3,
|
|
"author": "Joe Schmoe",
|
|
"author_mail": "<joe.schmoe@example.com>",
|
|
"author_time": 1709741400,
|
|
"author_tz": "+0100",
|
|
"committer": "Joe Schmoe",
|
|
"committer_mail": "<joe.schmoe@example.com>",
|
|
"committer_time": 1709741400,
|
|
"committer_tz": "+0100",
|
|
"summary": "Joe's cool commit",
|
|
"previous": "486c2409237a2c627230589e567024a96751d475 index.js",
|
|
"filename": "index.js"
|
|
},
|
|
{
|
|
"sha": "6ad46b5257ba16d12c5ca9f0d4900320959df7f4",
|
|
"range": {
|
|
"start": 8,
|
|
"end": 9
|
|
},
|
|
"original_line_number": 13,
|
|
"author": "Joe Schmoe",
|
|
"author_mail": "<joe.schmoe@example.com>",
|
|
"author_time": 1709741400,
|
|
"author_tz": "+0100",
|
|
"committer": "Joe Schmoe",
|
|
"committer_mail": "<joe.schmoe@example.com>",
|
|
"committer_time": 1709741400,
|
|
"committer_tz": "+0100",
|
|
"summary": "Joe's cool commit",
|
|
"previous": "486c2409237a2c627230589e567024a96751d475 index.js",
|
|
"filename": "index.js"
|
|
},
|
|
{
|
|
"sha": "486c2409237a2c627230589e567024a96751d475",
|
|
"range": {
|
|
"start": 0,
|
|
"end": 1
|
|
},
|
|
"original_line_number": 3,
|
|
"author": "Thorsten Ball",
|
|
"author_mail": "<mrnugget@example.com>",
|
|
"author_time": 1709129122,
|
|
"author_tz": "+0100",
|
|
"committer": "Thorsten Ball",
|
|
"committer_mail": "<mrnugget@example.com>",
|
|
"committer_time": 1709129122,
|
|
"committer_tz": "+0100",
|
|
"summary": "Get to a state where eslint would change code and imports",
|
|
"previous": "504065e448b467e79920040f22153e9d2ea0fd6e index.js",
|
|
"filename": "index.js"
|
|
},
|
|
{
|
|
"sha": "504065e448b467e79920040f22153e9d2ea0fd6e",
|
|
"range": {
|
|
"start": 4,
|
|
"end": 5
|
|
},
|
|
"original_line_number": 3,
|
|
"author": "Thorsten Ball",
|
|
"author_mail": "<mrnugget@example.com>",
|
|
"author_time": 1709128963,
|
|
"author_tz": "+0100",
|
|
"committer": "Thorsten Ball",
|
|
"committer_mail": "<mrnugget@example.com>",
|
|
"committer_time": 1709128963,
|
|
"committer_tz": "+0100",
|
|
"summary": "Add some stuff",
|
|
"previous": null,
|
|
"filename": "index.js"
|
|
},
|
|
{
|
|
"sha": "504065e448b467e79920040f22153e9d2ea0fd6e",
|
|
"range": {
|
|
"start": 9,
|
|
"end": 10
|
|
},
|
|
"original_line_number": 21,
|
|
"author": "Thorsten Ball",
|
|
"author_mail": "<mrnugget@example.com>",
|
|
"author_time": 1709128963,
|
|
"author_tz": "+0100",
|
|
"committer": "Thorsten Ball",
|
|
"committer_mail": "<mrnugget@example.com>",
|
|
"committer_time": 1709128963,
|
|
"committer_tz": "+0100",
|
|
"summary": "Add some stuff",
|
|
"previous": null,
|
|
"filename": "index.js"
|
|
}
|
|
] |