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 摘要。