MCPcopy Create free account
hub / github.com/BillHuang2001/evogit / git_crossover

Function git_crossover

python-impl/evogit/api.py:221–232  ·  view source on GitHub ↗

crossover between commit1 and commit2

(config: EvoGitConfig, seed: int, commit1: str, commit2: str)

Source from the content-addressed store, hash-verified

219
220
221def git_crossover(config: EvoGitConfig, seed: int, commit1: str, commit2: str) -> str:
222 """crossover between commit1 and commit2"""
223 random.seed(seed)
224 use_merge = random.choices(
225 [True, False], weights=[config.merge_prob, 1 - config.merge_prob]
226 )[0]
227 if use_merge:
228 git_merge(config, commit1, commit2)
229 else:
230 git_rebase(config, commit1, commit2)
231
232 return git.read_head_commit(config)
233
234
235def git_merge(config: EvoGitConfig, commit1: str, commit2: str) -> None:

Callers

nothing calls this directly

Calls 2

git_mergeFunction · 0.85
git_rebaseFunction · 0.85

Tested by

no test coverage detected