Unable to create new KR posts after reinstalling KR tools
brian8128 opened this issue · 2 comments
brian8128 commented
When I try to create a new knowledge repo post with the command knowledge_repo add ~/Downloads/NeutralLosses\ \(2\).ipynb -p NeutralLossesWithASimpleModel
I get the following error. This happens to everyone on my team who installed the knowledge repo tools recently but doesn't happen to people who installed the knowledge repo tools a while ago.
INFO:knowledge_repo.repositories.gitrepository:Fetching updates to the knowledge repository...
INFO:knowledge_repo.repositories.gitrepository:Checking out (and/or creating) a new branch `NeutralLossesWithASimpleModel.kp`...
INFO:knowledge_repo.repositories.gitrepository:Adding and committing 'NeutralLossesWithASimpleModel.kp' to local branch `NeutralLossesWithASimpleModel.kp`...
Traceback (most recent call last):
File "/Users/brian/opt/miniconda3/envs/ebo/lib/python3.9/site-packages/git/repo/fun.py", line 335, in rev_parse
obj = to_commit(obj)
File "/Users/brian/opt/miniconda3/envs/ebo/lib/python3.9/site-packages/git/repo/fun.py", line 182, in to_commit
if obj.type == 'tag':
AttributeError: 'NoneType' object has no attribute 'type'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/Users/brian/opt/miniconda3/envs/ebo/bin/knowledge_repo", line 287, in <module>
repo.add(kp, path=args.path, update=args.update, branch=args.branch, message=args.message, squash=args.squash)
File "/Users/brian/opt/miniconda3/envs/ebo/lib/python3.9/site-packages/knowledge_repo/repository.py", line 256, in add
self._kp_save(kp, path, update=update)
File "/Users/brian/opt/miniconda3/envs/ebo/lib/python3.9/site-packages/knowledge_repo/repository.py", line 377, in _kp_save
if not update and self.has_post(path):
File "/Users/brian/opt/miniconda3/envs/ebo/lib/python3.9/site-packages/knowledge_repo/repository.py", line 208, in has_post
return self._kp_exists(self._kp_path(path), revision=revision)
File "/Users/brian/opt/miniconda3/envs/ebo/lib/python3.9/site-packages/knowledge_repo/repositories/gitrepository.py", line 404, in _kp_exists
return os.path.isdir(os.path.join(self.path, path)) or (self.git_branch_for_post(path, interactive=False) is not None)
File "/Users/brian/opt/miniconda3/envs/ebo/lib/python3.9/site-packages/knowledge_repo/repositories/gitrepository.py", line 223, in git_branch_for_post
if path in self.git_local_posts(branches=[branch]):
File "/Users/brian/opt/miniconda3/envs/ebo/lib/python3.9/site-packages/knowledge_repo/repositories/gitrepository.py", line 205, in git_local_posts
posts[branch] = set([self.__get_path_from_ref(diff.a_path) for diff in self.git_diff(branch)])
File "/Users/brian/opt/miniconda3/envs/ebo/lib/python3.9/site-packages/knowledge_repo/repositories/gitrepository.py", line 297, in git_diff
commit = self.git.commit(ref)
File "/Users/brian/opt/miniconda3/envs/ebo/lib/python3.9/site-packages/git/repo/base.py", line 536, in commit
return self.rev_parse(str(rev) + "^0")
File "/Users/brian/opt/miniconda3/envs/ebo/lib/python3.9/site-packages/git/repo/fun.py", line 349, in rev_parse
raise BadName(
gitdb.exc.BadName: Ref 'Invalid revision spec '^0' - not enough parent commits to reach '^0'' did not resolve to an object```
matallanas commented
Any luck to solve this issue? I am having the same problem but starting from zero and I can't get it working.
Thank you so much in advance.