We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
You can continue the conversation there. Go to discussion →
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Am I missing something or is that currently missing?
The git command would be git cat-file commit {git_hash}.
git cat-file commit {git_hash}
I used the following before using GitPython:
def git_hash_is_valid(git_hash): return subprocess_return_call(f"git cat-file commit {git_hash}") == 0 def subprocess_return_call(call_string): call_parameters = call_string.split(" ") return subprocess.call( call_parameters, stderr=subprocess.STDOUT, stdout=open(os.devnull, 'w') )
Would a method like that fit into repo directly like repo.is_ancestor()?
repo.is_ancestor()
I know self.repo.commit( works, but that does not differentiate between refs and commit hashes.
self.repo.commit(
The text was updated successfully, but these errors were encountered:
PS: If this is something that would be ok to include, I'd create the PR, I'm currently doing it with this:
def hash_is_valid(self, git_hash): try: self.repo.commit(git_hash) except ValueError: return False return True
Sorry, something went wrong.
PPS: We could also add default values to the repo.commit( method, to add SymbolicReferences=True, Commit=True, TagObject=True, Blob=True, Tree=True
repo.commit(
SymbolicReferences=True, Commit=True, TagObject=True, Blob=True, Tree=True
No branches or pull requests
Am I missing something or is that currently missing?
The git command would be
git cat-file commit {git_hash}
.I used the following before using GitPython:
Would a method like that fit into repo directly like
repo.is_ancestor()
?I know
self.repo.commit(
works, but that does not differentiate between refs and commit hashes.The text was updated successfully, but these errors were encountered: