From aef9e8bcb5993c0feea3568fedd4b43c542cea5e Mon Sep 17 00:00:00 2001 From: Javier Palacios Date: Sun, 29 Jul 2018 18:48:11 +0200 Subject: [PATCH 01/12] BUGFIX: name based branch concatenation broken --- git_workflow_quality/__init__.py | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/git_workflow_quality/__init__.py b/git_workflow_quality/__init__.py index d789396..1a8f255 100644 --- a/git_workflow_quality/__init__.py +++ b/git_workflow_quality/__init__.py @@ -113,7 +113,7 @@ def end ( self ) : ends = [ c for c in list.__iter__(self) if not c.child ] if not ends : ends = [ c for c in list.__iter__(self) if c.child.branch != self ] - if not ends : + if len(ends) != 1 : # This just searches end on direct childs, and will not detect indirect merge-backs ends = [ end for end in ends if not end.child or not end.child.branch.end().child or end.child.branch.end().child.branch != self ] assert len(ends) == 1 @@ -663,16 +663,24 @@ def set_childs ( self ) : self.branches.remove(branch) m += 1 continue - source = branch.begin().parent - if not source : continue - if ( source.child and source.child.branch == branch ) or \ - branch.name.startswith( source.branch.name ) or source.branch.name.startswith( branch.name ) : + + begin = branch.begin() + if not begin.parent : continue + + # Concatenation happens in two cases : + # incoming merge : a parent commit whose single child is the first commit on branch + # outgoing merge : the first commit has a single parent, and only one of their childs has a single parent + # We filter on candidates number, as the second condition is matched by standard branch forking + candidates = [ c for c in begin.get_parents() if not c.forks and c.child == begin ] + [ c.parent for c in begin.parent.get_childs() if not begin.parents and not c.parents ] + + if len(candidates) == 1 : + source = candidates[0] source.set_child( branch.begin() ) for commit in list(branch) : source.branch.append( commit ) - assert len(branch) == 0 self.branches.remove(branch) - source.branch.name = branch.name + if len(source.branch.name) > len(branch.name) : + source.branch.name = branch.name n += 1 if n : print "WARNING : %d branches removed by concatenation with parents" % n From 798cd50fd0991311f0fe74473a054da427fc6a16 Mon Sep 17 00:00:00 2001 From: Javier Palacios Date: Mon, 30 Jul 2018 00:47:06 +0200 Subject: [PATCH 02/12] Add tests for branch counting on simple & complex repositories --- do_test.py | 20 ++++++++++++++++++ tests/branchcount.git/HEAD | 1 + tests/branchcount.git/config | 8 +++++++ .../00/91c09e8b12029e0b86d7c323848d0da43cb2e3 | Bin 0 -> 45 bytes .../08/0a3932dcae93c49a92d07a2477e41dd4154617 | Bin 0 -> 203 bytes .../0b/2dfcb3403da0800449b25cfb221362ca698bf5 | Bin 0 -> 201 bytes .../0b/bb2de8671e2453f096d51cd4582aa197949835 | 5 +++++ .../18/d8643a6ac85dcf3578afe77c5514dc5100b160 | Bin 0 -> 90 bytes .../1d/d2bfd7cfeb86583811b772f5c9b270a9439672 | Bin 0 -> 162 bytes .../28/11f01bc9ab54c696f0d7684d9090c6778f2505 | Bin 0 -> 93 bytes .../31/6007ef56a63870d5ff147e1493037b7df058bb | Bin 0 -> 55 bytes .../33/cc5e9f5fe9530b5cc9eab984d30cda85310920 | Bin 0 -> 91 bytes .../45/a1efea7ca2d55fae24a8f62f29feeee4990313 | Bin 0 -> 161 bytes .../4b/d1087aaf4d5b24fa17b6aaba80f8f4bc90502a | Bin 0 -> 166 bytes .../58/52f44639f52db67d30ad9143b86afb143d415f | Bin 0 -> 31 bytes .../58/b29b4871b9c063309986225fdaf63cbf039426 | Bin 0 -> 37 bytes .../7a/b747d7ada18252e16291d9e552d85db56ada1d | Bin 0 -> 93 bytes .../84/fd538a36d65b0cf3ab7f6c503af812fce9cb1a | 2 ++ .../9e/c26468bdfbf374b0035182396e45f5d49e625c | Bin 0 -> 131 bytes .../9f/5628b3fb04d68e7a065159297e2b295dddfbb5 | Bin 0 -> 86 bytes .../a6/670da021af97b9421a1ae49cb1f9bd5b60a6ed | Bin 0 -> 160 bytes .../df/1f0ee2a654949f0cbbc684bfe9a47df6f57d14 | Bin 0 -> 66 bytes tests/branchcount.git/refs/heads/branch1 | 1 + tests/branchcount.git/refs/heads/branch2 | 1 + tests/branchcount.git/refs/heads/branch3 | 1 + tests/branchcount.git/refs/heads/branch4 | 1 + tests/branchcount.git/refs/heads/master | 1 + tests/complexnetwork.git/HEAD | 1 + tests/complexnetwork.git/config | 7 ++++++ tests/complexnetwork.git/description | 1 + tests/complexnetwork.git/info/exclude | 6 ++++++ .../05/1556c26835f5b79ac184e9c7d1c122797061c5 | Bin 0 -> 51 bytes .../07/c277ea283e7d175e0e03aaf5e15a3377ed388c | 2 ++ .../09/3ce978b81acfd8a6cd592743f08b05ab60d997 | 2 ++ .../0a/ccfb25ada8c8212dc561dc4ae17df985a4e316 | Bin 0 -> 122 bytes .../0d/58300606997e8eacf8504197c65982d0cbb8eb | 1 + .../10/0d726fb9b103486c1b312a6d47b6046ad9835a | 1 + .../16/752bc680db9f271a62330f41e0fa02541748ea | Bin 0 -> 111 bytes .../25/21f9e788e9c1b8618263e494491dff64599616 | 1 + .../2c/5c60d133f73596a77c8af2d297bbd9615b6249 | Bin 0 -> 147 bytes .../2d/a1c6f425e30cb49e7108e60c26ab7fd9288af1 | 1 + .../30/18d1a1eb7a54f9f5225deb210f18595189061a | Bin 0 -> 27 bytes .../35/b0b2d786ccd201db37b83ca8f21f7d363499af | 2 ++ .../39/d03b0744c96e1c1c6658c6300a33a71ab824cd | Bin 0 -> 163 bytes .../3e/c98557b655f3bdab4c48be2f23444b734c8e77 | Bin 0 -> 108 bytes .../42/27b26b07fd991512881a4ab630dd75311c10b8 | 3 +++ .../42/6ade47e4470267355dc6d8ff745781bf0368da | Bin 0 -> 86 bytes .../4d/1e0f3b0540e1f21d7c742f54859f7c12279b31 | Bin 0 -> 44 bytes .../57/1d4f525e5130abbdb0560b1584ab993cb7e578 | Bin 0 -> 81 bytes .../58/52f44639f52db67d30ad9143b86afb143d415f | Bin 0 -> 31 bytes .../59/34a5f9630444b41dba31bbfb54653a10b350d1 | Bin 0 -> 114 bytes .../59/d627376827784580f240cc865e44dab34cd174 | Bin 0 -> 118 bytes .../5b/94910af13fb18dcb229691572cab70367062d6 | Bin 0 -> 160 bytes .../64/043aeb0f2d4c068e013b7859121d7babe17430 | Bin 0 -> 118 bytes .../66/c2df3a6a0da39a9af583381307539927647142 | Bin 0 -> 170 bytes .../74/071922c169dd14300d31d67f2dfa3316c5dd09 | Bin 0 -> 163 bytes .../85/85c4d033ed5c2e1d01f320eeb06facde9fc29c | Bin 0 -> 107 bytes .../8b/47af992ef147a0b5677c814701d8ce37ea076a | Bin 0 -> 82 bytes .../8d/027ee2d223b268aebb9f45971da392bfbc1513 | Bin 0 -> 51 bytes .../90/4ada2e4081e45aadaf66c29524da6676c7fa0e | 2 ++ .../91/bc0dca437a3377984c069bf36f4e6c6c10af4b | 1 + .../92/dd5a7ae1d649368f58a4a284c4aecde1e65ba8 | 2 ++ .../96/e499681d9f4697c04147074551aa60883bdb25 | Bin 0 -> 54 bytes .../9b/182dfe19aa71ada8267ee63d11764bec1eb25f | Bin 0 -> 107 bytes .../a1/3400e5458383a08b0e50e141118dde6e3a28a5 | Bin 0 -> 82 bytes .../a8/17698c49a145045dbe58e7bf88bfa96f3aa9f3 | Bin 0 -> 209 bytes .../ad/62ddd988f02d12ede8e289c399ba579a2e2b75 | Bin 0 -> 118 bytes .../ad/c0695036d3102f08761d1c766141a7b3e34654 | Bin 0 -> 201 bytes .../b2/0afdee9454ae329646b7b568b08c6065c90217 | Bin 0 -> 163 bytes .../b2/93501db7da737bcee19189b16c6c1d805e2961 | 2 ++ .../bc/78d72b2eaefa6508ff12ff1f6264390fd6206d | Bin 0 -> 49 bytes .../c4/6a964ed35b3f794561c039ede9b9c3f34cabd7 | 2 ++ .../c9/5a20379a7684e399c666939c0b41f21f1dc65e | Bin 0 -> 111 bytes .../ce/c5717bc6b8944ce6b01132ca38f9927eda78f2 | Bin 0 -> 82 bytes .../d1/17a938f7dbf1f543f91191e3f753026ba88750 | Bin 0 -> 162 bytes .../dc/0daeef8c1337e2967b245e4ecebc9714aea243 | Bin 0 -> 52 bytes .../e5/8f853cf83361281e02d8d4cf38379f408d9fa9 | Bin 0 -> 163 bytes .../e9/68ce1739464cb6b76ad6cd6cf32155fe966a93 | Bin 0 -> 62 bytes .../ea/3bfa19f04b91d7f2580eb314c4e5db16a39719 | Bin 0 -> 203 bytes .../f1/33084691e488fdf3dcd67f0dff4df2f55fb711 | 3 +++ .../f1/5937966760f6b4b43fa278940e3ff0c55ef698 | Bin 0 -> 82 bytes .../f4/608d27b543d97506d490187b094dc89f5e1131 | 1 + .../f7/f0860affbf5445ef0d8b5388cd9814a2063d57 | 2 ++ .../f9/60dbfbcd8afc9d37c6a3077c31f5fc0cabee0c | Bin 0 -> 202 bytes .../fa/7a50bc0cf55a97f9bdf2a2e75e7e15537477e7 | Bin 0 -> 40 bytes .../fb/6e7570645235ebe94889f95783bc0fd1f5bec6 | Bin 0 -> 162 bytes .../fe/613ab22f00f45c5041697089c756fda875ac8e | Bin 0 -> 163 bytes .../fe/e3923c6d9fae66a7c275b2a9d04e47db88b2eb | Bin 0 -> 51 bytes tests/complexnetwork.git/refs/heads/branch1 | 1 + tests/complexnetwork.git/refs/heads/branch2 | 1 + tests/complexnetwork.git/refs/heads/branch3 | 1 + tests/complexnetwork.git/refs/heads/branch4 | 1 + tests/complexnetwork.git/refs/heads/branch5 | 1 + tests/complexnetwork.git/refs/heads/branch6 | 1 + tests/complexnetwork.git/refs/heads/branch7 | 1 + tests/complexnetwork.git/refs/heads/master | 1 + 96 files changed, 92 insertions(+) create mode 100644 tests/branchcount.git/HEAD create mode 100644 tests/branchcount.git/config create mode 100644 tests/branchcount.git/objects/00/91c09e8b12029e0b86d7c323848d0da43cb2e3 create mode 100644 tests/branchcount.git/objects/08/0a3932dcae93c49a92d07a2477e41dd4154617 create mode 100644 tests/branchcount.git/objects/0b/2dfcb3403da0800449b25cfb221362ca698bf5 create mode 100644 tests/branchcount.git/objects/0b/bb2de8671e2453f096d51cd4582aa197949835 create mode 100644 tests/branchcount.git/objects/18/d8643a6ac85dcf3578afe77c5514dc5100b160 create mode 100644 tests/branchcount.git/objects/1d/d2bfd7cfeb86583811b772f5c9b270a9439672 create mode 100644 tests/branchcount.git/objects/28/11f01bc9ab54c696f0d7684d9090c6778f2505 create mode 100644 tests/branchcount.git/objects/31/6007ef56a63870d5ff147e1493037b7df058bb create mode 100644 tests/branchcount.git/objects/33/cc5e9f5fe9530b5cc9eab984d30cda85310920 create mode 100644 tests/branchcount.git/objects/45/a1efea7ca2d55fae24a8f62f29feeee4990313 create mode 100644 tests/branchcount.git/objects/4b/d1087aaf4d5b24fa17b6aaba80f8f4bc90502a create mode 100644 tests/branchcount.git/objects/58/52f44639f52db67d30ad9143b86afb143d415f create mode 100644 tests/branchcount.git/objects/58/b29b4871b9c063309986225fdaf63cbf039426 create mode 100644 tests/branchcount.git/objects/7a/b747d7ada18252e16291d9e552d85db56ada1d create mode 100644 tests/branchcount.git/objects/84/fd538a36d65b0cf3ab7f6c503af812fce9cb1a create mode 100644 tests/branchcount.git/objects/9e/c26468bdfbf374b0035182396e45f5d49e625c create mode 100644 tests/branchcount.git/objects/9f/5628b3fb04d68e7a065159297e2b295dddfbb5 create mode 100644 tests/branchcount.git/objects/a6/670da021af97b9421a1ae49cb1f9bd5b60a6ed create mode 100644 tests/branchcount.git/objects/df/1f0ee2a654949f0cbbc684bfe9a47df6f57d14 create mode 100644 tests/branchcount.git/refs/heads/branch1 create mode 100644 tests/branchcount.git/refs/heads/branch2 create mode 100644 tests/branchcount.git/refs/heads/branch3 create mode 100644 tests/branchcount.git/refs/heads/branch4 create mode 100644 tests/branchcount.git/refs/heads/master create mode 100644 tests/complexnetwork.git/HEAD create mode 100644 tests/complexnetwork.git/config create mode 100644 tests/complexnetwork.git/description create mode 100644 tests/complexnetwork.git/info/exclude create mode 100644 tests/complexnetwork.git/objects/05/1556c26835f5b79ac184e9c7d1c122797061c5 create mode 100644 tests/complexnetwork.git/objects/07/c277ea283e7d175e0e03aaf5e15a3377ed388c create mode 100644 tests/complexnetwork.git/objects/09/3ce978b81acfd8a6cd592743f08b05ab60d997 create mode 100644 tests/complexnetwork.git/objects/0a/ccfb25ada8c8212dc561dc4ae17df985a4e316 create mode 100644 tests/complexnetwork.git/objects/0d/58300606997e8eacf8504197c65982d0cbb8eb create mode 100644 tests/complexnetwork.git/objects/10/0d726fb9b103486c1b312a6d47b6046ad9835a create mode 100644 tests/complexnetwork.git/objects/16/752bc680db9f271a62330f41e0fa02541748ea create mode 100644 tests/complexnetwork.git/objects/25/21f9e788e9c1b8618263e494491dff64599616 create mode 100644 tests/complexnetwork.git/objects/2c/5c60d133f73596a77c8af2d297bbd9615b6249 create mode 100644 tests/complexnetwork.git/objects/2d/a1c6f425e30cb49e7108e60c26ab7fd9288af1 create mode 100644 tests/complexnetwork.git/objects/30/18d1a1eb7a54f9f5225deb210f18595189061a create mode 100644 tests/complexnetwork.git/objects/35/b0b2d786ccd201db37b83ca8f21f7d363499af create mode 100644 tests/complexnetwork.git/objects/39/d03b0744c96e1c1c6658c6300a33a71ab824cd create mode 100644 tests/complexnetwork.git/objects/3e/c98557b655f3bdab4c48be2f23444b734c8e77 create mode 100644 tests/complexnetwork.git/objects/42/27b26b07fd991512881a4ab630dd75311c10b8 create mode 100644 tests/complexnetwork.git/objects/42/6ade47e4470267355dc6d8ff745781bf0368da create mode 100644 tests/complexnetwork.git/objects/4d/1e0f3b0540e1f21d7c742f54859f7c12279b31 create mode 100644 tests/complexnetwork.git/objects/57/1d4f525e5130abbdb0560b1584ab993cb7e578 create mode 100644 tests/complexnetwork.git/objects/58/52f44639f52db67d30ad9143b86afb143d415f create mode 100644 tests/complexnetwork.git/objects/59/34a5f9630444b41dba31bbfb54653a10b350d1 create mode 100644 tests/complexnetwork.git/objects/59/d627376827784580f240cc865e44dab34cd174 create mode 100644 tests/complexnetwork.git/objects/5b/94910af13fb18dcb229691572cab70367062d6 create mode 100644 tests/complexnetwork.git/objects/64/043aeb0f2d4c068e013b7859121d7babe17430 create mode 100644 tests/complexnetwork.git/objects/66/c2df3a6a0da39a9af583381307539927647142 create mode 100644 tests/complexnetwork.git/objects/74/071922c169dd14300d31d67f2dfa3316c5dd09 create mode 100644 tests/complexnetwork.git/objects/85/85c4d033ed5c2e1d01f320eeb06facde9fc29c create mode 100644 tests/complexnetwork.git/objects/8b/47af992ef147a0b5677c814701d8ce37ea076a create mode 100644 tests/complexnetwork.git/objects/8d/027ee2d223b268aebb9f45971da392bfbc1513 create mode 100644 tests/complexnetwork.git/objects/90/4ada2e4081e45aadaf66c29524da6676c7fa0e create mode 100644 tests/complexnetwork.git/objects/91/bc0dca437a3377984c069bf36f4e6c6c10af4b create mode 100644 tests/complexnetwork.git/objects/92/dd5a7ae1d649368f58a4a284c4aecde1e65ba8 create mode 100644 tests/complexnetwork.git/objects/96/e499681d9f4697c04147074551aa60883bdb25 create mode 100644 tests/complexnetwork.git/objects/9b/182dfe19aa71ada8267ee63d11764bec1eb25f create mode 100644 tests/complexnetwork.git/objects/a1/3400e5458383a08b0e50e141118dde6e3a28a5 create mode 100644 tests/complexnetwork.git/objects/a8/17698c49a145045dbe58e7bf88bfa96f3aa9f3 create mode 100644 tests/complexnetwork.git/objects/ad/62ddd988f02d12ede8e289c399ba579a2e2b75 create mode 100644 tests/complexnetwork.git/objects/ad/c0695036d3102f08761d1c766141a7b3e34654 create mode 100644 tests/complexnetwork.git/objects/b2/0afdee9454ae329646b7b568b08c6065c90217 create mode 100644 tests/complexnetwork.git/objects/b2/93501db7da737bcee19189b16c6c1d805e2961 create mode 100644 tests/complexnetwork.git/objects/bc/78d72b2eaefa6508ff12ff1f6264390fd6206d create mode 100644 tests/complexnetwork.git/objects/c4/6a964ed35b3f794561c039ede9b9c3f34cabd7 create mode 100644 tests/complexnetwork.git/objects/c9/5a20379a7684e399c666939c0b41f21f1dc65e create mode 100644 tests/complexnetwork.git/objects/ce/c5717bc6b8944ce6b01132ca38f9927eda78f2 create mode 100644 tests/complexnetwork.git/objects/d1/17a938f7dbf1f543f91191e3f753026ba88750 create mode 100644 tests/complexnetwork.git/objects/dc/0daeef8c1337e2967b245e4ecebc9714aea243 create mode 100644 tests/complexnetwork.git/objects/e5/8f853cf83361281e02d8d4cf38379f408d9fa9 create mode 100644 tests/complexnetwork.git/objects/e9/68ce1739464cb6b76ad6cd6cf32155fe966a93 create mode 100644 tests/complexnetwork.git/objects/ea/3bfa19f04b91d7f2580eb314c4e5db16a39719 create mode 100644 tests/complexnetwork.git/objects/f1/33084691e488fdf3dcd67f0dff4df2f55fb711 create mode 100644 tests/complexnetwork.git/objects/f1/5937966760f6b4b43fa278940e3ff0c55ef698 create mode 100644 tests/complexnetwork.git/objects/f4/608d27b543d97506d490187b094dc89f5e1131 create mode 100644 tests/complexnetwork.git/objects/f7/f0860affbf5445ef0d8b5388cd9814a2063d57 create mode 100644 tests/complexnetwork.git/objects/f9/60dbfbcd8afc9d37c6a3077c31f5fc0cabee0c create mode 100644 tests/complexnetwork.git/objects/fa/7a50bc0cf55a97f9bdf2a2e75e7e15537477e7 create mode 100644 tests/complexnetwork.git/objects/fb/6e7570645235ebe94889f95783bc0fd1f5bec6 create mode 100644 tests/complexnetwork.git/objects/fe/613ab22f00f45c5041697089c756fda875ac8e create mode 100644 tests/complexnetwork.git/objects/fe/e3923c6d9fae66a7c275b2a9d04e47db88b2eb create mode 100644 tests/complexnetwork.git/refs/heads/branch1 create mode 100644 tests/complexnetwork.git/refs/heads/branch2 create mode 100644 tests/complexnetwork.git/refs/heads/branch3 create mode 100644 tests/complexnetwork.git/refs/heads/branch4 create mode 100644 tests/complexnetwork.git/refs/heads/branch5 create mode 100644 tests/complexnetwork.git/refs/heads/branch6 create mode 100644 tests/complexnetwork.git/refs/heads/branch7 create mode 100644 tests/complexnetwork.git/refs/heads/master diff --git a/do_test.py b/do_test.py index bdc6d92..adf4292 100644 --- a/do_test.py +++ b/do_test.py @@ -48,6 +48,26 @@ def fail( msg , fd=os.sys.stdout ) : os.chdir('../..') +os.chdir( 'tests/branchcount.git' ) +repo = git_workflow_quality.Repository() +count = len(repo.branches) +if count == 5 : + ret += ok( "branch count working" ) +else : + ret += fail( "counted %d branches" % count ) +os.chdir('../..') + + +os.chdir( 'tests/complexnetwork.git' ) +repo = git_workflow_quality.Repository() +count = len(repo.branches) +if count == 8 : + ret += ok( "complex branches properly concatenated" ) +else : + ret += fail( "complex concatenation produced %d branches" % count ) +os.chdir('../..') + + def test_event ( event ) : os.chdir( 'tests/%s.git' % event ) repo = git_workflow_quality.Repository() diff --git a/tests/branchcount.git/HEAD b/tests/branchcount.git/HEAD new file mode 100644 index 0000000..d1b4f04 --- /dev/null +++ b/tests/branchcount.git/HEAD @@ -0,0 +1 @@ +ref: refs/heads/branch3 diff --git a/tests/branchcount.git/config b/tests/branchcount.git/config new file mode 100644 index 0000000..78387c5 --- /dev/null +++ b/tests/branchcount.git/config @@ -0,0 +1,8 @@ +[core] + repositoryformatversion = 0 + filemode = false + bare = false + logallrefupdates = true + symlinks = false + ignorecase = true + hideDotFiles = dotGitOnly diff --git a/tests/branchcount.git/objects/00/91c09e8b12029e0b86d7c323848d0da43cb2e3 b/tests/branchcount.git/objects/00/91c09e8b12029e0b86d7c323848d0da43cb2e3 new file mode 100644 index 0000000000000000000000000000000000000000..c12c17f8a369f95a71bdd3ba659b08e25dc79572 GIT binary patch literal 45 zcmV+|0Mh?>0ZYosPf{>3V(`q%EXhpFQAp0u&CM*~a?30#E`f1^Q=^p=tmVW>)IZNX^GO-8#OfVH~PYtr5dM`F*2 zB_-EMb8*Q^4nD`^{`wqxCC}nxja2L$kdk^-vR*o)>)Nsw6eFLTW77Abe=k<_b=VNwsCGyhFtXmr{8oZ^8=KP FT8*(jW)J`X literal 0 HcmV?d00001 diff --git a/tests/branchcount.git/objects/0b/2dfcb3403da0800449b25cfb221362ca698bf5 b/tests/branchcount.git/objects/0b/2dfcb3403da0800449b25cfb221362ca698bf5 new file mode 100644 index 0000000000000000000000000000000000000000..de21760dd427658a6e537e40bf7a676e0a662b18 GIT binary patch literal 201 zcmV;)05<=40iBOcN(3cd)5!Zs?6{?b|nU?P9Ax81|Hi#E+^}*wN zi`VvTTc-7;-pwImyE+9CPbp%>s?eBQD#$98Fn3KFb9ZQNG~_yMmF5$s!d+QIMg|Dc z6(4F6j2b&uNj|o}KXP|aGLd4B>`}>OPDD%vv?y|`5W$n7&w1I0eW9;KhJB-z+OmJx z$M*x=*6-)@M$7up_U*~K7<`3L3fg<{0Op`a)I7X@>E>0&Su78_wu?Ret~;3@W; literal 0 HcmV?d00001 diff --git a/tests/branchcount.git/objects/0b/bb2de8671e2453f096d51cd4582aa197949835 b/tests/branchcount.git/objects/0b/bb2de8671e2453f096d51cd4582aa197949835 new file mode 100644 index 0000000..c5afbba --- /dev/null +++ b/tests/branchcount.git/objects/0b/bb2de8671e2453f096d51cd4582aa197949835 @@ -0,0 +1,5 @@ +xMj1 @} + AA)]g+hdO2e&\3tg-gN-IT + +Zʹ1v5Hj$ +UJsc_+gq;wi.-||᱾.| $<#!pnz?FF{ \ No newline at end of file diff --git a/tests/branchcount.git/objects/18/d8643a6ac85dcf3578afe77c5514dc5100b160 b/tests/branchcount.git/objects/18/d8643a6ac85dcf3578afe77c5514dc5100b160 new file mode 100644 index 0000000000000000000000000000000000000000..0ff10ee99a6b0454df09565798e250796f1d9224 GIT binary patch literal 90 zcmV-g0HyzU0V^p=O;s>7G-EI{FfcPQQAjFE%uCKN)GMhdVTcI&;%50(cU!H&+KJ9P wvVM!$I>w_YGa{rcH?g=RwFshW(`=8zod=Q)X0|EC-}+{=pLvQJ0L#ZNzh>bm761SM literal 0 HcmV?d00001 diff --git a/tests/branchcount.git/objects/1d/d2bfd7cfeb86583811b772f5c9b270a9439672 b/tests/branchcount.git/objects/1d/d2bfd7cfeb86583811b772f5c9b270a9439672 new file mode 100644 index 0000000000000000000000000000000000000000..b785d0d4fd0f2b1f2c308880aaf5836ad3a407dd GIT binary patch literal 162 zcmV;T0A2rh0iDiE3c@fDfMM4;MfQSBCXXf{;@Xv0n8`ycjV)~yk8iw!+aEso<6P_5 zB;v4ZYtAwh>(H|<3?@0B2Lfl64H$-ujKQXq3bPdpt@+s`Fs2e&8_7HDxd~FfcPQQAjFE%uCKN)GMhdVTcI&;%50(cU!H&+KJ9P zvVM!$I>w_YGa^oz2_a>Rk?`BisYt-;!f&O5Sx Ni`Y8G0{~#h5Y{jZ7W@DJ literal 0 HcmV?d00001 diff --git a/tests/branchcount.git/objects/33/cc5e9f5fe9530b5cc9eab984d30cda85310920 b/tests/branchcount.git/objects/33/cc5e9f5fe9530b5cc9eab984d30cda85310920 new file mode 100644 index 0000000000000000000000000000000000000000..501f4563595cf323336b0fe34f13054eba4a8ad3 GIT binary patch literal 91 zcmV-h0HptT0V^p=O;s>7G-EI{FfcPQQAjFE%uCKN)GMhdVTcI&;%50(cU!H&+KJ9P xvVM!$I>w_YGa{rcH?g=RwFs<=Vd8;#-9k+BxZAEDR&MF#U1GE8F#x+6E;^xDD2o69 literal 0 HcmV?d00001 diff --git a/tests/branchcount.git/objects/45/a1efea7ca2d55fae24a8f62f29feeee4990313 b/tests/branchcount.git/objects/45/a1efea7ca2d55fae24a8f62f29feeee4990313 new file mode 100644 index 0000000000000000000000000000000000000000..6fa2162becf167f867628167150b3007bd8c9d84 GIT binary patch literal 161 zcmV;S0ABxi0iBLP3c@fD06pgwdlzK0$ukI>v$~=z^ zi27ZtIYW>k_@F^lY)?$tb`-6~%uL#|4&42enpJ9E8eos&q9aX`qf0(YB*h@)L&)B$ zddt4E!N{xKONEQP$6Vnmlccdc;rQ6VI(^Q!S;py*%6tOLjv{(whCLFZ+2}Uew(hUo P3{{qNcYx*#fA~jf`7cvO literal 0 HcmV?d00001 diff --git a/tests/branchcount.git/objects/4b/d1087aaf4d5b24fa17b6aaba80f8f4bc90502a b/tests/branchcount.git/objects/4b/d1087aaf4d5b24fa17b6aaba80f8f4bc90502a new file mode 100644 index 0000000000000000000000000000000000000000..ae36eec221c41658d5d92007441d6c54a7a4a91f GIT binary patch literal 166 zcmV;X09pTd0iDiGY6CG0K;f=^3he_$wq=hEA!MCZuOQn}Gi82)d(dWysM|l>h($ literal 0 HcmV?d00001 diff --git a/tests/branchcount.git/objects/58/52f44639f52db67d30ad9143b86afb143d415f b/tests/branchcount.git/objects/58/52f44639f52db67d30ad9143b86afb143d415f new file mode 100644 index 0000000000000000000000000000000000000000..a045f982ac2b06d382faf643414fa7ccefcc7fe9 GIT binary patch literal 31 ncmb7HDxd~FfcPQQAjFE%uCKN)GMhdVTcI&;%50(cU!H&+KJ9P zvVM!$I>w_YGa^ozF(GBSiNz(UMG#e+W_uLwJdkWKvrQ@f);F8|%v00=*TOwhljG8aHYSSD%)l7(R=ZpKYP(fsYeft$6@9 zZZ~?2Ah|{~F)2-2T7#=fi7zJd#YvRLn>C@b-ZOfQd+Ttaca9ydR4C-O!SOM}vwY6C lO1T_Dt0&+}3Ww4P4SN)bY}Pp))BVL+rR|52eF2rMIhAYvJ-`3} literal 0 HcmV?d00001 diff --git a/tests/branchcount.git/objects/9f/5628b3fb04d68e7a065159297e2b295dddfbb5 b/tests/branchcount.git/objects/9f/5628b3fb04d68e7a065159297e2b295dddfbb5 new file mode 100644 index 0000000000000000000000000000000000000000..168890a75a98ddb9c113645237ba604e59662376 GIT binary patch literal 86 zcmV-c0IC0Y0V^p=O;s>AXD~D{Ff%bxNGeLqOU^LVE2$`9hzR=PX8BcjTdl#`iOxH+ sev8;T#zU3mCKi{Z7C}^Pn(a}z^FXq}%r>R?Ti+Hj0Lh_%-Lcn zC59BYAv<}s+c^89ynCDdNe0n=eEQve3DfX7T&wiMM#sAMArUeV=jhjf0B)(vWLw-{ O+*Nu0FuE^GL`P|CoJ=eL literal 0 HcmV?d00001 diff --git a/tests/branchcount.git/objects/df/1f0ee2a654949f0cbbc684bfe9a47df6f57d14 b/tests/branchcount.git/objects/df/1f0ee2a654949f0cbbc684bfe9a47df6f57d14 new file mode 100644 index 0000000000000000000000000000000000000000..2e6eec08eb81e07fdd7b42ad9e5a9b08fde505cd GIT binary patch literal 66 zcmV-I0KNZs0V^p=O;s>AXD~D{Ff%bxNGeLqOU^LVE2$`9hzR=PX8BcjTdl#`iOxH+ Yev8;T#zU3mCKi{Z7U5I{0P9sBhDXpF%K!iX literal 0 HcmV?d00001 diff --git a/tests/branchcount.git/refs/heads/branch1 b/tests/branchcount.git/refs/heads/branch1 new file mode 100644 index 0000000..65147d8 --- /dev/null +++ b/tests/branchcount.git/refs/heads/branch1 @@ -0,0 +1 @@ +4bd1087aaf4d5b24fa17b6aaba80f8f4bc90502a diff --git a/tests/branchcount.git/refs/heads/branch2 b/tests/branchcount.git/refs/heads/branch2 new file mode 100644 index 0000000..9766000 --- /dev/null +++ b/tests/branchcount.git/refs/heads/branch2 @@ -0,0 +1 @@ +84fd538a36d65b0cf3ab7f6c503af812fce9cb1a diff --git a/tests/branchcount.git/refs/heads/branch3 b/tests/branchcount.git/refs/heads/branch3 new file mode 100644 index 0000000..21886eb --- /dev/null +++ b/tests/branchcount.git/refs/heads/branch3 @@ -0,0 +1 @@ +45a1efea7ca2d55fae24a8f62f29feeee4990313 diff --git a/tests/branchcount.git/refs/heads/branch4 b/tests/branchcount.git/refs/heads/branch4 new file mode 100644 index 0000000..76c6597 --- /dev/null +++ b/tests/branchcount.git/refs/heads/branch4 @@ -0,0 +1 @@ +0bbb2de8671e2453f096d51cd4582aa197949835 diff --git a/tests/branchcount.git/refs/heads/master b/tests/branchcount.git/refs/heads/master new file mode 100644 index 0000000..ab0cc6e --- /dev/null +++ b/tests/branchcount.git/refs/heads/master @@ -0,0 +1 @@ +a6670da021af97b9421a1ae49cb1f9bd5b60a6ed diff --git a/tests/complexnetwork.git/HEAD b/tests/complexnetwork.git/HEAD new file mode 100644 index 0000000..cb089cd --- /dev/null +++ b/tests/complexnetwork.git/HEAD @@ -0,0 +1 @@ +ref: refs/heads/master diff --git a/tests/complexnetwork.git/config b/tests/complexnetwork.git/config new file mode 100644 index 0000000..90e1647 --- /dev/null +++ b/tests/complexnetwork.git/config @@ -0,0 +1,7 @@ +[core] + repositoryformatversion = 0 + filemode = false + bare = true + symlinks = false + ignorecase = true + hideDotFiles = dotGitOnly diff --git a/tests/complexnetwork.git/description b/tests/complexnetwork.git/description new file mode 100644 index 0000000..498b267 --- /dev/null +++ b/tests/complexnetwork.git/description @@ -0,0 +1 @@ +Unnamed repository; edit this file 'description' to name the repository. diff --git a/tests/complexnetwork.git/info/exclude b/tests/complexnetwork.git/info/exclude new file mode 100644 index 0000000..a5196d1 --- /dev/null +++ b/tests/complexnetwork.git/info/exclude @@ -0,0 +1,6 @@ +# git ls-files --others --exclude-from=.git/info/exclude +# Lines that start with '#' are comments. +# For a project mostly in C, the following would be a good set of +# exclude patterns (uncomment them if you want to use them): +# *.[oa] +# *~ diff --git a/tests/complexnetwork.git/objects/05/1556c26835f5b79ac184e9c7d1c122797061c5 b/tests/complexnetwork.git/objects/05/1556c26835f5b79ac184e9c7d1c122797061c5 new file mode 100644 index 0000000000000000000000000000000000000000..c717e47f0f63f354316ed26a92feba6f102c380a GIT binary patch literal 51 zcmb_5{OT`5JlVPw^ H6g&d}th*7e literal 0 HcmV?d00001 diff --git a/tests/complexnetwork.git/objects/07/c277ea283e7d175e0e03aaf5e15a3377ed388c b/tests/complexnetwork.git/objects/07/c277ea283e7d175e0e03aaf5e15a3377ed388c new file mode 100644 index 0000000..e7c6eb0 --- /dev/null +++ b/tests/complexnetwork.git/objects/07/c277ea283e7d175e0e03aaf5e15a3377ed388c @@ -0,0 +1,2 @@ +xKj1 } +c/!zY)z_u8>FWrRTh]}PSk|LSiClu 8Ҋ`|b֪d$\j4Í߳veޟp9c~5F<~$?FfcPQQAjFE%uCKNWcXDTu!rYs)byWwKP`G5S0@@= zQvMu8i4j9Y&=)t$ue#f64c1O{-jVfN#MUt$MTs$CB_@O|G9_$^89pVsiNz(UMGSX% c*S+r%Hh(m&S|!f!+@9$o>lQf!0LKhu233wRb^rhX literal 0 HcmV?d00001 diff --git a/tests/complexnetwork.git/objects/0d/58300606997e8eacf8504197c65982d0cbb8eb b/tests/complexnetwork.git/objects/0d/58300606997e8eacf8504197c65982d0cbb8eb new file mode 100644 index 0000000..48cbbef --- /dev/null +++ b/tests/complexnetwork.git/objects/0d/58300606997e8eacf8504197c65982d0cbb8eb @@ -0,0 +1 @@ +xMJ1a}f!HU*T@ĵ xJRLoz/|Pض|M& 3+ >$4ݻQϕ=D3ZF[xJL!V\bw_DJX#* 위9x_fkf>dw|~7Y֧|l/=<FOŧwmg5ɞ/}L̲7 ]l \ No newline at end of file diff --git a/tests/complexnetwork.git/objects/10/0d726fb9b103486c1b312a6d47b6046ad9835a b/tests/complexnetwork.git/objects/10/0d726fb9b103486c1b312a6d47b6046ad9835a new file mode 100644 index 0000000..32bd9f8 --- /dev/null +++ b/tests/complexnetwork.git/objects/10/0d726fb9b103486c1b312a6d47b6046ad9835a @@ -0,0 +1 @@ +x+)JMU047a040031QH*JK0dUk{?-zW'\RECD7˯j Ntޑ[1E1a%&1쩸W*I)r#Fl \ No newline at end of file diff --git a/tests/complexnetwork.git/objects/16/752bc680db9f271a62330f41e0fa02541748ea b/tests/complexnetwork.git/objects/16/752bc680db9f271a62330f41e0fa02541748ea new file mode 100644 index 0000000000000000000000000000000000000000..7d7cb49ec5021ee1d613d27bc2c0492ad08b4cca GIT binary patch literal 111 zcmV-#0FeK90V^p=O;s>7wq!6gFfcPQQAjFE%uCKNWcXDTu!rYs)byWwKP`G5S0@@= zQvMu8i7`V&&=)t$ue#f64c1O{-jVfN#MUt$MTsdsCAo>kC85w`4FhFfcPQQAjFE%uCKNWcXDTu!rYs)byWwKP`G5S0@@= zQvMu8i4j9Y&=)t$ue#f64c1O{-jVfN#MUt$MTs$CB_@O|G9_$^8DS;n3g0SWguU.t2?wZ- \ No newline at end of file diff --git a/tests/complexnetwork.git/objects/30/18d1a1eb7a54f9f5225deb210f18595189061a b/tests/complexnetwork.git/objects/30/18d1a1eb7a54f9f5225deb210f18595189061a new file mode 100644 index 0000000000000000000000000000000000000000..f5d4b85e2381da0b04c2a713c0d8701c012bed75 GIT binary patch literal 27 jcmb^%r^_W?*!! zb#9g@e6+n33yjQO$w$W%=a57(4kc+AQL$?&fJbGs$zC4Ka!x}+kO|$CF^-yvl26Ei zRB{04yHBGx@@(JhZg29M%Wm(oh|cR_&p#b(%lrCOWnMmYtrv^z+z=x`vL_$_(`lb< Rz57>gsvLhYnO|R*MoVO&OTPdB literal 0 HcmV?d00001 diff --git a/tests/complexnetwork.git/objects/3e/c98557b655f3bdab4c48be2f23444b734c8e77 b/tests/complexnetwork.git/objects/3e/c98557b655f3bdab4c48be2f23444b734c8e77 new file mode 100644 index 0000000000000000000000000000000000000000..a94d27e5931f3a548737e9759002d5a5c5ccf19e GIT binary patch literal 108 zcmV-y0F(cC0V^p=O;s>7Fkvt>FfcPQQAjFE%uCKNWKdQ7`Ml%h!5xWB$xo(u%KlG@ zoF;~%#Dw8jRlpveuTj%~?)|jrd0d@na7p=dsFK{o;*!)N246XTYgUJcpJZ!F^g~+b O*9fW4HUt2JL@Re>^)qn* literal 0 HcmV?d00001 diff --git a/tests/complexnetwork.git/objects/42/27b26b07fd991512881a4ab630dd75311c10b8 b/tests/complexnetwork.git/objects/42/27b26b07fd991512881a4ab630dd75311c10b8 new file mode 100644 index 0000000..8746323 --- /dev/null +++ b/tests/complexnetwork.git/objects/42/27b26b07fd991512881a4ab630dd75311c10b8 @@ -0,0 +1,3 @@ +xA +1 E] ҴӴ׮B:2HzOe86fJ}hB%$}0K?go\ѠűđET1cIHpL6˄V8g +gY{{.<;Y`~H݌ZilK7Cnh~G \ No newline at end of file diff --git a/tests/complexnetwork.git/objects/42/6ade47e4470267355dc6d8ff745781bf0368da b/tests/complexnetwork.git/objects/42/6ade47e4470267355dc6d8ff745781bf0368da new file mode 100644 index 0000000000000000000000000000000000000000..a29d0db60d2d701f6c9efb0e8c1ce3615049eda0 GIT binary patch literal 86 zcmV-c0IC0Y0V^p=O;s>7Fkvt>FfcPQQAjFE%uCKNWKdQ7`Ml%h!5xWB$xo(u%KlG@ soF;~%!~~y`+{EIN)FK97Ieu$ahlihJYfAJ(TIbgYsn0e9094m1S`z~%O#lD@ literal 0 HcmV?d00001 diff --git a/tests/complexnetwork.git/objects/4d/1e0f3b0540e1f21d7c742f54859f7c12279b31 b/tests/complexnetwork.git/objects/4d/1e0f3b0540e1f21d7c742f54859f7c12279b31 new file mode 100644 index 0000000000000000000000000000000000000000..3a0d4ddb0c6c6a426d87b22169a41bdb7daf6ad3 GIT binary patch literal 44 zcmV+{0Mq|?0ZYosPf{?kVDQY#EXhpFQAp0u&CM*~GAu5EF^%$4U`*p8I1>OD9}?&0 Cw-e<6 literal 0 HcmV?d00001 diff --git a/tests/complexnetwork.git/objects/57/1d4f525e5130abbdb0560b1584ab993cb7e578 b/tests/complexnetwork.git/objects/57/1d4f525e5130abbdb0560b1584ab993cb7e578 new file mode 100644 index 0000000000000000000000000000000000000000..3ad2cd37abb2d93f51e21fcb55ea71d20f931ac7 GIT binary patch literal 81 zcmV-X0IvUd0V^p=O;s?nWH2-^Ff%bxNGeLqOU^K4P*wc-yyNA;9f?iJPo{Xv{!fXV nCI(fKn^;_uTEyTh$8XK*@bHstO^JR;>--ua_1T61C2$+3mvSaW literal 0 HcmV?d00001 diff --git a/tests/complexnetwork.git/objects/58/52f44639f52db67d30ad9143b86afb143d415f b/tests/complexnetwork.git/objects/58/52f44639f52db67d30ad9143b86afb143d415f new file mode 100644 index 0000000000000000000000000000000000000000..a045f982ac2b06d382faf643414fa7ccefcc7fe9 GIT binary patch literal 31 ncmb7H(@X|FfcPQQAjFE%uCKNWcXDTu!rYs)byWwKP`G5S0@@= zQvMu8i4j9Y&=)t$ue#f64c1O{-jVfN#MUt$MTs$CC8qe45uw*baFfcPQQAjFE%uCKNWcXDTu!rYs)byWwKP`G5S0@@= zQvMu8i4j9Y&=)t$ue#f64c1O{-jVfN#MUt$MTs$CB_@O|GR0>~ZenpsY7xU7-gWPL Ygv}pKt5%8gJGW=L$ht+&05{22C;IQY|MgjZ)gXpbg&(5Q2?5Ci`%I OaaM5qVadMfyhxeomrMu% literal 0 HcmV?d00001 diff --git a/tests/complexnetwork.git/objects/64/043aeb0f2d4c068e013b7859121d7babe17430 b/tests/complexnetwork.git/objects/64/043aeb0f2d4c068e013b7859121d7babe17430 new file mode 100644 index 0000000000000000000000000000000000000000..d53d026460be2af7df22460d7c5b8d6096cf5f22 GIT binary patch literal 118 zcmV-+0Ez#20V^p=O;s>5uw*baFfcPQQAjFE%uCKNWcXDTu!rYs)byWwKP`G5S0@@= zQvMu8i4j9Y&=)t$ue#f64c1O{-jVfN#MUt$MTs$CB_@O|GR0>~ZenpsY7xVpitE~X Y>wcwj{1^H!pOj+Be@!7505#8675t?#82|tP literal 0 HcmV?d00001 diff --git a/tests/complexnetwork.git/objects/66/c2df3a6a0da39a9af583381307539927647142 b/tests/complexnetwork.git/objects/66/c2df3a6a0da39a9af583381307539927647142 new file mode 100644 index 0000000000000000000000000000000000000000..0795b98a4f4fdf8ac5423d83aff958d6bbb66ce7 GIT binary patch literal 170 zcmV;b09F5Z0gcW*_#-c0)@mF*RH(6beP(j(l&_3 z``&Xuk`_hpI&B4R^qHl=ofhJGd%^kHz`lI1k4*D&;w@jmxURDygc#wdQESy`i>%H2 ROIJgol_w8c{Q!s;Nerf1Q^5cL literal 0 HcmV?d00001 diff --git a/tests/complexnetwork.git/objects/85/85c4d033ed5c2e1d01f320eeb06facde9fc29c b/tests/complexnetwork.git/objects/85/85c4d033ed5c2e1d01f320eeb06facde9fc29c new file mode 100644 index 0000000000000000000000000000000000000000..f68266842648f45d0ecc2cb32c8fafd4a1c07308 GIT binary patch literal 107 zcmV-x0F?iD0V^p=O;s>7Fkvt>FfcPQQAjFE%uCKNWKdQ7`Ml%h!5xWB$xo(u%KlG@ zoF;~%#F!x>=!=`>SKV#325Toe@5uTsV(S "Z8ZƘcg'RrJ]o1rgvsER B@k"L0KlJg=$0 F7%)I6~w_iƏs!rh < %uLÆ}ۋGM \ No newline at end of file diff --git a/tests/complexnetwork.git/objects/91/bc0dca437a3377984c069bf36f4e6c6c10af4b b/tests/complexnetwork.git/objects/91/bc0dca437a3377984c069bf36f4e6c6c10af4b new file mode 100644 index 0000000..fb33797 --- /dev/null +++ b/tests/complexnetwork.git/objects/91/bc0dca437a3377984c069bf36f4e6c6c10af4b @@ -0,0 +1 @@ +xMJA ]) I'ׂꪙgi ^Ճ=xy[iFz[)Ŵ(".41WW F8RwVWTQ<8^#g,EG`JZyW*B07Fkvt>FfcPQQAjFE%uCKNWKdQ7`Ml%h!5xWB$xo(u%KlG@ zoF;~%#DpOt=!=`>SKV#325Toe@5uTsV(SeVV#S~=z=0~^1()$srV#G$s5M$CQbJag~&_fP<=_2sx@3A zQ6%N+E#vHxgy8L89*Yf(=+MRJHK^noEE5uw*baFfcPQQAjFE%uCKNWcXDTu!rYs)byWwKP`G5S0@@= zQvMu8i4j9Y&=)t$ue#f64c1O{-jVfN#MUt$MTs$CB_@O|GR0>~ZenpsY7xV;YmSgORKSuO)WE$|je_XW+-S&kf=t+x1{cLcZ=p&? zD3YMNL@g^j>-KCH?K0zV%wl=zu42Su_i_XV7ff$)t=Ky|L)Xdk!?}q|wKi&?y_89#HI5^V&e7;fy}Spoqs5$Z@i${a{8J zqO=ry4bcmFw`r?zqtBcx+-V`6w-=nB9qh~Z`Y1FnC*H~hlr?4u0a3wGYAHpheX@1$ RFI~h+D^DJj_yLGiN3@>!PiX)E literal 0 HcmV?d00001 diff --git a/tests/complexnetwork.git/objects/b2/93501db7da737bcee19189b16c6c1d805e2961 b/tests/complexnetwork.git/objects/b2/93501db7da737bcee19189b16c6c1d805e2961 new file mode 100644 index 0000000..0e7c870 --- /dev/null +++ b/tests/complexnetwork.git/objects/b2/93501db7da737bcee19189b16c6c1d805e2961 @@ -0,0 +1,2 @@ +xM +0@a9LkW^a2MmiK>ɖ\jI $IEчdF4$l4#KZ+1t5hƈ~Hl56iKUVƟ92o/8?[ؗy^N `oL]GMZVdm/bU&~G \ No newline at end of file diff --git a/tests/complexnetwork.git/objects/bc/78d72b2eaefa6508ff12ff1f6264390fd6206d b/tests/complexnetwork.git/objects/bc/78d72b2eaefa6508ff12ff1f6264390fd6206d new file mode 100644 index 0000000000000000000000000000000000000000..1990985c6addc722dfc201154540ea6ca2ec2500 GIT binary patch literal 49 zcmV-10M7q-0ZYosPf{?oWbn+(EXhpFQAp0u&CM*~GAu5EF^%$4U`*p8IMbvg111Up H{zMk6TDlf} literal 0 HcmV?d00001 diff --git a/tests/complexnetwork.git/objects/c4/6a964ed35b3f794561c039ede9b9c3f34cabd7 b/tests/complexnetwork.git/objects/c4/6a964ed35b3f794561c039ede9b9c3f34cabd7 new file mode 100644 index 0000000..741ed7a --- /dev/null +++ b/tests/complexnetwork.git/objects/c4/6a964ed35b3f794561c039ede9b9c3f34cabd7 @@ -0,0 +1,2 @@ +xK +1EQYEIcGn[G^ށe*@LL?Ffs0΋8I2J2ݠv.Vp.9c3E7wq!6gFfcPQQAjFE%uCKNWcXDTu!rYs)byWwKP`G5S0@@= zQvMu8i4j9Y&=)t$ue#f64c1O{-jVfN#MUt$MTs#!CAo>kC8x5x=psYQkSHIWBFZ7;M<5yZJ%yr|(#|Z24Io}G+%OTWq;$l)`*&2a-4-$ZlI!^ZC Q{^G3A_QRTe0R^{5Va=sXga7~l literal 0 HcmV?d00001 diff --git a/tests/complexnetwork.git/objects/dc/0daeef8c1337e2967b245e4ecebc9714aea243 b/tests/complexnetwork.git/objects/dc/0daeef8c1337e2967b245e4ecebc9714aea243 new file mode 100644 index 0000000000000000000000000000000000000000..1a3710adac51777363b2fd2644ce6ead47d81415 GIT binary patch literal 52 zcmV-40L%Y)0ZYosPf{>9VDQY#EXhpFQAp0u&CM*~GAu5EF^%$4U`*p8IMbvg114&U KU;+RPm>Ow`CKhS{ literal 0 HcmV?d00001 diff --git a/tests/complexnetwork.git/objects/e5/8f853cf83361281e02d8d4cf38379f408d9fa9 b/tests/complexnetwork.git/objects/e5/8f853cf83361281e02d8d4cf38379f408d9fa9 new file mode 100644 index 0000000000000000000000000000000000000000..941529d0139569a020cc2ff1f6ca383d0cf5a274 GIT binary patch literal 163 zcmV;U09^lg0iBLPPQ)+_06FIsz9XSDw%0~lp*?fr3y$luMeTMKvWVxCH*lTNNaM%8 zuN_L!r`{p}!(WwI>WO*5I$I?ttx=YOL{tUIHAK?gTHHEh@gfpd6hr1oIC5k(TR0{* z#NlRC^<j literal 0 HcmV?d00001 diff --git a/tests/complexnetwork.git/objects/e9/68ce1739464cb6b76ad6cd6cf32155fe966a93 b/tests/complexnetwork.git/objects/e9/68ce1739464cb6b76ad6cd6cf32155fe966a93 new file mode 100644 index 0000000000000000000000000000000000000000..0fbe762dd1d59208b6c41f5d8351a10289d4db88 GIT binary patch literal 62 zcmV-E0Kxxw0V^p=O;s?nWH2-^Ff%bxNGeLqOU^K4P*wc-yyNA;9f?iJPo{Xv{!fXV UCI(fKn^;_uT7*>v09K11LH%_ZU;qFB literal 0 HcmV?d00001 diff --git a/tests/complexnetwork.git/objects/ea/3bfa19f04b91d7f2580eb314c4e5db16a39719 b/tests/complexnetwork.git/objects/ea/3bfa19f04b91d7f2580eb314c4e5db16a39719 new file mode 100644 index 0000000000000000000000000000000000000000..4372bb670ef599aa5a67545413bd19eaf230c456 GIT binary patch literal 203 zcmV;+05t!20iBOQN(3M#PG$w-1V}S_2n|Xm zKYPtYK6=R&4I`!a*Kd_9rwkNRz+}}pmcorwE?5=X>|3g)G|A_2*}Hp@uf@81lT~!t zKiuQ{0Jrt~`Mk-pKIpzZIiC>6N}}NIAplH+j#J0*{-sZ^*3af@m#bdf={Lh^`T-Ea FSkk)GXx;z- literal 0 HcmV?d00001 diff --git a/tests/complexnetwork.git/objects/f1/33084691e488fdf3dcd67f0dff4df2f55fb711 b/tests/complexnetwork.git/objects/f1/33084691e488fdf3dcd67f0dff4df2f55fb711 new file mode 100644 index 0000000..b37b9b8 --- /dev/null +++ b/tests/complexnetwork.git/objects/f1/33084691e488fdf3dcd67f0dff4df2f55fb711 @@ -0,0 +1,3 @@ +xK +1]̴ ڕW|tFG\*^\y,Zr%w^XE m`&GDRUfӒ +x$O,B4tS%Agn:i luq@Z2}{dDh;YnB%l~Fj \ No newline at end of file diff --git a/tests/complexnetwork.git/objects/f1/5937966760f6b4b43fa278940e3ff0c55ef698 b/tests/complexnetwork.git/objects/f1/5937966760f6b4b43fa278940e3ff0c55ef698 new file mode 100644 index 0000000000000000000000000000000000000000..c9f1b5a87120fb3ef003326e3a7e5f2ecbc27241 GIT binary patch literal 82 zcmV-Y0ImOc0V^p=O;s?nWH2-^Ff%bxNGeLqOU^K4P*wc-yyNA;9f?iJPo{Xv{!fXV oCI(fKn^;_uTEy_HDqs)K*Qn_~_kLRRJg!bOxTO3!0AC&;UaLhVY5)KL literal 0 HcmV?d00001 diff --git a/tests/complexnetwork.git/objects/f4/608d27b543d97506d490187b094dc89f5e1131 b/tests/complexnetwork.git/objects/f4/608d27b543d97506d490187b094dc89f5e1131 new file mode 100644 index 0000000..87def83 --- /dev/null +++ b/tests/complexnetwork.git/objects/f4/608d27b543d97506d490187b094dc89f5e1131 @@ -0,0 +1 @@ +x+)JMU040a040031QH*JK0dUk{?-zW'\RE1CD7˯j Ntޑ[1$7$Wߚ'ٚ5B g* \ No newline at end of file diff --git a/tests/complexnetwork.git/objects/f7/f0860affbf5445ef0d8b5388cd9814a2063d57 b/tests/complexnetwork.git/objects/f7/f0860affbf5445ef0d8b5388cd9814a2063d57 new file mode 100644 index 0000000..0e1245a --- /dev/null +++ b/tests/complexnetwork.git/objects/f7/f0860affbf5445ef0d8b5388cd9814a2063d57 @@ -0,0 +1,2 @@ +xM +0a9E vT#)ioPrNM]̒#z?+pd1 3b&QiݴkC}@:7bAv/U^蝸+-Ra]>[B'9qՀr@)ѵl+_l]H \ No newline at end of file diff --git a/tests/complexnetwork.git/objects/f9/60dbfbcd8afc9d37c6a3077c31f5fc0cabee0c b/tests/complexnetwork.git/objects/f9/60dbfbcd8afc9d37c6a3077c31f5fc0cabee0c new file mode 100644 index 0000000000000000000000000000000000000000..05012f57c84f4a6e1620ee46c2f872826ef95170 GIT binary patch literal 202 zcmV;*05$)30iBOQN(3+j3Z!^4&37vmHaGn3*F(=i-Z}E-t3*p;7OkA+*jpnVXDuJuKx4R3Lh-$awX|X1WEEZZ z5BvB&!EOD1K5w$D54vwp76Xx=Ga=f0Z~$h~dFq(nzjX83#<|%t?UcUp;4dBOSF#lC*8k4$Mjamg2ugVx4-i3X0S5Jk6rvi0t- QT!cy+FA7ln08IZ!JRj{!%m4rY literal 0 HcmV?d00001 diff --git a/tests/complexnetwork.git/objects/fe/613ab22f00f45c5041697089c756fda875ac8e b/tests/complexnetwork.git/objects/fe/613ab22f00f45c5041697089c756fda875ac8e new file mode 100644 index 0000000000000000000000000000000000000000..c4886dd957abca67daab8c9fb9b8d8a142973e5f GIT binary patch literal 163 zcmV;U09^lg0iDiE3c@fDfMM4;#q0%{$zzg&h-+6~VUnh{(ibs`$2Vti`@;u++LmRi zpmjLZk~0u{r(@!Pee4G9Nmv_$gQbjvpmvtL4O!GKC9f5vPsp7^!@VKY0|w93Q}WDY zNqjWfSaw#)yN+9dn|!8R;4ZVIX?wx>*}^`5ua8Bh`INTh0_2RbAutgfQ6s8W+hlF- RFRo&dHH{8X{Q#e?Mn1SjP@Vt) literal 0 HcmV?d00001 diff --git a/tests/complexnetwork.git/objects/fe/e3923c6d9fae66a7c275b2a9d04e47db88b2eb b/tests/complexnetwork.git/objects/fe/e3923c6d9fae66a7c275b2a9d04e47db88b2eb new file mode 100644 index 0000000000000000000000000000000000000000..495ebe06df948293e82907262a72c20f4a12c00f GIT binary patch literal 51 zcmb Date: Mon, 30 Jul 2018 23:01:44 +0200 Subject: [PATCH 03/12] Add explicit detection for plain but not clean parentship relations --- git_workflow_quality/__init__.py | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/git_workflow_quality/__init__.py b/git_workflow_quality/__init__.py index 1a8f255..6b81a25 100644 --- a/git_workflow_quality/__init__.py +++ b/git_workflow_quality/__init__.py @@ -429,6 +429,14 @@ def new_branch ( self , branchname , orphan=False ) : self.branches.append( Branch(branchname, orphan) ) return self.branches[-1] + def join_branch ( self , source , branch ) : + source.set_child( branch.begin() ) + for commit in list(branch) : + source.branch.append( commit ) + self.branches.remove(branch) + if len(source.branch.name) > len(branch.name) : + source.branch.name = branch.name + def events( self , details=False) : output = [''] event_list , msgs = self.event_list( details ) @@ -667,6 +675,13 @@ def set_childs ( self ) : begin = branch.begin() if not begin.parent : continue + source = begin.parent + if not source.forks and not begin.parents : + # This is in fact a plain commit with a single edge. As ancestry assigns childs, it cannot be detected there + self.join_branch( source , branch ) + n += 1 + continue + # Concatenation happens in two cases : # incoming merge : a parent commit whose single child is the first commit on branch # outgoing merge : the first commit has a single parent, and only one of their childs has a single parent @@ -674,13 +689,7 @@ def set_childs ( self ) : candidates = [ c for c in begin.get_parents() if not c.forks and c.child == begin ] + [ c.parent for c in begin.parent.get_childs() if not begin.parents and not c.parents ] if len(candidates) == 1 : - source = candidates[0] - source.set_child( branch.begin() ) - for commit in list(branch) : - source.branch.append( commit ) - self.branches.remove(branch) - if len(source.branch.name) > len(branch.name) : - source.branch.name = branch.name + self.join_branch ( candidates[0] , branch ) n += 1 if n : print "WARNING : %d branches removed by concatenation with parents" % n From 1c9075a72854e40bf4d386734b2b1864ccfd416d Mon Sep 17 00:00:00 2001 From: Javier Palacios Date: Thu, 2 Aug 2018 01:17:34 +0200 Subject: [PATCH 04/12] Enforce name matching on branch continuation --- git_workflow_quality/__init__.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/git_workflow_quality/__init__.py b/git_workflow_quality/__init__.py index 6b81a25..634d21c 100644 --- a/git_workflow_quality/__init__.py +++ b/git_workflow_quality/__init__.py @@ -102,6 +102,9 @@ def merges ( self ) : def stats ( self ) : return len(self), len(self.commits()), len(self.merges()) + def matches ( self , other ) : + return self.name.startswith( other.name ) or other.name.startswith( self.name ) + def begin ( self ) : begins = [ c for c in list.__iter__(self) if not c.parent ] if not begins : @@ -684,13 +687,15 @@ def set_childs ( self ) : # Concatenation happens in two cases : # incoming merge : a parent commit whose single child is the first commit on branch - # outgoing merge : the first commit has a single parent, and only one of their childs has a single parent + # outgoing merge : the first commit has a single parent, and this is the only one of their childs with a single parent # We filter on candidates number, as the second condition is matched by standard branch forking - candidates = [ c for c in begin.get_parents() if not c.forks and c.child == begin ] + [ c.parent for c in begin.parent.get_childs() if not begin.parents and not c.parents ] + candidates = [ c for c in begin.get_parents() if not c.forks ] + [ c.parent for c in begin.parent.get_childs() if not begin.parents and not c.parents ] - if len(candidates) == 1 : - self.join_branch ( candidates[0] , branch ) + if len(candidates) == 1 and branch.matches( candidates[0].branch ) : + self.join_branch( candidates[0] , branch ) n += 1 + continue + if n : print "WARNING : %d branches removed by concatenation with parents" % n if m : From 5ba0a7df328d08d78bb004974147f7d8043c201b Mon Sep 17 00:00:00 2001 From: Javier Palacios Date: Thu, 2 Aug 2018 21:41:21 +0200 Subject: [PATCH 05/12] BUGFIX: commit remerged branches identified as concatenable branches --- git_workflow_quality/__init__.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/git_workflow_quality/__init__.py b/git_workflow_quality/__init__.py index 634d21c..632b7b2 100644 --- a/git_workflow_quality/__init__.py +++ b/git_workflow_quality/__init__.py @@ -685,6 +685,13 @@ def set_childs ( self ) : n += 1 continue + # Some fast re-merges are quite difficult to identify heuristically + if source.forks and begin.parents and begin.parents[0] in source.get_childs() : + matches = [ c for c in begin.get_parents() if branch.matches( c.branch ) ] + if matches : + self.join_branch ( matches[0] , branch ) + continue + # Concatenation happens in two cases : # incoming merge : a parent commit whose single child is the first commit on branch # outgoing merge : the first commit has a single parent, and this is the only one of their childs with a single parent From d036b2450da827eb3d031492b7870c2bd110bcea Mon Sep 17 00:00:00 2001 From: Javier Palacios Date: Fri, 3 Aug 2018 20:39:23 +0200 Subject: [PATCH 06/12] Remove all heuristics from branch concatenation, keeping only name based fallback --- git_workflow_quality/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/git_workflow_quality/__init__.py b/git_workflow_quality/__init__.py index 632b7b2..05ececb 100644 --- a/git_workflow_quality/__init__.py +++ b/git_workflow_quality/__init__.py @@ -688,8 +688,9 @@ def set_childs ( self ) : # Some fast re-merges are quite difficult to identify heuristically if source.forks and begin.parents and begin.parents[0] in source.get_childs() : matches = [ c for c in begin.get_parents() if branch.matches( c.branch ) ] - if matches : + if len(matches) == 1 and not matches[0].branch.is_primary() : self.join_branch ( matches[0] , branch ) + n += 1 continue # Concatenation happens in two cases : From 56eaf09e8a698940fd3aadb37d4e128a244bdfa8 Mon Sep 17 00:00:00 2001 From: Javier Palacios Date: Sun, 5 Aug 2018 00:31:45 +0200 Subject: [PATCH 07/12] BUGFIX: concatenation performed out of end of branch --- git_workflow_quality/__init__.py | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/git_workflow_quality/__init__.py b/git_workflow_quality/__init__.py index 05ececb..9269419 100644 --- a/git_workflow_quality/__init__.py +++ b/git_workflow_quality/__init__.py @@ -685,24 +685,16 @@ def set_childs ( self ) : n += 1 continue - # Some fast re-merges are quite difficult to identify heuristically - if source.forks and begin.parents and begin.parents[0] in source.get_childs() : - matches = [ c for c in begin.get_parents() if branch.matches( c.branch ) ] - if len(matches) == 1 and not matches[0].branch.is_primary() : - self.join_branch ( matches[0] , branch ) - n += 1 - continue - # Concatenation happens in two cases : # incoming merge : a parent commit whose single child is the first commit on branch # outgoing merge : the first commit has a single parent, and this is the only one of their childs with a single parent - # We filter on candidates number, as the second condition is matched by standard branch forking candidates = [ c for c in begin.get_parents() if not c.forks ] + [ c.parent for c in begin.parent.get_childs() if not begin.parents and not c.parents ] + if len(candidates) != 1 : continue - if len(candidates) == 1 and branch.matches( candidates[0].branch ) : - self.join_branch( candidates[0] , branch ) + source = candidates[0] + if source.branch.end() == source and branch.matches( source.branch ) : + self.join_branch( source , branch ) n += 1 - continue if n : print "WARNING : %d branches removed by concatenation with parents" % n From cbf697e0304f926ac05481051e0399b8978eb398 Mon Sep 17 00:00:00 2001 From: Javier Palacios Date: Sun, 5 Aug 2018 12:04:36 +0200 Subject: [PATCH 08/12] Improve detection of branches merged back after first commit --- git_workflow_quality/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/git_workflow_quality/__init__.py b/git_workflow_quality/__init__.py index 9269419..56baa5e 100644 --- a/git_workflow_quality/__init__.py +++ b/git_workflow_quality/__init__.py @@ -685,6 +685,10 @@ def set_childs ( self ) : n += 1 continue + if [ c for c in begin.get_childs() if c.branch == source.branch ] : + print "WARNING : %s merged back into %s" % ( begin.branch.pretty() , source.branch.pretty() ) + continue + # Concatenation happens in two cases : # incoming merge : a parent commit whose single child is the first commit on branch # outgoing merge : the first commit has a single parent, and this is the only one of their childs with a single parent From ec79300b07d40b60459888af6b7098f523737dae Mon Sep 17 00:00:00 2001 From: Javier Palacios Date: Sun, 5 Aug 2018 15:55:03 +0200 Subject: [PATCH 09/12] BUGFIX: branches with duplicated names not properly detected --- git_workflow_quality/__init__.py | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/git_workflow_quality/__init__.py b/git_workflow_quality/__init__.py index 56baa5e..723a080 100644 --- a/git_workflow_quality/__init__.py +++ b/git_workflow_quality/__init__.py @@ -381,12 +381,31 @@ def get_branches () : fd.close() return branches +class BranchList ( list ) : + + def __init__ ( self ) : + self.names = [] + list.__init__( self ) + + def get ( self , name ) : + match = [ b for b in self if b.name == name ] + if item.name in self.names : + assert len(match) == 1 + return match[0] + assert not match + return None + + def append ( self , item ) : + if item.name in self.names : assert False + self.names.append( item.name ) + list.append( self , item ) + class Repository ( dict ) : def __init__ ( self ) : self.order = [] - self.branches = [] + self.branches = BranchList() cmd = subprocess.Popen( ['git', 'log', '--all', '--format="%H \"%ae\" \"%ce\" %s"'] , stdout=subprocess.PIPE ) line = cmd.stdout.readline() @@ -422,8 +441,8 @@ def set_params ( self , sha , line ) : raise Exception( "Octopus merges on %s from %s not handled" % ( self[sha].sha , ", ".join([c.sha for c in self[sha].parents]) ) ) def new_branch ( self , branchname , orphan=False ) : - match = [ branch for branch in self.branches if branch.name == branchname ] - if match : + if branchname in self.branches.names : + match = [ branch for branch in self.branches if branch.name == branchname ] assert len(match) == 1 if match[0].is_primary() : return match[0] From 86599c9cc11a348271a9ee36bccc84ef58a36515 Mon Sep 17 00:00:00 2001 From: Javier Palacios Date: Sun, 5 Aug 2018 20:15:21 +0200 Subject: [PATCH 10/12] Increase tests over complex repositories --- do_test.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/do_test.py b/do_test.py index adf4292..c8e45da 100644 --- a/do_test.py +++ b/do_test.py @@ -60,6 +60,24 @@ def fail( msg , fd=os.sys.stdout ) : os.chdir( 'tests/complexnetwork.git' ) repo = git_workflow_quality.Repository() +count = len([ c for c in repo.values() if not c.child ]) +if count == 2 : + ret += ok( "open branches properly found" ) +else : + ret += fail( "found %d opened branches" % count ) +# +count = repo.event_list()[0]['multimerged'] +if count == 1 : + ret += ok( "1 multimerged found" ) +else : + ret += fail( "%d multimerged found" % count ) +# +count = repo.event_list()[0]['conflict'] +if count == 1 : + ret += ok( "1 conflict found" ) +else : + ret += fail( "%d conflict found" % count ) +# count = len(repo.branches) if count == 8 : ret += ok( "complex branches properly concatenated" ) From 283c2d44abfe3644d1ab39ff2125bd37bd5dbc3f Mon Sep 17 00:00:00 2001 From: Javier Palacios Date: Sun, 5 Aug 2018 20:47:18 +0200 Subject: [PATCH 11/12] BUGFIX: primary child not set on branches with just one commit --- git_workflow_quality/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/git_workflow_quality/__init__.py b/git_workflow_quality/__init__.py index 723a080..8f66bf0 100644 --- a/git_workflow_quality/__init__.py +++ b/git_workflow_quality/__init__.py @@ -44,6 +44,8 @@ def add_child ( self , child ) : self.child = child elif child not in self.forks : self.forks.append( child ) + if not child.child and child.forks : + child.child = child.forks.pop(0) def get_parents ( self , full=True ) : parents = [] From 9279d6b7c3a2b6361665eaf9e5280230dcb7f583 Mon Sep 17 00:00:00 2001 From: Javier Palacios Date: Sun, 12 Aug 2018 14:20:44 +0200 Subject: [PATCH 12/12] Make branch concatenation optional, showing branch events before and after concatenation --- git_workflow_quality/__init__.py | 38 +++++++++++++++++++++++++------- gwfqa | 3 ++- 2 files changed, 32 insertions(+), 9 deletions(-) diff --git a/git_workflow_quality/__init__.py b/git_workflow_quality/__init__.py index 8f66bf0..debb131 100644 --- a/git_workflow_quality/__init__.py +++ b/git_workflow_quality/__init__.py @@ -404,10 +404,11 @@ def append ( self , item ) : class Repository ( dict ) : - def __init__ ( self ) : + def __init__ ( self , concatenate=True ) : self.order = [] self.branches = BranchList() + self.concatenated = concatenate cmd = subprocess.Popen( ['git', 'log', '--all', '--format="%H \"%ae\" \"%ce\" %s"'] , stdout=subprocess.PIPE ) line = cmd.stdout.readline() @@ -432,6 +433,9 @@ def __init__ ( self ) : self.set_childs() + if self.concatenated : + self.concatenated = self.concatenation() + def set_params ( self , sha , line ) : self[sha].author_date = int(line[0]) self[sha].committer_date = int(line[1]) @@ -468,12 +472,19 @@ def events( self , details=False) : if msgs : output.extend( msgs ) output.append( "Branch events" ) + if self.concatenated and self.base_events : output[-1] += " %+10d branches" % self.concatenated output.append( " multitarget %4d" % event_list['multitarget'] ) + if self.concatenated and self.base_events : output[-1] += " %4d" % self.base_events['multitarget'] output.append( " reutilized %4d" % event_list['reutilized'] ) + if self.concatenated and self.base_events : output[-1] += " %4d" % self.base_events['reutilized'] output.append( " multimerged %4d" % event_list['multimerged'] ) + if self.concatenated and self.base_events : output[-1] += " %4d" % self.base_events['multimerged'] output.append( " indirect %4d" % event_list['indirect'] ) + if self.concatenated and self.base_events : output[-1] += " %4d" % self.base_events['indirect'] output.append( " multisource %4d" % event_list['multisource'] ) + if self.concatenated and self.base_events : output[-1] += " %4d" % self.base_events['multisource'] output.append( " conflict %4d" % event_list['conflict'] ) + if self.concatenated and self.base_events : output[-1] += " %4d" % self.base_events['conflict'] output.append( "" ) return "\n".join(output) @@ -687,14 +698,23 @@ def set_childs ( self ) : branch.ancestry( c ) self.order.reverse() - n , m = 0 , 0 + m = 0 + # Remove items within the loop is not safe + __branches = [ branch for branch in self.branches if len(branch) == 0 ] + for branch in __branches : + self.branches.remove(branch) + m += 1 + if m : + print "ERROR : generated %d empty branches" % m + + def concatenation ( self ) : + + self.base_events , drop = self.event_list() + + n = 0 # Remove items within the loop is not safe __branches = [ branch for branch in self.branches ] for branch in __branches : - if len(branch) == 0 : - self.branches.remove(branch) - m += 1 - continue begin = branch.begin() if not begin.parent : continue @@ -723,6 +743,8 @@ def set_childs ( self ) : if n : print "WARNING : %d branches removed by concatenation with parents" % n - if m : - print "ERROR : generated %d empty branches" % m + else : + self.base_events = [] + + return n diff --git a/gwfqa b/gwfqa index acdd958..841afdf 100644 --- a/gwfqa +++ b/gwfqa @@ -10,10 +10,11 @@ if __name__ == '__main__' : parser = argparse.ArgumentParser(description='Extract simple analytics from git repository') parser.add_argument('--detailed', action='store_true', help='Show per-branch statistics') parser.add_argument('--graph', choices=['topo', 'date', 'backwards'], help='Generate gitgraphjs file') + parser.add_argument('--no-concatenate', dest='concatenate', action='store_false', help='Express branch relations in dot language') parser.add_argument('--dot', help='Express branch relations in dot language') args = parser.parse_args() - repo = git_workflow_quality.Repository() + repo = git_workflow_quality.Repository(args.concatenate) print repo.report(args.detailed)