惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

G
Google Developers Blog
宝玉的分享
宝玉的分享
月光博客
月光博客
B
Blog
云风的 BLOG
云风的 BLOG
Google DeepMind News
Google DeepMind News
Engineering at Meta
Engineering at Meta
aimingoo的专栏
aimingoo的专栏
N
Netflix TechBlog - Medium
博客园_首页
GbyAI
GbyAI
人人都是产品经理
人人都是产品经理
A
About on SuperTechFans
Y
Y Combinator Blog
L
LangChain Blog
有赞技术团队
有赞技术团队
D
Docker
爱范儿
爱范儿
博客园 - 司徒正美
H
Hackread – Cybersecurity News, Data Breaches, AI and More
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
酷 壳 – CoolShell
酷 壳 – CoolShell
Microsoft Security Blog
Microsoft Security Blog
D
DataBreaches.Net

hwchiu learning note Blog

Kubernetes 怎麼計算 imageFS | hwchiu learning note Nginx Proxy_Pass 不會重新查詢 DNS | hwchiu learning note Multus 下如何透過 network policy 設定 | hwchiu learning note Linux Bridge MTU | hwchiu learning note Kubevirt 初體驗 | hwchiu learning note [MacOS ]隨手筆記 Sed 與 Rename 的使用 | hwchiu learning note Docusaurus 使用 blog mode 後連結一直反白的問題 | hwchiu learning note gcloud 切換帳號 | hwchiu learning note k8s 內安裝 redis-cluster | hwchiu learning note Helm Chart 中如何根據條件來動態安裝 Template 內的物件 | hwchiu learning note GCS 操作上注意事項 | hwchiu learning note istio 操作記錄 | hwchiu learning note terraform | hwchiu learning note Kubernetes GKE 維運上小筆記 | hwchiu learning note Git 修改 author/committer | hwchiu learning note GCP NAT 相關筆記 | hwchiu learning note gcloud ssh 到 GCP VM | hwchiu learning note CloudSQL 收費注意事項 | hwchiu learning note Loki 安裝上的參數調整以及 Ring 的問題除錯 | hwchiu learning note kustomize + helm | hwchiu learning note 觀測 K8s 內 OOM 事件 | hwchiu learning note GKE 上的 RBAC 筆記 | hwchiu learning note 本地產生 jwt token | hwchiu learning note ArgoCD 安裝筆記 | hwchiu learning note CircleCI Context 的使用 | hwchiu learning note 透過 GCP IAP Gateway 來保護 GKE 內的網站 | hwchiu learning note 閱讀筆記: 「SRE 的工作介绍」 | hwchiu learning note 閱讀筆記: 「DevOps is a failure」 | hwchiu learning note 閱讀筆記: 「面試人生 - 設計一個簡易的分散式 Job Scheduler」 | hwchiu learning note 閱讀筆記: 「Cloudflare 06/21 災後報告」 | hwchiu learning note
閱讀筆記: 「GitHub 上常常看到的奇妙 commit 到底是什麼?」...
HungWei ChiuBlogger · 2022-02-11 · via hwchiu learning note Blog

標題: 「GitHub 上常常看到的奇妙 commit 到底是什麼?」 類別: others 連結: https://people.kernel.org/monsieuricon/cross-fork-object-sharing-in-git-is-not-a-bug

每過一段時間都可以於 GitHub 上面看到一些看起來很嚇人的 Commit,最經典莫過於 Linux Kernel 中的各種內容,譬如檔案被砍光,README 加入一些驚嚇言論 不知道情的使用者可能會想說這個內容是真正的 Github Repo 上的東西,鐵定是真正被認可而合併進去的,所以相信不疑。 殊不知這一切其實都只是 Git 的底層設計使得一些有心人可以打造出一些以假亂真的內容,文章中就有列出兩個關於 Linux Kernel 的有趣 Commit.

文章內詳細的去解釋整個來龍去賣以及底層 Git 的設計,包含 blob, tree, commit 之間的關係,並且說明為什麼有心人可以輕鬆的產生這些以假亂真的 Commit。 舉個範例來說,Linux Kernel 的整個 Git 專案大概有 3GB 的大小,然後被 Fork 的次數高達 40000 次,請問從實作方面來考量,你會希望

  1. 每個 Fork 有一份屬於自己的 Git 專案?
  2. 仰賴 Git 的底層設計,針對差異性去記錄每個 Fork 專案?

如果是選項(1)的話,那這樣至少要準備 120TB 的資料,從儲存方面來說完全不是一個可接受的實作方式,因此自然而然的都會是基於(2)的方式去實作 因此該 Linux Kernel 的 Git 專案實際上裡面記錄了所有的 Fork 資料,而每個人針對自己的 Fork 去進行更新等行為也都會記錄到 Linux Kernel 本身的專案上。 換句話說, 那 40000 個 Fork 出來的專案實際上還是共用同一份 Git 專案,因此每個人的 Commit 都只要該 Hash 被知道,其他人都有機會去檢視與瀏覽。

而 GitHub 的 UI 又允許使用者以 Commit Hash 的方式去瀏覽每一個 Commit 的內容,因此就可以跑到主要專案去輸入自己 Fork 產生的 Commit 來產生以假亂真的 Commit 內容。

對於整體有興趣的可以觀看全文