Commit log

ab9b3f1 v0.177.x stable

Joseph T. Lyons created

c206823 Disable uncommit button for parentless commits (#25983)

Click to expand commit body
Closes #25976

There's a couple states that this covers:
- upon `git init`, no footer is shown at all
- after 1 commit (or when on any parentless commit), the uncommit button
is ~disabled~ hidden
- otherwise commit button is shown

Also updated the button with "meta" tooltip showing human readable
description and git command.

Release Notes:

- N/A

---------

Co-authored-by: Nate Butler <iamnbutler@gmail.com>

Julia Ryan and Nate Butler created

ca1ec68 git_ui: Update Project Diff empty state design (#26554)

Click to expand commit body
Title

Release Notes:

- N/A

---------

Co-authored-by: Cole Miller <m@cole-miller.net>

Nate Butler and Cole Miller created

cf2a11c docs: Update the Git page (#26530)

Click to expand commit body
So it reflects the new set of features supported starting from v0.177.

Release Notes:

- N/A

Danilo Leal created

06d9fbe git: Add an onboarding and banner flow (#26518)

Click to expand commit body
TODO:

- [ ] Hide the reset onboarding action (only useful for development,
uncomment:
https://github.com/zed-industries/zed/pull/26518/files#diff-f0ce01d9a3df30f60c64b6f9906c54aa0191246a58dbf5297ee321575a180879R96)
- [x] Get a designer to replace the modal background (@danilo-leal)

Release Notes:

- Added a small onboarding banner for the git launch

---------

Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
Co-authored-by: Danilo Leal <67129314+danilo-leal@users.noreply.github.com>

Mikayla Maki , Danilo Leal , and Danilo Leal created

f143d1b Check if additional git provider is not the original git provider (#26533)

Click to expand commit body
Release Notes:

- N/A

Yesterday I worked on https://github.com/zed-industries/zed/pull/26482
and noticed afterwards that we have duplicated hosting providers if the
git remote host is "gitlab.com" and after the PR also for "github.com".
This is not a big problem, since the original providers are registered
first and therefore we first find a match with the original providers,
but I think we should address this nevertheless.

We initialize every hosting provider with the defaults here:

https://github.com/zed-industries/zed/blob/b008b2863ee015a9dc6ecdcd6dedbc708983f8b3/crates/git_hosting_providers/src/git_hosting_providers.rs#L15-L24

After that, we also register additional hosting providers:

https://github.com/zed-industries/zed/blob/b008b2863ee015a9dc6ecdcd6dedbc708983f8b3/crates/git_hosting_providers/src/git_hosting_providers.rs#L30-L43

If we do not check if the additional provider is not the original
provider, we will register the same provider twice.

---------

Co-authored-by: Marshall Bowers <git@maxdeviant.com>

Nils Koch and Marshall Bowers created

7728a8b git: Fix placeholder dots in untracked files (#26537)

Click to expand commit body
This regressed at some point.

Release Notes:

- N/A

Cole Miller created

d8bc10e Add detection of self hosted GitHub enterprise instances (#26482)

Click to expand commit body
This PR does not close an issue, but it is an issue and and fix in one.
I hope this is ok, but please let me know if you prefer me to open an
issue before.

Release Notes:

- Add "copy permalink" action for self-hosted GitHub enterprise
instances

# Issue
### Related issues:
* https://github.com/zed-industries/zed/issues/26393
* https://github.com/zed-industries/zed/issues/11043

When you try to copy a permalink from a self-hosted GitHub enterprise
instance, you get the following error:

<img width="383" alt="permalink"
src="https://github.com/user-attachments/assets/b32338a7-a2d7-48fc-86bf-ade1d32ed1f7"
/>

You also cannot open a PR or commit when you hover over a git blame:


https://github.com/user-attachments/assets/a5491ce7-270b-412f-b9ac-027ec020b028


### Reproduce
If you do not have access to a self-hosted GitHub instance, you can
change the remote url of any git repo:
```
git remote set-url origin git@github.mycorp.com:nilskch/zed.git
```

With the fix, permalinks still won't bring you to a valid website, but
you can verify that they are correctly created.

# Solution

Currently, we only support detecting self-hosted GitLab instances, but
not self-hosted GitHub instances. We detect GitLab instances by checking
if "gitlab" is part of the git URL.

This PR adds the same logic to detect self-hosted GitHub enterprise
instances (by checking if "github" is in the URL).

This solution is not ideal, since self-hosted GitHub or GitLab instances
might not contain the word "github" or "gitlab". #26393 proposes adding
a setting that would allow users to map specific domains to their
corresponding git provider types. This mapping would help Zed correctly
identify the appropriate git instance, even if "gitlab" or "github" are
not part of the URL.

This PR does not implement the offered solution, but I added a TODO
where the fix for #26393 has to make changes.

Nils Koch created

896276f Don't clobber the user's upstream settings (cherry-pick #26486) (#26528)

Click to expand commit body
Cherry-picked Don't clobber the user's upstream settings (#26486)

It's not clobbering time :(

Release Notes:

- Git Beta: Fixed a bug where our push button would always overwrite the
current branch's upstream

Co-authored-by: Mikayla Maki <mikayla@zed.dev>

gcp-cherry-pick-bot[bot] and Mikayla Maki created

828dd3c Add git init button (#26522)

Click to expand commit body
Because why not

Release Notes:

- N/A

Mikayla Maki created

0bea86d Rework git toasts (#26420)

Click to expand commit body
The notifications from git output could take up variable amounts of
screen space, and they were quite obnoxious when a git command printed
lots of output, such as fetching many new branches or verbose push
hooks.

This change makes the push/pull/fetch buttons trigger a small
notification toast, based on the output of the command that was ran. For
errors or commands with more output the user may want to see, there's an
"Open Log" button which opens a new buffer with the output of that
command.

It also uses this behavior for long error notifications for other git
commands like `commit` and `checkout`. The output of those commands can
be quite long due to arbitrary githooks running.

Release Notes:

- N/A

---------

Co-authored-by: Mikayla Maki <mikayla.c.maki@gmail.com>

Julia Ryan and Mikayla Maki created

6a3204c Hide generate commit message button when assistant is disabled (cherry-pick #26519) (#26521)

Click to expand commit body
Cherry-picked Hide generate commit message button when assistant is
disabled (#26519)

Release Notes:

- Git Beta: Fixed the generate commit message button still showing when
the assistant is disabled.

Co-authored-by: Mikayla Maki <mikayla@zed.dev>

gcp-cherry-pick-bot[bot] and Mikayla Maki created

6247405 git: Remove hunk style setting (cherry-pick #26504) (#26517)

Click to expand commit body
Cherry-picked git: Remove hunk style setting (#26504)

Co-authored-by: Cole Miller <cole@zed.dev>

gcp-cherry-pick-bot[bot] and Cole Miller created

4d521a6 git: Prevent up and down motions leaking out of the commit editor (cherry-pick #26501) (#26509)

gcp-cherry-pick-bot[bot] created

a34e00e Fix git panel entries getting cut off (cherry-pick #26499) (#26500)

Click to expand commit body
Cherry-picked Fix git panel entries getting cut off (#26499)

Closes #26497 

Release Notes:

- N/A

Co-authored-by: Cole Miller <cole@zed.dev>

gcp-cherry-pick-bot[bot] and Cole Miller created

6ef3870 git_ui: Truncate long repository and branch names for respective selectors in panel (cherry-pick #26483) (#26488)

Click to expand commit body
Cherry-picked git_ui: Truncate long repository and branch names for
respective selectors in panel (#26483)

This PR fixes a long repo name pushing the branch selector off the
screen, as well as just generally truncating them down in a way smarter
than a fixed character limit when long.

| Before | After |
|---------|-----------|
| ![CleanShot 2025-03-11 at 17 21

31@2x](https://github.com/user-attachments/assets/8762b5a7-883c-4080-a6cf-e8007c4737e7)
| ![CleanShot 2025-03-11 at 17 21

44@2x](https://github.com/user-attachments/assets/c3904c29-d939-445f-b700-5bf73f257256)
|


Release Notes:

- Git Panel: Smart truncate long branch and repository names in their
respective selectors

Co-authored-by: Nate Butler <iamnbutler@gmail.com>

gcp-cherry-pick-bot[bot] and Nate Butler created

7024784 Fix conflict marker in project diff view (cherry-pick #26466) (#26492)

Click to expand commit body
Cherry-picked Fix conflict marker in project diff view (#26466)

Closes #ISSUE

Release Notes:

- N/A

Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>

gcp-cherry-pick-bot[bot] , Conrad Irwin , and Max Brunsfeld created

c5c3c79 git_ui: Panel Horizontal Scroll (cherry-pick #26402) (#26496)

Click to expand commit body
Cherry-picked git_ui: Panel Horizontal Scroll (#26402)

Known Issues:
- When items can horizontal scroll, the right selected border is hidden

TODO:
- [ ] Width calculation is off
- [ ] When scrollbars should autohide they don't until hovering the
panel
- [ ] When switching to and from scrollbar track being visible we are
missing a notify somewhere.

Release Notes:

- Git Panel: Added horizontal scrolling in the git panel

---------

Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
Co-authored-by: Cole Miller <m@cole-miller.net>
Co-authored-by: Cole Miller <cole@zed.dev>

Co-authored-by: Nate Butler <iamnbutler@gmail.com>
Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
Co-authored-by: Cole Miller <m@cole-miller.net>
Co-authored-by: Cole Miller <cole@zed.dev>

gcp-cherry-pick-bot[bot] , Nate Butler , Max Brunsfeld , Cole Miller , and Cole Miller created

bbea043 Git panel editor scroll (cherry-pick #26465) (#26493)

Click to expand commit body
Cherry-picked Git panel editor scroll (#26465)

Release Notes:

- N/A

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>

gcp-cherry-pick-bot[bot] and Conrad Irwin created

b7a242b Tweak stage/unstage-and-next to start a commit instead of wrapping in the project diff editor (cherry-pick #26434) (#26490)

Click to expand commit body
Cherry-picked Tweak stage/unstage-and-next to start a commit instead of
wrapping in the project diff editor (#26434)

Release Notes:

- Git Beta: improved the stage-and-next and unstage-and-next actions in
the project diff editor to start a commit after acting on the last hunk

Co-authored-by: Cole Miller <cole@zed.dev>

gcp-cherry-pick-bot[bot] and Cole Miller created

ac209f1 zed 0.177.7

Joseph T. Lyons created

44a43c7 Address out-of-bounds panic in inline completion button (cherry-pick #26394) (#26440)

Click to expand commit body
Cherry-picked Address out-of-bounds panic in inline completion button
(#26394)

Closes #26350

Release Notes:

- Git Beta: Fixed a panic that could occur when using the project diff

Co-authored-by: Cole Miller <cole@zed.dev>

gcp-cherry-pick-bot[bot] and Cole Miller created

74c1ec5 Show a disabled stage all button for no entries (cherry-pick #26436) (#26437)

Click to expand commit body
Cherry-picked Show a disabled stage all button for no entries (#26436)

Closes #ISSUE

Release Notes:

- N/A

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>

gcp-cherry-pick-bot[bot] and Conrad Irwin created

61187a9 Fix enter binding in git panel's commit editor on Linux (cherry-pick #26427) (#26438)

Click to expand commit body
Cherry-picked Fix enter binding in git panel's commit editor on Linux
(#26427)

Closes #26110 

Release Notes:

- Git Beta: fixed being unable to enter newline in the git panel's
commit editor on Linux

Co-authored-by: Cole Miller <cole@zed.dev>

gcp-cherry-pick-bot[bot] and Cole Miller created

2da767d Go back to "create branch" in the list (#26433)

Click to expand commit body
Closes #ISSUE

Release Notes:

- N/A

Conrad Irwin created

58bb9f3 Git commit modal branch list (cherry-pick #26417) (#26435)

Click to expand commit body
Cherry-picked Git commit modal branch list (#26417)

Closes #26273

Release Notes:

- git: Fixes opening the branch selector in the commit modal with
cmd-option-b
- git: Truncates the branch selector in the commit modal

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>

gcp-cherry-pick-bot[bot] and Conrad Irwin created

8c3585d git_ui: Show more information in the branch picker (cherry-pick #25359) (#26432)

Click to expand commit body
Cherry-picked git_ui: Show more information in the branch picker
(#25359)

Final product:

![CleanShot 2025-02-26 at 9  08

17@2x](https://github.com/user-attachments/assets/e5db1932-b2c6-4b32-ab67-ef0a0d19f022)

Release Notes:

- Added more information about Git branches to the branch picker.

---------

Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
Co-authored-by: Marshall Bowers <git@maxdeviant.com>
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>

Co-authored-by: Angelk90 <20476002+Angelk90@users.noreply.github.com>
Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
Co-authored-by: Marshall Bowers <git@maxdeviant.com>
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>

gcp-cherry-pick-bot[bot] , Angelk90 , Danilo Leal , Marshall Bowers , and Conrad Irwin created

1365247 Use current upstream for permalink to line (cherry-pick #26398) (#26429)

Click to expand commit body
Cherry-picked Use current upstream for permalink to line (#26398)

Release Notes:

- git: Copy permalink to line now uses the upstream of the current
branch instead of "origin"

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>

gcp-cherry-pick-bot[bot] and Conrad Irwin created

f4028ef Unwind deprecated permalinks code (cherry-pick #26395) (#26426)

Click to expand commit body
Cherry-picked Unwind deprecated permalinks code (#26395)

Release Notes:

- N/A

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>

gcp-cherry-pick-bot[bot] and Conrad Irwin created

7fa916a Fix race conditions in updating buffer diffs on git changes (#26409)

Click to expand commit body
Release Notes:

- N/A

---------

Co-authored-by: Cole Miller <m@cole-miller.net>

Max Brunsfeld and Cole Miller created

198ecff Fix panic opening branch picker in commit modal (cherry-pick #26407) (#26413)

Click to expand commit body
Cherry-picked Fix panic opening branch picker in commit modal (#26407)

Closes #ISSUE

Release Notes:

- N/A

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>

gcp-cherry-pick-bot[bot] and Conrad Irwin created

a4b9b5d Git commit modal command (cherry-pick #26405) (#26411)

Click to expand commit body
Cherry-picked Git commit modal command (#26405)

Fix KeyBinding::for_action() to use the active focus handle instead of
what was
rendered last.

This makes the UI consistently chose the cmd-escape binding for close
(because escape in the editor is editor::Cancel?),
so force it to be "escape"

Release Notes:

- git: Fixed escape tooltip in commit modal

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>

gcp-cherry-pick-bot[bot] and Conrad Irwin created

633df53 Add a missing notify when updating the project diff (cherry-pick #26396) (#26400)

Click to expand commit body
Cherry-picked Add a missing notify when updating the project diff
(#26396)

Closes #ISSUE

Release Notes:

- Git Beta: Fixed a bug that caused the project diff not to update in
response to git-related events

Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>

Co-authored-by: Cole Miller <cole@zed.dev>
Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>

gcp-cherry-pick-bot[bot] , Cole Miller , and Max Brunsfeld created

790fb9e git_ui: Design Polish (#26361)

Click to expand commit body
Polish PR

- [ ] Horizontal scrollbar for git panel
- [ ] Allow shift clicking a checkbox in any section to stage the whole
section
- [ ] Clean up design of no changes/pending push state in panel
- [x] Ensure checkbox placeholder dot is centered in the checkbox
- [x] Improve spacing between elements in git panel entries
- [x] Update git branch icon to match branch selector text when disabled
- [x] Truncate last commit message less aggressively in panel
- [x] Clean up new panel header design
- [x] Remove `_background` version control keys (backgrounds are derived
from the foreground colors)

Before:

![CleanShot 2025-03-10 at 11 54
32@2x](https://github.com/user-attachments/assets/46b18f66-bb5c-435e-a0da-6cc931bd8a15)

After:

![CleanShot 2025-03-10 at 11 55
24@2x](https://github.com/user-attachments/assets/fcf688c7-b949-41a2-a7b8-1a198eb7fa4a)

Before:

![CleanShot 2025-03-10 at 12 02
14@2x](https://github.com/user-attachments/assets/1990f4b3-c2f0-4e02-89ad-211aaebb3821)

After:

![CleanShot 2025-03-10 at 12 02
53@2x](https://github.com/user-attachments/assets/9b1caf65-c48f-44c9-924b-484892fb543f)

Release Notes:

- N/A *or* Added/Fixed/Improved ...

---------

Co-authored-by: Cole Miller <cole@zed.dev>
Co-authored-by: Cole Miller <m@cole-miller.net>
Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>

Nate Butler , Cole Miller , Cole Miller , and Max Brunsfeld created

17c0113 Remove GitUiFeatureFlag and enable panel unconditionally (cherry-pick #26386) (#26392)

Click to expand commit body
Cherry-picked Remove GitUiFeatureFlag and enable panel unconditionally
(#26386)

Release Notes:

- git: Enable for everyone

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>

gcp-cherry-pick-bot[bot] and Conrad Irwin created

cb8d667 Scroll project diff into view always (cherry-pick #26379) (#26387)

Click to expand commit body
Cherry-picked Scroll project diff into view always (#26379)

Closes #ISSUE

Release Notes:

- N/A

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>

gcp-cherry-pick-bot[bot] and Conrad Irwin created

6d79434 Git keyboard shortcuts (#26374)

Click to expand commit body
Closes #26040

Release Notes:

- git: Add keyboard shortcuts (when the panel is open) for fetch `ctrl-g
ctrl-g`, pull `ctrl-g down`, push `ctrl-g up`, force-push `ctrl-g
shift-up`, open diff `ctrl-g d`

Conrad Irwin created

d474438 Restore git panel header (cherry-pick #26354) (#26380)

Click to expand commit body
Cherry-picked Restore git panel header (#26354)

Let's play around with it. This should not be added to tomorrow's
preview.

Release Notes:

- Git Beta: Added a panel header with an open diff and stage/unstage all
buttons.

Co-authored-by: Mikayla Maki <mikayla@zed.dev>

gcp-cherry-pick-bot[bot] and Mikayla Maki created

c21ab40 git: Pass project environment to git binary invocations (cherry-pick #26301) (#26373)

Click to expand commit body
Cherry-picked git: Pass project environment to git binary invocations
(#26301)

Closes #26213 

Release Notes:

- Git Beta: pass down environment variables from project to git
operations

Co-authored-by: Cole Miller <cole@zed.dev>

gcp-cherry-pick-bot[bot] and Cole Miller created

4b24ef3 zed 0.177.6

Joseph T. Lyons created

1d7ffff Remove redundant checks in `do_stage_or_unstage_and_next` (#26364)

Click to expand commit body
Release Notes:

- N/A

João Marcos created

44c93b0 git_ui: Branch picker improvements (cherry-pick #26287) (#26371)

Click to expand commit body
Cherry-picked git_ui: Branch picker improvements (#26287)

- Truncate branch names based on the width of the picker
- Use a footer for "Create branch" instead of a picker entry

Still to do:

- [x] Select the footer button when no matches and run the create logic
on `enter`
- [x] Make it possible to quickly select the footer button from the
keyboard when there are matches

Release Notes:

- Git Beta: Removed limitation that made it impossible to create a
branch from the branch picker when it too closely resembled an existing
branch name

Co-authored-by: Cole Miller <cole@zed.dev>

gcp-cherry-pick-bot[bot] and Cole Miller created

4144a2e git: Disable commit message generation when commit not possible (#26329)

Click to expand commit body
## Issue:

- `Generate Commit Message` will generate a random message if there are
no changes.
<img width="614" alt="image"
src="https://github.com/user-attachments/assets/c16cadac-01af-47c0-a2db-a5bbf62f84bb"
/>


## After Fixed:

- `Generate Commit Message` will be disabled if commit is not possible
<img width="610" alt="image"
src="https://github.com/user-attachments/assets/5ea9ca70-6fa3-4144-ab4e-be7a986d5496"
/>


## Release Notes:

- Fixed: Disable commit message generation when commit is not possible

Richard Hao created

1eff87c Follow-up fixes for recent multi buffer optimizations (#26345)

Click to expand commit body
I realized that the optimization broke multi buffer syncing after buffer
reparses.

Release Notes:

- N/A

Max Brunsfeld created

2599713 git: Refine diff hunk controls visuals (#26317)

Click to expand commit body
You may need to zoom in hard to see this 😅 but the main addition of this
PR is just ensuring there's also horizontal border instead of just on
the bottom. Also added some box-shadow here to make it pop out of the
diff a bit more.

| Before | After |
|--------|--------|
| ![CleanShot 2025-03-08 at 12  37
40@2x](https://github.com/user-attachments/assets/98e0329e-646f-4455-89fa-3f6ec1211361)
| ![CleanShot 2025-03-08 at 12  36
40@2x](https://github.com/user-attachments/assets/7f667e65-5b72-4156-b0ec-2b162eb76f2f)
|

Release Notes:

- N/A

Danilo Leal created

ea2df99 Fix performance bottlenecks when multi buffers have huge numbers of buffers (#26308)

Click to expand commit body
This is motivated by trying to make the Project Diff view usable with
huge Git change sets.

Release Notes:

- Improved performance of rendering multibuffers with very large numbers
of buffers

Max Brunsfeld created

6c574fa Git UI papercuts (#26316)

Click to expand commit body
Release Notes:

- Git Beta: added `git:Add` as an alias for the existing `git::Diff`
- Git Beta: Fixed a bug where the 'generate commit message' keybinding
wasn't working.
- Git Beta: Made the empty project diff state a little more helpful with
a button to push, and a button to close the item.

Mikayla Maki created

783e239 Add git branch switching aliases (#26315)

Click to expand commit body
This gives us _very_ rudimentary support for `git switch` and `git
checkout` now, by making them aliases for our existing `git::branch`
call.

Release Notes:

- Git Beta: Added `git::Switch` and `git::CheckoutBranch` as aliases for
the existing `git::Branch`

Mikayla Maki created

4c455ca Improve when the commit suggestions would show (#26313)

Click to expand commit body
Release Notes:

- Git Beta: Fixed a few bugs where the suggested commit text wouldn't
show in certain cases, or would update slowly.

Mikayla Maki created

270e47c git: Fix errors not showing in the toast notification (#26303)

Click to expand commit body
Release Notes:

- Resolved an issue where error messages from Git were not being
displayed in toast notifications.
<img width="1702" alt="Screenshot 2025-03-08 at 1 11 30 AM"
src="https://github.com/user-attachments/assets/a46517db-4e64-4c5e-a64e-96e820ca9aec"
/>

Kiran_Peraka created