MCPcopy Create free account
hub / github.com/pytorch/executorch / __init__

Method __init__

scripts/pick_doc_commits.py:82–96  ·  view source on GitHub ↗

Creates a new Commit with the given hash. Args: hash: The hexadecimal hash of the commit. message: The one-line summary of the commit. If empty, this method will ask git for the commit message.

(self, hash: str, message: str = "")

Source from the content-addressed store, hash-verified

80 """A git commit hash and its one-line message."""
81
82 def __init__(self, hash: str, message: str = ""):
83 """Creates a new Commit with the given hash.
84
85 Args:
86 hash: The hexadecimal hash of the commit.
87 message: The one-line summary of the commit. If empty, this method
88 will ask git for the commit message.
89 """
90 self.hash = hash.strip()
91 if not message:
92 # Ask git for the commit message.
93 lines = run_git(["log", "-1", "--pretty=%s", self.hash])
94 # Should just be one line, but could be zero.
95 message = " ".join(lines)
96 self.message = message.strip()
97
98 @staticmethod
99 def from_line(line: str) -> "Commit":

Callers

nothing calls this directly

Calls 1

run_gitFunction · 0.85

Tested by

no test coverage detected