libgit2 / libgit2/rugged

Rugged::Tree and Rugged::Index do similar things but have different APIs

Open
#684 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
2.3k
Forks
293
PR merge metrics
No merged PRs in 30d

Description

(Relates to #683)

It would be nice if Rugged::Index and Rugged::Tree provided the same methods where possible. For example, it would be nice if both supported the same interface for reading and enumerating objects.

Some ideas:

  • Both should support fetch(path, default=nil, &block) for looking up a path entry.
  • Both should support each(prefix=nil) for enumerating entries efficiently.
  • Other methods where it makes sense (e.g. each_tree, each_blob).

Some of these might also extent to Rugged::Tree::Builder, but I'm not sure how feasible that is.

Contributor guide

No contributing guide indexed for this repository

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 comparing the public APIs of Rugged::Tree and Rugged::Index, then read the related discussion in issue #683. Determine which lookup and enumeration methods can share an interface and whether Rugged::Tree::Builder belongs in scope. Done means the desired common API and its scope are agreed and implemented consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
api
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.