libgit2 / libgit2/libgit2sharp

Implement hashing of files without adding it to the object db

Open
#1,666 0 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
3.5k
Forks
925
PR merge metrics
No merged PRs in 30d

Description

Libgit2sharp does not seem to provide the equivalent functionality to git hash-object, even though libgit2 implements it. At first glance, it seems relatively simple to add, and I was planning on working on it and submitting a pull request. I was thinking that there would be a method on Repository that relies on
git_repository_hashfile and the usage would look like

using (var repo = new Repository("/repo"))
{
    string sha;
    sha = repo.HashFile("relative/path.txt");
    sha = repo.HashFile("relative/path.txt", applyFilters: false);
    sha = repo.HashFile("/repo/file.txt");
}

Any feedback is welcome.

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 at the Repository entry point and inspect the libgit2 git_repository_hashfile functionality described in the issue. Define the requested HashFile overloads, including the applyFilters option and repository-relative or absolute paths, while preserving the requirement not to add the file to the object database.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, git
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.