zed icon indicating copy to clipboard operation
zed copied to clipboard

WIP: `git blame` prototypin'

Open mrnugget opened this issue 1 year ago • 1 comments

Release Notes:

Optionally, include screenshots / media showcasing your addition that can be included in the release notes.

or

  • N/A

mrnugget avatar Mar 05 '24 15:03 mrnugget

This will be a very handy feature. This is out of scope for now but, while I use blame in VSCode, 99% of the time it's a hover to see which PR introduced the commit and to click the link to view the PR on Github.

baldwindavid avatar Mar 06 '24 02:03 baldwindavid

Oooooh! If this prototype goes through, this will be super awesome!

JosephTLyons avatar Mar 08 '24 16:03 JosephTLyons

Current preview:

https://github.com/zed-industries/zed/assets/1185253/d9a65982-2b0f-4254-8f22-37811fd25fb4

mrnugget avatar Mar 19 '24 17:03 mrnugget

Collaboration works! Now all that's left is bundling git and incorporating more design feedback :)

https://github.com/zed-industries/zed/assets/1185253/0db7714c-6253-45ef-ac55-77925ad71d6f

mrnugget avatar Mar 27 '24 19:03 mrnugget

bundled git binary also works!

screenshot-2024-03-28-18 23 50@2x

mrnugget avatar Mar 28 '24 17:03 mrnugget

@mrnugget I've been using this in main and it's wonderful! Sorry for the unrelated, probably dumb question, but I've done a cargo run --release to get a Zed executable. Are there instructions somewhere to get a Mac "app" like you have there that I can run similarly to Preview/Stable releases?

Update: nvm, I see a bundle-mac script; I'll poke around with that.

baldwindavid avatar Mar 28 '24 21:03 baldwindavid

Even though this is merged, I have a question @mrnugget. I'm curious as to why the code cannot just use git2::Blame for this. git2::Blame has Blame::blame_buffer which I believe would do the same thing as calling git blame --contents. I'm not sure what benefits we get by doing a --incremental especially since we wait for the command to exit.

mmtftr avatar Mar 29 '24 18:03 mmtftr

@baldwindavid yep, that's the one. scripts/bundle-mac.

@mmtftr because it's very, very slow. See here: https://github.com/libgit2/libgit2/issues/3027 Running git blame on crates/editor/src/editor.rs in this repository here took 40s, vs 600ms shelling out to git. --incremental in this case is only used for its machine-readable output.

mrnugget avatar Apr 02 '24 07:04 mrnugget