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

Function read_note

python-impl/evogit/utils/git.py:314–332  ·  view source on GitHub ↗

Read the note of the specified commit. If commit is None, read the note of the current HEAD. Return None if the note does not exist.

(config: EvoGitConfig, commit: Optional[str])

Source from the content-addressed store, hash-verified

312
313
314def read_note(config: EvoGitConfig, commit: Optional[str]) -> Optional[str]:
315 """Read the note of the specified commit. If commit is None, read the note of the current HEAD.
316 Return None if the note does not exist.
317 """
318
319 cmd = ["git", "notes", "show"]
320 if commit is not None:
321 cmd.append(commit)
322
323 completed_proc = subprocess.run(
324 cmd,
325 cwd=config.git_dir,
326 capture_output=True,
327 )
328
329 if completed_proc.returncode != 0:
330 return None
331 else:
332 return completed_proc.stdout.decode("utf-8")
333
334
335def update_file_in_worktree(

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected