Skip to content

Conversation

@rufevean
Copy link
Contributor

@rufevean rufevean commented Aug 23, 2025

Summary

  • Auto-activates the active repository when opening a buffer.
  • Prepares branching for future support of a user choice (e.g., auto_activate_repo_on_open flag).

Release Notes

  • Improved: Opening a buffer now automatically updates the active repository.
@cla-bot
Copy link

cla-bot bot commented Aug 23, 2025

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: deeraj.chowdary.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email email@example.com
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails
@rufevean rufevean force-pushed the fix/auto-change-repo-in-git-panel branch from ae9e953 to de4640f Compare August 23, 2025 07:54
@cla-bot
Copy link

cla-bot bot commented Aug 23, 2025

We require contributors to sign our Contributor License Agreement, and we don't have @rufevean on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'.

@rufevean
Copy link
Contributor Author

@cla-bot check

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Aug 23, 2025
@cla-bot
Copy link

cla-bot bot commented Aug 23, 2025

The cla-bot has been summoned, and re-checked this pull request!

@maxdeviant maxdeviant changed the title fix : repo changes automatically with change in file buffer Aug 23, 2025
@zed-industries-bot
Copy link

zed-industries-bot commented Aug 25, 2025

Warnings
⚠️

This PR is missing release notes.

Please add a "Release Notes" section that describes the change:

Release Notes:

- Added/Fixed/Improved ...

If your change is not user-facing, you can use "N/A" for the entry:

Release Notes:

- N/A

Generated by 🚫 dangerJS against 4fd612b

Copy link
Member

@cole-miller cole-miller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @rufevean, this seems like a good improvement! There are a couple of changes needed to get it ready to merge:

  • I don't think BufferOpened is the right event to listen for; we should use WorkspaceEvent::ActiveItemChanged, which is emitted (for example) when you switch to a different tab, whereas BufferOpened is only opened when you open a new buffer for a file.
  • When ActiveItemChanged happens, we should call Workspace::active_project_path to get a ProjectPath, and then GitStore::repository_and_path_for_project_path to resolve the new active repository.
@rufevean
Copy link
Contributor Author

@cla-bot check

@cla-bot
Copy link

cla-bot bot commented Sep 28, 2025

The cla-bot has been summoned, and re-checked this pull request!

@cole-miller
Copy link
Member

Thanks!

@cole-miller cole-miller enabled auto-merge (squash) October 2, 2025 14:10
@cole-miller cole-miller merged commit d8698df into zed-industries:main Oct 2, 2025
22 checks passed
LivioGama pushed a commit to LivioGama/zed that referenced this pull request Oct 11, 2025
…d-industries#36796)

### Summary

* Auto-activates the active repository when opening a buffer.
* Prepares branching for future support of a user choice (e.g.,
`auto_activate_repo_on_open` flag).

### Release Notes

* **Improved**: Opening a buffer now automatically updates the active
repository.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement

3 participants