{"id":13897216,"url":"https://github.com/aspiers/git-deps","last_synced_at":"2025-04-04T08:03:51.468Z","repository":{"id":25393501,"uuid":"28822131","full_name":"aspiers/git-deps","owner":"aspiers","description":"git commit dependency analysis tool","archived":false,"fork":false,"pushed_at":"2024-07-29T22:35:52.000Z","size":1261,"stargazers_count":300,"open_issues_count":61,"forks_count":51,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-03-28T07:05:28.585Z","etag":null,"topics":["cli","commits","d3","dependency-analysis","dependency-graph","git","graph","porting","revision-control","visualization","web-app"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aspiers.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.rst","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS.rst","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-01-05T16:59:22.000Z","updated_at":"2025-03-12T06:23:18.000Z","dependencies_parsed_at":"2024-06-20T19:07:53.216Z","dependency_job_id":"f182c081-8b08-48fe-9d1c-df73737a7835","html_url":"https://github.com/aspiers/git-deps","commit_stats":{"total_commits":387,"total_committers":16,"mean_commits":24.1875,"dds":0.04909560723514217,"last_synced_commit":"8cafb5cb1f181a6f220f7ce7f93be711ec160a9b"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aspiers%2Fgit-deps","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aspiers%2Fgit-deps/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aspiers%2Fgit-deps/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aspiers%2Fgit-deps/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aspiers","download_url":"https://codeload.github.com/aspiers/git-deps/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247142042,"owners_count":20890652,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","commits","d3","dependency-analysis","dependency-graph","git","graph","porting","revision-control","visualization","web-app"],"created_at":"2024-08-06T18:03:25.980Z","updated_at":"2025-04-04T08:03:51.447Z","avatar_url":"https://github.com/aspiers.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"[![Code Climate](https://codeclimate.com/github/aspiers/git-deps/badges/gpa.svg)](https://codeclimate.com/github/aspiers/git-deps)\n\ngit-deps\n========\n\n`git-deps` is a tool for performing automatic analysis of dependencies\nbetween commits in a [git](http://git-scm.com/) repository.  Here's\na screencast demonstration:\n\n[![YouTube screencast](./images/youtube-thumbnail.png)](http://youtu.be/irQ5gMMz-gE)\n\nI have [blogged about `git-deps` and related\ntools](https://blog.adamspiers.org/2018/06/14/git-auto-magic/), and\nalso publically spoken about the tool several times:\n\n- [a presentation at the openSUSE Summit in Nashville, Apr 2019](https://aspiers.github.io/nashville-git-automagic-april-2019/)\n- [a presentation at the OpenStack PTG in Denver, Sept 2018](https://aspiers.github.io/denver-git-automagic-sept-2018/) ([watch the video](https://youtu.be/f6anrSKCIgI))\n- [a presentation at the London Git User Meetup in May 2018](https://aspiers.github.io/london-git-automagic-may-2018/) ([watch the video](https://skillsmatter.com/skillscasts/11825-git-auto-magic))\n- [episode #32 of the GitMinutes podcast in 2015](http://episodes.gitminutes.com/2015/03/gitminutes-32-adam-spiers-on-git-deps.html)\n\n\nContents\n--------\n\n- [Background theory](#background-theory)\n- [Motivation](#motivation)\n  - [Use case 1: porting between branches](USE-CASES.md#use-case-1-porting-between-branches)\n  - [Use case 2: splitting a patch series into independent topics](USE-CASES.md#use-case-2-splitting-a-patch-series-into-independent-topics)\n  - [Use case 3: aiding collaborative communication](USE-CASES.md#use-case-3-aiding-collaborative-communication)\n  - [Use case 4: automatic squashing of fixup commits](USE-CASES.md#use-case-4-automatic-squashing-of-fixup-commits)\n  - [Use case 5: rewriting commit history](USE-CASES.md#use-case-5-rewriting-commit-history)\n- [Installation](INSTALL.md)\n- [Usage](USAGE.md)\n- [Textual vs. semantic (in)dependence](#textual-vs-semantic-independence)\n- [Development / support / feedback](#development--support--feedback)\n- [History](HISTORY.md)\n- [Credits](#credits)\n- [License](#license)\n\n\nBackground theory\n-----------------\n\nIt is fairly clear that two git commits within a single repo can be\nconsidered \"independent\" from each other in a certain sense, if they\ndo not change the same files, or if they do not change overlapping\nparts of the same file(s).\n\nIn contrast, when a commit changes a line, it is \"dependent\" on not\nonly the commit which last changed that line, but also any commits\nwhich were responsible for providing the surrounding lines of context,\nbecause without those previous versions of the line and its context,\nthe commit's diff might not cleanly apply (depending on how it's being\napplied, of course).  So all dependencies of a commit can be\nprogrammatically inferred by running git-blame on the lines the commit\nchanges, plus however many lines of context make sense for the use\ncase of this particular dependency analysis.\n\nTherefore the dependency calculation is impacted by a \"fuzz\" factor\nparameter\n(c.f. [patch(1)](http://en.wikipedia.org/wiki/Patch_(Unix))), i.e. the\nnumber of lines of context which are considered necessary for the\ncommit's diff to cleanly apply.\n\nAs with many dependency relationships, these dependencies form edges\nin a DAG (directed acyclic graph) whose nodes correspond to commits.\nNote that a node can only depend on a subset of its ancestors.\n\n### Caveat\n\nIt is important to be aware that any dependency graph inferred by\n`git-deps` may be semantically incomplete; for example it would not\nauto-detect dependencies between a commit A which changes code and\nanother commit B which changes documentation or tests to reflect the\ncode changes in commit A.  Therefore `git-deps` should not be used\nwith blind faith.  For more details, see [the section on Textual\nvs. semantic (in)dependence](#textual-vs-semantic-independence) below.\n\n\nMotivation\n----------\n\nSometimes it is useful to understand the nature of parts of this\ndependency graph, as its nature will impact the success or failure of\noperations including merge, rebase, cherry-pick etc.  Please see [the\n`USE-CASES.md` file](USE-CASES.md) for more details.\n\n\nInstallation\n------------\n\nPlease see [the `INSTALL.md` file](INSTALL.md).\n\n\nUsage\n-----\n\nPlease see [the `USAGE.md` file](USAGE.md).\n\n\nTextual vs. semantic (in)dependence\n-----------------------------------\n\nAstute readers will note that textual independence as detected by\n`git-deps` is not the same as semantic / logical independence.\nTextual independence means that the changes can be applied in any\norder without incurring conflicts, but this is not a reliable\nindicator of logical independence.\n\nFor example a change to a function and corresponding changes to the\ntests and/or documentation for that function would typically exist in\ndifferent files.  So if those changes were in separate commits within\na branch, running `git-deps` on the commits would not detect any\ndependency between them even though they are logically related,\nbecause changes in different files (or even in different areas of the\nsame files) are textually independent.\n\nSo in this case, `git-deps` would not behave exactly how we might\nwant.  And for as long as AI is an unsolved problem, it is very\nunlikely that it will ever develop totally reliable behaviour.  So\ndoes that mean `git-deps` is useless?  Absolutely not!\n\nFirstly, when [best\npractices](https://crealytics.com/blog/5-reasons-keeping-git-commits-small/)\nfor [commit\nstructuring](https://wiki.openstack.org/wiki/GitCommitMessages#Structural_split_of_changes)\nare adhered to, changes which are strongly logically related should be\nplaced within the same commit anyway.  So in the example above, a\nchange to a function and corresponding changes to the tests and/or\ndocumentation for that function should all be within a single commit.\n(Although this is not the only valid approach; for a more advanced\nmeta-history grouping mechanism, see\n[`git-dendrify`](https://github.com/bennorth/git-dendrify).)\n\nSecondly, whilst textual independence does not imply logical\nindependence, the converse is expected to be more commonly true:\nlogical independence often implies textual independence (or stated\nanother way, textual dependence often implies logical dependence).  So\nwhile it might not be too uncommon for `git-deps` to fail to detect\nthe dependency between logically-related changes, it should be rarer\nthat it incorrectly infers a dependency between logically unrelated\nchanges.  In other words, its false negatives are generally expected\nto be more common than its false positives.  As a result it is likely\nto be more useful in determining a lower bound on dependencies than an\nupper bound.  Having said that, more research is needed on this.\n\nThirdly, it is often unhelpful to allow [the quest for the perfect\nbecome the enemy of the\ngood](https://en.wikipedia.org/wiki/Perfect_is_the_enemy_of_good) - a\ntool does not have to be perfect to be useful; it only has to be\nbetter than performing the same task without the tool.\n\nFurther discussion on some of these points can be found in [an old\nthread from the git mailing\nlist](https://public-inbox.org/git/20160528112417.GD11256@pacific.linksys.moosehall/).\n\nUltimately though, [\"the proof is in the\npudding\"](https://en.wiktionary.org/wiki/the_proof_is_in_the_pudding),\nso try it out and see!\n\n\nDevelopment / support / feedback\n--------------------------------\n\nPlease see [the `CONTRIBUTING.md` file](CONTRIBUTING.md).\n\n\nHistory\n-------\n\nPlease see [the `HISTORY.md` file](HISTORY.md).\n\n\nCredits\n------\n\nSpecial thanks to [SUSE](https://suse.com) for partially sponsoring\nthe development of this software.  Thanks also to everyone who has\ncontributed code, bug reports, and other feedback.\n\n\nLicense\n-------\n\nReleased under [GPL version 2](LICENSE.txt) in order to be consistent with\n[`git`'s license](https://github.com/git/git/blob/master/COPYING), but\nI'm open to the idea of dual-licensing if there's a convincing reason.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faspiers%2Fgit-deps","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faspiers%2Fgit-deps","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faspiers%2Fgit-deps/lists"}