MCPcopy Create free account
hub / github.com/FSoft-AI4Code/CodeWiki / commit_documentation

Method commit_documentation

codewiki/cli/git_manager.py:123–153  ·  view source on GitHub ↗

Commit generated documentation. Args: docs_path: Path to documentation directory message: Commit message (optional) Returns: Commit hash Raises: RepositoryError: If commit fails

(
        self,
        docs_path: Path,
        message: Optional[str] = None
    )

Source from the content-addressed store, hash-verified

121
122 def commit_documentation(self, docs_path: Path, message: Optional[str] = None) -> str:
123 """
124 Commit generated documentation.
125
126 Args:
127 docs_path: Path to documentation directory
128 message: Commit message (optional)
129
130 Returns:
131 Commit hash
132
133 Raises:
134 RepositoryError: If commit fails
135 """
136 if message is None:
137 message = "Add generated documentation\n\nGenerated by CodeWiki CLI"
138
139 try:
140 # Add documentation files
141 self.repo.index.add([str(docs_path)])
142
143 # Commit
144 commit = self.repo.index.commit(message)
145
146 return commit.hexsha
147 except GitCommandError as e:
148 raise RepositoryError(f"Failed to commit documentation: {e}")
149
150 def get_remote_url(self, remote_name: str = "origin") -> Optional[str]:
151 """
152 Get remote repository URL.
153
154 Args:
155 remote_name: Name of remote (default: origin)
156

Callers

nothing calls this directly

Calls 2

RepositoryErrorClass · 0.90
addMethod · 0.80

Tested by

no test coverage detected