libgit2 / libgit2/libgit2

Support includeIf' `hasconfig:remote.*.url` condition

Open
#6,641 4 comments 11 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
10.6k
Forks
2.7k
PR merge metrics
No merged PRs in 30d

Description

Reproduction steps

I tested with the following in my git config:

# ~/.config/git/config
[includeIf "hasconfig:remote.*.url:https://github.com/libgit2/libgit2.git"]
path = ~/.config/git/libgit2.config
# ~/.config/git/libgit2.config
[foo]
bar = baz
Expected behavior

In a repository cloned from the specified remote, the config key foo.bar should have value baz.

$ git clone https://github.com/libgit2/libgit2.git
Cloning into 'libgit2'...
[...]
$ cd libgit2
$ git config foo.bar
baz
Actual behavior

Conditional include doesn't work, foo.bar has no value.

Version of libgit2 (release number or SHA1)

1.7.1 (through rust's git2 crate 0.18.0)

Operating system(s) tested

Linux

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

Reproduce the issue with the shown Git config, repository clone, and git config foo.bar commands. Then trace libgit2's conditional-include handling for hasconfig:remote.*.url and its remote URL lookup; no source file or test path is named in the report. Done means the include is applied for the matching remote and foo.bar returns baz.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, git
Domain
devtools
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.