gitui-org / gitui-org/gitui

Doesn't appear to push to multiple remotes, unlike `git push`

オープン
#1,306 コメント 7 件 リアクション 0 件 担当者 0 名 GitHub で見る
bug help wanted
主要言語
Rust
スター
22.5k
フォーク
773
PR マージ指標
30日以内にマージされた PR はありません

説明

**Describe the bug**
I have multiple git remotes, as described in https://seirdy.one/posts/2020/11/18/git-workflow-1/

The repo in question is https://git.sr.ht/~skyfaller/twentyeleven-skyfaller

My `.git/config` looks like this:

```
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
url = git@git.sr.ht:~skyfaller/twentyeleven-skyfaller
fetch = +refs/heads/*:refs/remotes/origin/*
url = git@codeberg.org:skyfaller/twentyeleven-skyfaller.git
url = git@github.com:skyfaller/twentyeleven-skyfaller.git
[branch "master"]
remote = origin
merge = refs/heads/master
[remote "gh_mirror"]
url = git@github.com:skyfaller/twentyeleven-skyfaller.git
fetch = +refs/heads/*:refs/remotes/gh_mirror/*
[remote "cb_mirror"]
url = git@codeberg.org:skyfaller/twentyeleven-skyfaller.git
fetch = +refs/heads/*:refs/remotes/cb_mirror/*
```
When I make changes to my git repo, and use gitui to `Push [p]`, it only pushes to one remote, in this case GitHub / `gh_mirror`.

It appears it pushes to the remote which is listed last. This doesn't parallel git's behavior, git prioritizes the URL that is listed first when pulling:

```
> git pull origin -v
From git.sr.ht:~skyfaller/twentyeleven-skyfaller
= [up to date] master -> origin/master
= [up to date] static -> origin/static
Already up to date.
```
But since gitui should push to all of the URLs rather than picking one anyway, this isn't important.

When I use `git push` after using gitui to push, I see:

```
> git push
Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Delta compression using up to 8 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 468 bytes | 468.00 KiB/s, done.
Total 3 (delta 2), reused 0 (delta 0), pack-reused 0
To git.sr.ht:~skyfaller/twentyeleven-skyfaller
e714d73..0370dee master -> master
Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Delta compression using up to 8 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 468 bytes | 468.00 KiB/s, done.
Total 3 (delta 2), reused 0 (delta 0), pack-reused 0
remote: . Processing 1 references
remote: Processed 1 references in total
To codeberg.org:skyfaller/twentyeleven-skyfaller.git
e714d73..0370dee master -> master
Everything up-to-date
```
As you can see, `git push` is successfully pushing to the other remotes that `gitui` did not.

**Expected behavior**
I expect the behavior of `git push` and gitui's "Push" function to be identical.

**Context (please complete the following information):**
- OS/Distro + Version: Fedora Linux 36 (Workstation Edition) x86_64
- GitUI Version: gitui 0.21.0 (installed from Linuxbrew)

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

Start by reproducing the report with the provided .git/config, multiple remotes, and the GitUI 0.21.0 Push action, then compare it with `git push`. Trace the push entry point and existing tests for remote handling; done means one push sends updates to all configured push URLs as Git does.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
git, rust
領域
cli
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。