weird git behavior with this repo

未關閉 適合新手
#12,804 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
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 分鐘
30 天內合併 PR
518

環境準備

  • 沒有 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 閱讀貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

AppImage/appimage.github.io 的其他 Issue

查看 AppImage/appimage.github.io 的全部 Issue

相似的 Issue

更多 Shell/Bash Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。