libgit2 / libgit2/rugged

Tree#diff: unexpected behavior of option :ignore_submodules

Open
#727 3 comments 1 reaction 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

Doc

:ignore_submodules if true, submodules will be excluded from the diff completely.

Problem

repo 	= Rugged::Repository.new('.')
commit 	= repo.head.target_id
diff    = Rugged::Tree.diff(repo, nil, commit, ignore_submodules: true)

I expect excluding all submodules files but have following:

diff.patches.map { |p| p.delta.new_file[:path] }
=> [".gitmodules", "submodule_repo"]

What is wrong with it?

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 with the Rugged::Tree.diff API documented at rubydoc.info and reproduce the provided Ruby snippet with ignore_submodules: true. Check how diff.patches reports .gitmodules and submodule_repo; done means the option's behavior is clarified or corrected so submodule entries are excluded as described.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, ruby
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.