Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Reordering history can accidentally "merge" an intermediate PR in `--direct` mode

クローズ
#367 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
活発
技術スタック
git, github, python
領域
cli

調査の方向性

提供された foo.sh スクリプトを使い、ghstack --direct と origin/main に対する対話的な並べ替えの繰り返しによって失敗を再現します。並べ替えに関係する stack の更新と GitHub PR のステータス変更を追跡します。2 番目と 3 番目のコミットの入れ替えを繰り返しても中間の PR が merged としてマークされなくなれば完了です。

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

説明

Haven't put a lot of time into understanding this one, was just trying to evaluate ghstack for work on LLVM. The issue was that while editing and reordering commits, one of their PRs was automatically marked "Merged", when I had not merged anything. I assume this is due to the lack of an atomic way to update base branches for several PRs at once, but unsure the exact cause.

Simplest way to reproduce turned out to be to just swap the position of two commits in a stack repeatedly:

#!/bin/bash

stack() {
  ghstack --direct || return 1
  # attempt to rule out racing against a slow GH or something, doesn't seem to
  # matter, and I hit the bug originally while just using the tool by-hand
  #sleep 10
}

swap2() {
  # swap the 2nd and 3rd `pick` lines in the interactive rebase buffer
  GIT_EDITOR='printf "%s\n" 2y 2d x w | ed -s' git rebase -i origin/main
}

init() {
  for n in $(seq 4); do
    echo $n >> $n && git add -A && git commit -m $n || return 1
  done
}

whirl() {
  # seems to pretty regularly break on round 3, but add plenty to be sure.
  # not actually clear to me if this is deterministic or not
  for n in $(seq 10); do
    stack && swap2 || {
      printf 'failed on round %d\n' $n
      return 1
    }
  done
}

main() {
  init && whirl
}

"$@"

Can run as foo.sh main to have it build a short stack and then start swapping and restacking until it breaks.

If there is more info I can share, let me know. I only spent enough time to be sure I wasn't just holding it wrong.

主要言語
Python
スター
1k
フォーク
84
平均マージ
10分
マージ済み PR(30日)
1

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

ezyang/ghstack のほかの issue

ezyang/ghstack の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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