libgit2 / libgit2/pygit2

Example for git reset HEAD -- filename.type please

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

Nobody has claimed this yet.

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

Description

I am coming at GIT with an external view of how it works. Internals I have very little idea about.

I have figured out that I need to call repo.reset() to do the same as git reset HEAD -- filename.type.

But I have no idea how to find the OID that I need to use.

Looking at git-reset code I seem to need a treeish. How do I get a treeish that corresponds to HEAD?
I guess I walk that tree looking for the filename and get a OID from the tree.

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 reading the mentioned repo.reset() API and the git-reset code, focusing on how a treeish corresponding to HEAD and the filename OID are obtained. Done means adding an example that explains the equivalent of git reset HEAD -- filename.type for pygit2.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, python
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.