Home » Posts tagged "repository"

GitHub 上有大量重複的程式碼...

扣除掉 fork 的程式碼後,研究人員在 GitHub 上還是發現有大量重複的程式碼:「DéjàVu: a map of code duplicates on GitHub」。

This paper analyzes a corpus of 4.5 million non-fork projects hosted on GitHub representing over 482 million files written in Java, C++, Python, and JavaScript. We found that this corpus has a mere 85 million unique files.

Java/C++/Python/JavaScript 寫的 4.5M 個專案有 482M 個檔案,但只有 85M 個檔案是不一樣的 XD

想一想其實也是... 現在愈來愈多工具產生程式碼了 XD (i.e. Scaffold)

Microsoft 與 GitHub 合作,將會把 GVFS 移植到 Linux 與 Mac 上

MicrosoftGitHub 合作將本來只有在 Windows 上可以用的 GVFS 移植到 LinuxMac 上:「Microsoft and GitHub team up to take Git virtual file system to macOS, Linux」。

GVFS 是解決微軟內部自己在用 Git 的痛處,因為微軟的 repository 都... 有... 點... 肥... (畢竟有不少產品發展了很久)。

目前 Git 的操作是卡在 I/O 與 memory cache 的限制上:

Also, Git wasn't designed for a codebase that was so large, either in terms of the number of files and version history for each file, or in terms of sheer size, coming in at more than 300GB. When using standard Git, working with the source repository was unacceptably slow. Common operations (such as checking which files have been modified) would take multiple minutes.

GVFS 的想法是有用到的部份再真的去拉,藉此大幅減少 I/O 需求...

在 Git/Mercurial/Subversion 上 "-" 發生的問題

在「[ANNOUNCE] Git v2.14.1, v2.13.5, and others」這邊看到 - 開頭產生的問題:

These contain a security fix for CVE-2017-1000117, and are released in coordination with Subversion and Mercurial that share a similar issue. CVE-2017-9800 and CVE-2017-1000116 are assigned to these systems, respectively, for issues similar to it that are now addressed in their part of this coordinated release.

這算是老問題了,Git 對應的修正主要是朝 filter input 的方向修正,包括了禁用 - 開頭的 hostname,以及禁止 GIT_PROXY_COMMAND- 開頭,另外是禁止開頭是 - 的 repository name:

  • A "ssh://..." URL can result in a "ssh" command line with a hostname that begins with a dash "-", which would cause the "ssh" command to instead (mis)treat it as an option. This is now prevented by forbidding such a hostname (which should not impact any real-world usage).
  • Similarly, when GIT_PROXY_COMMAND is configured, the command is run with host and port that are parsed out from "ssh://..." URL; a poorly written GIT_PROXY_COMMAND could be tricked into treating a string that begins with a dash "-" as an option. This is now prevented by forbidding such a hostname and port number (again, which should not impact any real-world usage).
  • In the same spirit, a repository name that begins with a dash "-" is also forbidden now.

然後中華電信的 DNS server ( & 都查不到 marc.info,改用 Google 的 才查得到... =_=

GitHub 的整合性平台

GitHub 宣佈了 Marketplace,一個將各種外部 plugin 資訊整合起來的平台,讓開發者更容易尋找有哪些工具可以幫助開發:「Introducing GitHub Marketplace and more tools to customize your workflow」。

GitHub Marketplace is a new way to discover and purchase tools that extend your workflow. Find apps to use across your development process, from continuous integration to project management and code review.


  • Code quality
  • Code review
  • Continuous integration
  • Monitoring
  • Project management

不過看了一下,目前上 Marketplace 的還有點少,不知道是不是對於要上架的公司有另外收費...

AWS CodeCommit 總算支援東京區了...

AWS CodeCommit 宣佈支援東京、新加坡、雪梨、法蘭克福四個區域了:「AWS CodeCommit is Now Available in Asia Pacific (Tokyo), Asia Pacific (Singapore), Asia Pacific (Sydney), and EU (Frankfurt) Regions」。

AWS CodeCommit 算是純 Git Hosting 的服務,但可以很容易跟 Lambda 之類的東西整合,所以要串其他的服務也不難。之前一直沒用主要還是會抱怨他的 latency...

比較特別的地方是 SSH username 的地方需要用他產生出來的 name,需要在 ~/.ssh/config 裡面設定,會比較麻煩一些,其他的到是還好。

然後由於 SSH 是採用 Trust on first use 的概念,不像是透過 PKI 稽核架構有 Root CA,所以 AWS 有提供每個區域 CodeCommit 的 SSH Fingerprint,包括了 MD5 與 SHA256 的值:「Setup Steps for SSH Connections to AWS CodeCommit Repositories on Linux, macOS, or Unix」。

前五個 active user 提供這樣的量,對於個人應該是夠用:

Unlimited repositories
50 GB-month of storage
10,000 Git requests/month


$0.06 per GB-month
$0.001 per Git request

是可以考慮把一些 Private Repository 從 GitHub 上搬出來了... (當初買 GitHub 是因為他的穩定度比 Bitbucket 以及 GitLab.com 都好不少)

GitHub 可以在 repository 上加 tag 了

功能叫做 topics

GitHub 會透過機器學習的方式對公開的 repository 給建議:

Additionally, GitHub uses machine learning to analyze public repository content and generate suggested topics that repository admins can accept or reject. Private repository content is not analyzed and does not receive topic suggestions.