module Git::Configuring

Mixin that adds structured ‘git config` read and write operations

Include or extend this module to gain the full suite of ‘config_*` methods. The including/extending class must implement two private methods:

Read methods that return {Git::ConfigEntryInfo} objects merge ‘show_scope: true, show_origin: true, null: true` into the options so that every returned entry carries its full provenance. Two exceptions apply: {#config_get_urlmatch} merges only `show_scope: true, null: true` because git does not support `–show-origin` with `–get-urlmatch` (those entries always have `origin: nil`); {#config_get_colorbool} returns a plain `String` and does not use these output-format options at all.

@example Include in a repository class

class MyRepo
  include Git::Configuring
  private
  def execution_context = @ctx
  def assert_valid_scope!(**) = nil  # all scopes allowed
end

@example Extend the Git module for global/system config

extend Git::Configuring
def self.execution_context = Git::ExecutionContext::Global.new
private_class_method :execution_context
def self.assert_valid_scope!(**opts)
  # reject :local, :worktree, :blob when called without a repository
end
private_class_method :assert_valid_scope!

@api private