TL;DR
Git2KG is an extensible Python library that bridges the gap between code-level history and social interaction by mining GitHub repositories into Temporal Knowledge Graphs (TKGs). By aligning Git commit logs with GitHub issue tracker data, it allows researchers to analyze how developer communication and fine-grained code contributions evolve together over time.
What Problem Does This Paper Address?
Open Source Software (OSS) development is a "socio-technical" process: it involves both technical artifacts (code, files, commits) and social interactions (issue discussions, code reviews, mentions). Traditionally, researchers have studied these in silos. You might have a "people network" based on who comments on whose issues, or a "co-authorship network" based on who edits the same files.
However, these fragmented views miss the bigger picture. Furthermore, most existing tools provide a static, time-aggregated view of a project, which ignores the temporal dynamics—how a team’s behavior shifts during a release cycle or a security crisis. The authors identify a need for a unified tool that handles identity disambiguation (linking a Git email to a GitHub username) and supports temporal analysis out of the box.
Methods
Git2KG builds a multi-relational graph with four primary node types: Actors, Commits, Files, and Issues.
Key technical components include:
- Unified Schema: It extracts 20 different relation types (e.g.,
edit_add,mentions,assigned_to). Notably, it uses line-level co-editing relations rather than just file-level authorship, providing a higher-resolution view of collaboration. - Identity Alignment: To connect the subgraphs, Git2KG uses a tool called
gambitfor string-similarity matching of names and emails, supplemented by GitHub’s commit API to link private emails to public accounts. - Time Slicing: The library slices development events into configurable, non-overlapping time windows (snapshots). This transforms a static graph into a TKG.
- Extensible Pipeline: It includes engines for computing node features and labels, making it a "one-stop-shop" for preparing data for Graph Neural Networks (GNNs). It exports directly to popular frameworks like PyTorch Geometric, PathPyG, and NetworkX.
Datasets
The authors demonstrated Git2KG using the xz-utils repository, a high-profile project that gained notoriety in early 2024 due to a malicious backdoor discovery. The dataset used for demonstration included:
- 3,142 commits
- 447,650 line edits
- 252 issues with 1,131 comments
- 244 code reviews
Key Insights and Ideas
- The Actor as the Bridge: The "Actor" entity is the only one present in both Git and GitHub data. Successful alignment is the "secret sauce" that turns two disconnected graphs into a single socio-technical knowledge graph.
- Visualizing Crisis: By comparing snapshots, the authors show how a project's "shape" changes. In a normal month (Feb 2024), the graph is dominated by code-related edges. In the month the backdoor was discovered (March 2024), the graph explodes with social communication edges.
- Fine-Grained Collaboration: By tracking line-level edits (
edit_add/edit_delete), the tool captures actual collaboration between developers working on the same parts of a file, which is much more precise than simply noting they both touched the same large file.
Key Results
- Mining Performance: The library utilizes multiprocessing to handle the computationally expensive task of parsing Git logs. Using 16 cores resulted in a 3.6x speedup for overall data loading, with the "edits" extraction stage seeing a 4.38x speedup.
- Alignment Validation: The evaluation showed that in most snapshots, actors active in the Git log were successfully aligned with active GitHub accounts, confirming that the socio-technical subgraphs are well-connected.
Limitations and Future Work
While Git2KG is a powerful mining tool, the authors note several limitations:
- Lack of Semantics: The tool tracks that code was changed, but not what the code does (program semantics) or its structural quality.
- Missing Data Sources: It currently does not incorporate Continuous Integration (CI) outcomes, repository forks, or line-level review comments.
- API Volatility: Because it relies on the GitHub GraphQL and REST APIs, it is subject to changes in GitHub's external interface.
Future work aims to use Git2KG for large-scale ecosystem analyses and predictive tasks, such as forecasting developer turnover or identifying high-risk code changes.
Summary updated