Can't pull student repos
まだ誰も着手していません。
評価
調査の方向性
提供されたデバッグ出力を参考にして、gh classroom clone student-repos に続けて gh classroom pull student-repos を実行し、失敗を再現します。まず、git fetch upstream refs/heads/master と git merge-base --is-ancestor の周辺にある pull の処理経路を追跡します。完了の条件は、リポジトリが正常に更新され、変更されていないリポジトリで分岐した変更が報告されなくなることです。
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
I cannot pull updates in students assignment using gh classroom pull student-repos -a ... command. It says:
failed to run gh: can't sync because there are diverging changes; use `--force` to overwrite the destination branch
. error: exit status 1
however, there are no diverging changes. It also does not work when there are no updates, as shown here:
$ gh classroom clone student-repos
? Select a classroom: XXXX
? Select an assignment: YYYY
Creating directory: /ZZZZ-submissions
Cloning into: /ZZZZ-submissions/ZZZ-AAA
Cloning into: /ZZZZ-submissions/ZZZ-BBB
Cloned 2 repos.
$ gh classroom pull student-repos
? Select a classroom: XXXX
? Select an assignment: YYYY
Pulling repo: /ZZZZ-submissions/ZZZ-AAA
failed to run gh: can't sync because there are diverging changes; use `--force` to overwrite the destination branch
. error: exit status 1
Pulling repo: /ZZZZ-submissions/ZZZ-BBBB
failed to run gh: can't sync because there are diverging changes; use `--force` to overwrite the destination branch
. error: exit status 1
$ gh --version
gh version 2.52.0 (2024-07-15)
https://github.com/cli/cli/releases/tag/v2.52.0
$ gh extension list
NAME REPO VERSION
gh act nektos/gh-act v0.2.55
gh classroom github/gh-classroom v0.1.14
Steps to reproduce the behavior
- Clone students repositories using
gh classroom clone .... - (Optional) Modify the reference repository and request Pull Request, accept it.
- Try to pull repository again
Expected vs actual behaviour
I would expect all repositories to be updated. Now I need to update them manually, which works ok (no diverging changes).
Logs
Paste the activity from your command line. Redact if needed.
$GH_DEBUG=true gh classroom pull student-repos -a AAAAAA
* Request at 2024-07-23 13:35:52.177507471 +0200 CEST m=+0.028484741
* Request to https://api.github.com/assignments/AAAAAA
* Request took 414.42728ms
Pulling repo: XXXXXX
failed to run gh: [git remote -v]
[git config --get-regexp ^remote\..*\.gh-resolved$]
[git remote -v]
[git config --get-regexp ^remote\..*\.gh-resolved$]
* Request at 2024-07-23 13:35:52.616066256 +0200 CEST m=+0.020500993
* Request to https://api.github.com/graphql
* Request took 295.087327ms
[git -c credential.helper= -c credential.helper=!"/usr/bin/gh" auth git-credential fetch -q upstream refs/heads/master]
[git rev-parse --verify refs/heads/master]
[git merge-base --is-ancestor master FETCH_HEAD]
can't sync because there are diverging changes; use `--force` to overwrite the destination branch
. error: exit status 1
The command was executed in the same directory where gh classroom clone student-repos --all was executed before.
- 主要言語
- Go
- スター
- 126
- フォーク
- 21
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
github/gh-classroom のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 70/100
github/gh-classroom#95 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
github/gh-classroom#21 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
github/gh-classroom#116 · コメント 3 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
github/gh-classroom#110 ·
-
Sanitize Team name オープン
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
github/gh-classroom#109 ·
github/gh-classroom の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 60/100
github/gh-aw-mcpg#13748 ·
-
agentic-workflows
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
googleapis/librarian#7670 · コメント 2 件 ·