libgit2 / libgit2/pygit2

revparse_single does not understand date

Open
#726 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1.7k
Forks
408
Avg merge
2d 57m
Merged PRs (30d)
7

Description

Hi,

revparse_single does not support date parsing:

$ git rev-parse 'HEAD@{2 weeks ago}'
eebac5f1c21ec78e098a8f7b60facd726b30844e
$ python3 -c 'import pygit2; pygit2.Repository(".").revparse_single("HEAD@{2 weeks ago}")'
Traceback (most recent call last):
File "", line 1, in
KeyError: 'HEAD@{2 weeks ago}'

I am using version 0.26.0

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with git rev-parse and pygit2.Repository.revparse_single using HEAD@{2 weeks ago}. Trace how revparse_single handles the supplied revision and compare its behavior with Git. Done means date-based revision syntax resolves successfully instead of raising KeyError, with coverage for the reported example.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, python
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.