git: Check push config before falling back to branch remote#41700
git: Check push config before falling back to branch remote#41700kubkon merged 5 commits intozed-industries:mainfrom
Conversation
|
Thanks! According to the docs it seems like we should be able to use |
|
@cole-miller seems like we could use: git rev-parse --abbrev-ref @{push}But it requires remote tracking set up for that branch, so it won't work for new branches being pushed for the first time. Wdyt?
|
|
It's okay if we don't select a remote automatically when the branch has no upstream and there's no git configuration indicating where it should be pushed--we have a fallback to open a picker for this situation (if that |
@cole-miller yeah, looks like it does. It goes in this order:
Here's a screenshot from my tests
Note that my Here's when
|
|
Thanks for the information! I think it makes sense that we'd honor The other thing is that I think we should separate out a |
1e47078 to
9816409
Compare
Nope, I think that's all.
Makes sense, I've updated it but instead of creating a separate function I added a |
|
Hmm, I think maybe a better structure would be
And then push the fallback to "get all remotes" to the callers--how does that sound? |
e8a1fff to
b7860c3
Compare
|
Sounds good, I've updated |
b7860c3 to
9e7f950
Compare
9e7f950 to
d1acfb0
Compare
kubkon
left a comment
There was a problem hiding this comment.
Looks great, thanks! In addition to some nits I left in my review, we still need to address missing support for remote projects. The entry point to that would be handle_get_remotes in git_store.rs which should unpack is_push from the message envelope. This will require adding is_push as a bool field in git.proto for message GetRemotes.
Co-authored-by: Jakub Konka <kubkon@jakubkonka.com>
Co-authored-by: Jakub Konka <kubkon@jakubkonka.com>
Co-authored-by: Jakub Konka <kubkon@jakubkonka.com>
…stries#41700) Closes zed-industries#26649 Release Notes: - Improved git support for remotes handling. Git will now check pushRemote and pushDefault configurations before falling back to branch remote. --------- Co-authored-by: Jakub Konka <kubkon@jakubkonka.com>



Closes #26649
Release Notes: