weird git behavior with this repo

オープン 初心者向け
#12,804 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

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

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
68/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
git, python, shell

調査の方向性

まずリポジトリで git status と git ls-files を実行し、追跡されているパスの中で大文字と小文字だけが異なる名前を確認します。この issue では、git update-index --skip-worktree を使用する shell/Python の回避策提到了。特定のファイルやテストは指定されていません。完了とは、変更前にリポジトリが数十個のファイルを変更済みとして報告しなくなり、競合するパスがすべて特定され、一貫した方法で処理された状態を指します。

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

説明

For some reason, this repository specifically, triggers git status to believe that dozens of files are modified, even before I make any changes.

I'm having to work around this quirk with Gemini generated shell commands:

git ls-files -z | python3 -c '
import sys, subprocess
from collections import defaultdict

paths = [p.decode() for p in sys.stdin.buffer.read().split(b"\0") if p]
by_low = defaultdict(list)
for p in paths:
    by_low[p.lower()].append(p)

targets = [p for group in by_low.values() if len(group) > 1 for p in group]
for i in range(0, len(targets), 20):
    batch = targets[i:i+20]
    subprocess.run(["git", "update-index", "--skip-worktree", *batch], check=True)

print(f"Updated {len(targets)} paths")
'

Never had this problem when forking and contributing to any other repo, just AppImage/appimage.github.io.

I tried all manner of gentler commands to fix git status, such as git restore ., with no effect.

Curious if we may have a casing issue with some of the files in the repo. It's not good form to have multiple sibling file paths that differ only in case. If so, then we need to incrementally select more unique filenames for each of the conflicts.

zsh on macOS, in case that matters.

% cat ~/.gitconfig
[core]
        editor = vi
        excludesfile = /Users/andrew/.gitignore-global
        ignorecase = false

[push]
        default = simple

[branch]
        autosetuprebase = always

# [color]
#       ui = auto

[merge]
        ff = true

[pull]
        rebase = true

[mergetool]
        keepBackup = false

[user]
        name = Andrew Pennebaker
        email = [email protected]
        signingkey = 8E363EAD6BBCDCBC

[init]
        defaultBranch = main
[commit]
        gpgsign = true
[tag]
        gpgSign = true
[log]
        showSignature = true
主要言語
Shell
スター
448
フォーク
928
平均マージ
16時間 17分
マージ済み PR(30日)
518

環境構築

はじめの一歩

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

AppImage/appimage.github.io のほかの issue

AppImage/appimage.github.io の issue をすべて見る

似ている issue

Shell/Bash の issue をもっと見る

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

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