It is well-known that two git commits within a single repo can be independent from each other, by changing separate files to each other, or changing separate parts of the same file(s). Conversely when a commit changes a line, it is "dependent" on not only the commit which last changed that line, but also any commits which were responsible for providing the surrounding lines of context, because without those previous versions of the line and its context, the commit's diff would not cleanly apply.

As with most dependency relationships, these form a directed acyclic graph. Sometimes it is useful to understand the nature of parts of this graph; for example when porting a commit "A" between git branches via git cherry-pick, it can be useful to programmatically determine in advance the minimum number of other dependent commits which would also need to be cherry-picked to provide the context for commit "A" to cleanly apply.

Another use case might be to better understand levels of specialism / cross-functionality within an agile team. If I author a commit which modifies (say) lines 34-37 and 102-109 of a file, the authors of the dependent commits forms a list which indicates the group of people I should potentially consider asking to review my commit, since I'm effectively changing "their" code. Monitoring those relationships over time might shed some light on how agile teams should best coordinate efforts on shared code bases.

I'm sure there are other use cases I haven't yet thought of.

I have written a tool called git deps which automatically walks this graph. Currently the output is text only, but it would be cool to visualise the results, e.g. by generating a static HTML page which uses d3.js to provide a force-directed, zoomable layout of the graph where individual nodes can be hovered over or clicked to expand to see the commit details. It would be nice to colour the nodes according to the commit author. There is a decent amount of prior art for visualizing dependency graphs in this way, e.g.

Also the tool should make better use of pygit2 since blame support was not complete when it was originally written.

(BTW the dependency graph is likely to be semantically incomplete; for example it would not auto-detect dependencies between a commit which changes code and another commit which changes documentation or tests to reflect this code. (Incidentally this is one reason why it is usually a very good idea to logically group such changes together in a single commit.)

Looking for hackers with the skills:

git python d3js javascript

This project is part of:

Hack Week 11


  • about 7 years ago: aspiers added keyword "javascript" to this project.
  • about 7 years ago: aspiers removed keyword javscript from this project.
  • over 7 years ago: vbabka liked this project.
  • over 7 years ago: barendartchuk liked this project.
  • over 7 years ago: froh liked this project.
  • over 7 years ago: vitezslav_cizek liked this project.
  • over 7 years ago: aspiers added keyword "git" to this project.
  • over 7 years ago: aspiers added keyword "python" to this project.
  • over 7 years ago: aspiers added keyword "javscript" to this project.
  • over 7 years ago: aspiers added keyword "d3js" to this project.
  • All Activity


    • aspiers
      over 7 years ago by aspiers | Reply

      I'd love to know if this work would help the kernel team with their backporting work, which presumably can get pretty hairy.

    • vitezslav_cizek
      over 7 years ago by vitezslav_cizek | Reply

      Not just the kernel team, but essentially any packager who needs to backport a fix, which happens quite often (eg. security bugs). I miss a tool like this and i'm pleased to learn about your git-deps.

    • aspiers
      about 7 years ago by aspiers | Reply

      Somehow I missed your reply before :) Good to know there is interest! I did not take part in the last hackweek so I may be able to do this for my own hackweek soon.

    Similar Projects

    Git stochastic bisection by jankara

    Bisection is a well known method of localizing ...

    Build Microservice Architecture with Kubernetes by aqsa_malik

    Project Description

    The aim of the project ...

    Phoebe - where AI meets Linux by mvarlese

    Project Description

    Phoeβe (/ˈfiːbi/) wan...

    Testing and adding GNU/Linux distributions on Uyuni by juliogonzalezgil

    Join the Gitter channel! [

    Develop a monitoring system with web frontend for virtualization servers by nzhang

    [comment]: # (Please use the project descriptio...

    Uyuni/SUSE Manager: build Python APE and a Salt+Python bundle to support ANY client operating system by pagarcia

    Uyuni/SUSE Manager build client tools for each ...

    The Typescript Game by Etheryte

    Project Description

    Uyuni recently made t...

    Write "advanced" tagging engine for browser bookmarks by gniebler

    This is a side project I started a while ago. T...

    WebRTC individual track recorder by avicenzi

    [comment]: # (Please use the project descriptio...

    Modern frontend build tooling for Uyuni by Etheryte

    Project Description

    At the moment, Uyuni ...

    Dochazka by smithfarm

    Dochazka is a long-term project to replace the ...