Is Rugged::Commit.diff right?
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 2.3k
- Forks
- 293
- PR merge metrics
- No merged PRs in 30d
Description
I use walker find a commit but when i get it`s diff, i think the result is wrong.
rugged/lib/rugged/commit.rb
def diff(*args)
args.unshift(parents.first) if args.size == 1 && args.first.is_a?(Hash)
self.tree.diff(*args)
end
rugged/lib/rugged/tree.rb
def diff(other = nil, options = nil)
Tree.diff(repo, self, other, options)
end
but
rugged/ext/rugged/rugged_tree.c
* call-seq:
* Tree.diff(repo, tree, diffable[, options]) -> diff
*
* Returns a diff between the `tree` and the diffable object that was given.
* +diffable+ can either be a +Rugged::Commit+, a +Rugged::Tree+, a +Rugged::Index+,
* or +nil+.
*
* The +tree+ object will be used as the "old file" side of the diff, while the
* parent tree or the +diffable+ object will be used for the "new file" side.
so all seams right, but as the comment say The +tree+ object will be used as the "old file" side of the diff, while the parent tree or the +diffable+ object will be used for the "new file" side, is parent used as new side right?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Trace the call flow in rugged/lib/rugged/commit.rb and rugged/lib/rugged/tree.rb into the Tree.diff implementation in rugged/ext/rugged/rugged_tree.c. Reproduce the reported walker commit diff, then compare the observed old and new sides with the C documentation and clarify whether the parent is used as the new side.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, git, ruby
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100