Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

[Bug]: graphify reads files that git's global ignore file hides

Đã đóng Phù hợp với người mới
#4,335 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

  • #4339 của @smngvlkz — đã đóng, không merge

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
72/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
git, python
Lĩnh vực
tooling

Hướng nghiên cứu

Tìm đoạn mã đọc .gitignore và .git/info/exclude, rồi theo dõi cách graphify update . quyết định những tệp nào cần đưa vào. Kiểm tra cách Git cung cấp core.excludesFile và cách --no-gitignore được áp dụng. Công việc hoàn tất khi các tệp bị ẩn bởi tệp loại trừ toàn cục đã cấu hình được bỏ qua, đồng thời --no-gitignore vẫn giữ nguyên hành vi đã được tài liệu hóa.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

What's happening

graphify skips files listed in a project's .gitignore, but it doesn't look at git's global ignore file. So a file that git ignores on your machine can still end up in the graph.

I noticed it because a local settings file showed up in graphify's file list, even though git ignores it. The rule for it lives in my global ignore file at ~/.config/git/ignore, not in the project's .gitignore.

The global ignore file is where a lot of people keep rules for local settings and secret files, so they don't have to add them to every project. graphify reading those files is the part that worries me.

How to see it for yourself

mkdir demo && cd demo && git init
echo 'x = 1' > a.py
echo 'SECRET = "abc"' > secret.py
echo 'secret.py' > ~/my-ignore
git config core.excludesFile ~/my-ignore

git status --short        # secret.py isn't listed, git ignores it
graphify update .

secret.py is in graphify-out/graph.json.

I used git config inside the repo so the example doesn't touch your global settings. It's the same setting git uses for the global ignore file, and ~/.config/git/ignore behaves the same way.

What should happen

If git ignores a file, graphify should skip it too, the same way it already does for .gitignore and .git/info/exclude. --no-gitignore could keep turning this off like it does for the others.

This came up before as a suggestion in #1363, but only the fix for .gitignore and .graphifyignore working together went in.


Version: graphify 0.9.85 · macOS 26.4 · Python 3.14

Ngôn ngữ chính
Python
Star
124k
Fork
11.9k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Graphify-Labs/graphify

Tất cả issue của Graphify-Labs/graphify

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.