{"id":15673769,"url":"https://github.com/alancoding/gitpython-demos","last_synced_at":"2025-02-22T11:43:47.360Z","repository":{"id":144899613,"uuid":"188304611","full_name":"AlanCoding/GitPython-demos","owner":"AlanCoding","description":"Demonstrations and timings of using GitPython with github and the local proxy cloning gitty git git","archived":false,"fork":false,"pushed_at":"2019-07-18T15:26:55.000Z","size":66,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-03T05:39:01.261Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AlanCoding.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-05-23T20:50:12.000Z","updated_at":"2019-07-18T15:26:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"d9c5870f-d1cf-4d95-a02d-89798fbd8129","html_url":"https://github.com/AlanCoding/GitPython-demos","commit_stats":{"total_commits":20,"total_committers":1,"mean_commits":20.0,"dds":0.0,"last_synced_commit":"bc4b2c120df7c9ca429e0ac071d30beb31e6f3d9"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlanCoding%2FGitPython-demos","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlanCoding%2FGitPython-demos/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlanCoding%2FGitPython-demos/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlanCoding%2FGitPython-demos/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AlanCoding","download_url":"https://codeload.github.com/AlanCoding/GitPython-demos/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240170064,"owners_count":19759143,"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":[],"created_at":"2024-10-03T15:42:00.470Z","updated_at":"2025-02-22T11:43:47.338Z","avatar_url":"https://github.com/AlanCoding.png","language":"Python","readme":"# GitPython-demos\nDemonstrations and timings of using GitPython with github and a\nlocal proxy cloning repo\n\nHow to use:\n\n```\npython run.py test-playbooks\n```\n\nWhat this does:\n\nThis runs the demo for the ansible/test-playbooks repo in github.\nThe argument you give must be one of the data sets which are defined\nin the code in `run.py`.\n\nThe demo will first either clone (anew) or fetch the remote repo.\nTo delete the repo and force it to clone again do:\n\n```\npython run.py test-playbooks --reclone\n```\n\nThen it will investigate the process of cloning for ref-cases.\n\nref-cases:\n - non-default branch\n - SHA1 reference\n - PR reference\n\n### Repo cases\n\nSeveral github repositories are selected to illustrate a boundary case\nin computation, or for some connection to this project, or for some\nother accolade.\n\nThese are defined in a dictionary in the `run.py` script and passed\nas an argument on the CLI.\n\nhttps://github.com/ansible/test-playbooks\n\nThe intended use case of AWX involves users maintaining their playbooks\nin source control, and this is a repo of playbooks maintained to\ntest AWX. Since it has years of history, it becomes a fairly typical\nexample in terms of features used and contribution depth.\n\nhttps://github.com/ansible/ansible\n\nIn addition to containing an epic quantity of playbooks (used for\nintegration testing), Ansible is one of the top open source projects\nin the world, meaning that it has a contribution depth and tag history\nwhich is substantial by any standard of \"large project\".\nIssue count goes to 56k, and commits goes to 44k.\n\nhttps://github.com/Microsoft/vscode\n\ngithub gave this #1 place in \"Top open source projects\", but that is\nmeasured by contributor count. Its 50k commit count is extremely large,\nalthough not the largest. Issue count goes to 75k.\n\nhttps://github.com/cirosantilli/test-many-commits-1m/\n\nHas 100 million commits. This feels like a bad idea.\n\nhttps://github.com/torvalds/linux\n\nHas 840k commits, but they are not all garbage.\n\nSomewhat deficient testing:\n\n - need a large branch/tag count repo\n - subrepos\n\n### Findings\n\nIn the Ansible test case, checking out a SHA-1 in a non-default branch\nwas verified. f511bec4ff2d0371e5a90e5da2ea8887f5ff1ac2 is present in\nstable-2.8, but not in devel.\n\ntiming was 6.47, as opposed to older commit which took 4.11\n\nAlso, behavior if commit does not exist verified:\n\n```\nprint('commit that does not exist')\nimport traceback\ntry:\n    # commit is from this repo, so not in any target repo\n    repo.commit('dc587989c3c36560148429238bd19ac51163f6c6')\nexcept Exception:\n    traceback.print_exc()\n```\n\ngives\n\n\u003e ValueError: SHA b'dc587989c3c36560148429238bd19ac51163f6c6' could not be resolved, git returned: b'dc587989c3c36560148429238bd19ac51163f6c6 missing'\n\nThis is perfectly fine.\n\n#### CLI options use\n\nWe can get the differential impact of certain decisions by using some of the CLI\nflags. For instance, here's the timing of running `time python run.py ansible --clone-in-tmp`\nwith a pre-existing repo:\n\n```\nreal\t0m28.274s\nuser\t0m16.730s\nsys\t0m8.070s\n```\n\nNow the timings for just `time python run.py ansible`:\n\n```\nreal\t0m18.329s\nuser\t0m10.920s\nsys\t0m5.120s\n```\n\nYou can see that one method is simply faster (due to reducing the number\nof index items that need to be copied).\n\nLikewise, for `time python run.py ansible --python`\n\n```\nreal\t0m12.167s\nuser\t0m7.460s\nsys\t0m2.320s\n```\n\nThis effectively demonstrates the amount of overhead we add by running\nthrough the Ansible subprocess.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falancoding%2Fgitpython-demos","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falancoding%2Fgitpython-demos","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falancoding%2Fgitpython-demos/lists"}