git 5.0.0.beta.1 → 5.0.0.beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/copilot-instructions.md +6 -0
- data/.github/prompts/iteratively-address-copilot-reviews.prompt.md +188 -0
- data/.github/skills/extract-facade-from-base-lib/KEYWORD_ARG_REMEDIATION.md +22 -0
- data/.github/skills/extract-facade-from-base-lib/SKILL.md +28 -14
- data/.github/skills/facade-implementation/SKILL.md +14 -0
- data/.github/skills/facade-test-conventions/SKILL.md +14 -0
- data/.rubocop.yml +5 -0
- data/README.md +90 -22
- data/UPGRADING.md +141 -0
- data/git.gemspec +5 -0
- data/lib/git/branch.rb +7 -18
- data/lib/git/branches.rb +2 -10
- data/lib/git/command_line/base.rb +10 -0
- data/lib/git/command_line/capturing.rb +5 -3
- data/lib/git/command_line/streaming.rb +5 -3
- data/lib/git/command_line.rb +3 -3
- data/lib/git/commands/base.rb +7 -6
- data/lib/git/commands/cat_file/batch.rb +6 -1
- data/lib/git/commands/cat_file/raw.rb +7 -1
- data/lib/git/commands/config_option_syntax/get_urlmatch.rb +5 -0
- data/lib/git/commands/show_ref/exclude_existing.rb +1 -1
- data/lib/git/commands/update_ref/batch.rb +1 -1
- data/lib/git/commands/version.rb +5 -0
- data/lib/git/commands.rb +5 -7
- data/lib/git/config.rb +17 -0
- data/lib/git/config_entry_info.rb +106 -0
- data/lib/git/configuring.rb +665 -0
- data/lib/git/deprecation.rb +9 -0
- data/lib/git/diff.rb +4 -8
- data/lib/git/diff_path_status.rb +2 -13
- data/lib/git/diff_stats.rb +1 -9
- data/lib/git/execution_context/global.rb +3 -28
- data/lib/git/execution_context/repository.rb +30 -41
- data/lib/git/execution_context.rb +43 -24
- data/lib/git/log.rb +3 -9
- data/lib/git/object.rb +14 -21
- data/lib/git/parsers/config_entry.rb +110 -0
- data/lib/git/parsers/ls_remote.rb +79 -0
- data/lib/git/remote.rb +7 -20
- data/lib/git/repository/branching.rb +183 -12
- data/lib/git/repository/committing.rb +64 -68
- data/lib/git/repository/context_helpers.rb +264 -0
- data/lib/git/repository/factories.rb +682 -0
- data/lib/git/repository/inspecting.rb +99 -0
- data/lib/git/repository/maintenance.rb +65 -0
- data/lib/git/repository/merging.rb +63 -1
- data/lib/git/repository/object_operations.rb +133 -35
- data/lib/git/repository/path_resolver.rb +1 -1
- data/lib/git/repository/remote_operations.rb +166 -21
- data/lib/git/repository/staging.rb +187 -23
- data/lib/git/repository/stashing.rb +39 -3
- data/lib/git/repository/status_operations.rb +21 -0
- data/lib/git/repository.rb +288 -128
- data/lib/git/stash.rb +2 -9
- data/lib/git/stashes.rb +2 -7
- data/lib/git/status.rb +12 -23
- data/lib/git/version.rb +2 -2
- data/lib/git/worktree.rb +2 -15
- data/lib/git/worktrees.rb +2 -15
- data/lib/git.rb +182 -77
- data/redesign/3_architecture_implementation.md +170 -112
- data/redesign/Phase 4 - Step A.md +366 -0
- data/redesign/beta_release.md +107 -0
- data/redesign/c1c2_audit.md +566 -0
- data/redesign/c1c2_bucket6_lib_orphans.md +626 -0
- data/redesign/config_design.rb +501 -0
- metadata +19 -6
- data/lib/git/base.rb +0 -1204
- data/lib/git/lib.rb +0 -2855
- data/lib/git/repository/configuring.rb +0 -156
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Git
|
|
4
|
+
# Represents a single Git configuration entry
|
|
5
|
+
#
|
|
6
|
+
# Returned by {Git::Configuring} read operations such as {Git::Configuring#config_get},
|
|
7
|
+
# {Git::Configuring#config_get_all}, {Git::Configuring#config_list}, and their
|
|
8
|
+
# related methods.
|
|
9
|
+
#
|
|
10
|
+
# @example Create a ConfigEntryInfo
|
|
11
|
+
# entry = Git::ConfigEntryInfo.new(
|
|
12
|
+
# scope: 'local',
|
|
13
|
+
# origin: 'file:.git/config',
|
|
14
|
+
# key: 'remote.origin.url',
|
|
15
|
+
# value: 'https://github.com/ruby-git/ruby-git'
|
|
16
|
+
# )
|
|
17
|
+
# entry.section # => "remote"
|
|
18
|
+
# entry.subsection # => "origin"
|
|
19
|
+
# entry.variable # => "url"
|
|
20
|
+
#
|
|
21
|
+
# @api public
|
|
22
|
+
#
|
|
23
|
+
# @!attribute [r] scope
|
|
24
|
+
#
|
|
25
|
+
# The scope of the configuration entry
|
|
26
|
+
#
|
|
27
|
+
# May be one of `"system"`, `"global"`, `"local"`, `"worktree"`, `"command"`,
|
|
28
|
+
# `"file"`, or `"blob"`. The `"command"` scope is used for values supplied
|
|
29
|
+
# via the command line (including default values from `--default`).
|
|
30
|
+
#
|
|
31
|
+
# @return [String] the config scope string (e.g. `"local"`, `"global"`)
|
|
32
|
+
#
|
|
33
|
+
# @!attribute [r] origin
|
|
34
|
+
#
|
|
35
|
+
# Where the configuration entry originates
|
|
36
|
+
#
|
|
37
|
+
# The origin is in the format `<origin-type>:<actual-origin>` and is never
|
|
38
|
+
# blank. The origin type prefix is one of `file:`, `blob:`, `command line:`,
|
|
39
|
+
# or `standard input:`.
|
|
40
|
+
#
|
|
41
|
+
# `nil` when the git command used to retrieve this entry does not support
|
|
42
|
+
# `--show-origin` (currently only `--get-urlmatch`).
|
|
43
|
+
#
|
|
44
|
+
# @return [String, nil] the origin path in the format `<type>:<path>`, or `nil`
|
|
45
|
+
#
|
|
46
|
+
# @!attribute [r] key
|
|
47
|
+
#
|
|
48
|
+
# The full dotted key name of the configuration entry (e.g., `remote.origin.url`)
|
|
49
|
+
#
|
|
50
|
+
# @return [String] the full dotted key name (e.g. `remote.origin.url`)
|
|
51
|
+
#
|
|
52
|
+
# @!attribute [r] value
|
|
53
|
+
#
|
|
54
|
+
# The value of the configuration entry
|
|
55
|
+
#
|
|
56
|
+
# @return [String] the string value of this entry
|
|
57
|
+
#
|
|
58
|
+
ConfigEntryInfo = Data.define(:scope, :origin, :key, :value) do
|
|
59
|
+
# Returns the section component of the key (everything before the first dot)
|
|
60
|
+
#
|
|
61
|
+
# Returns an empty string when the key contains no dot.
|
|
62
|
+
#
|
|
63
|
+
# @example Section component of a dotted key
|
|
64
|
+
# entry.section # => "remote"
|
|
65
|
+
#
|
|
66
|
+
# @return [String] the section name, or an empty string when the key has no dot
|
|
67
|
+
#
|
|
68
|
+
def section = first_dot ? key[0...first_dot] : ''
|
|
69
|
+
|
|
70
|
+
# Returns the subsection component of the key (everything between the first and last dot)
|
|
71
|
+
#
|
|
72
|
+
# Returns an empty string when the key has zero or one dot (no subsection).
|
|
73
|
+
#
|
|
74
|
+
# @example Subsection component of a dotted key
|
|
75
|
+
# entry.subsection # => "origin"
|
|
76
|
+
#
|
|
77
|
+
# @return [String] the subsection name, or an empty string when there is no subsection
|
|
78
|
+
#
|
|
79
|
+
def subsection = first_dot && first_dot != last_dot ? key[(first_dot + 1)...last_dot] : ''
|
|
80
|
+
|
|
81
|
+
# Returns the variable component of the key (everything after the last dot)
|
|
82
|
+
#
|
|
83
|
+
# Returns the full key when the key contains no dot.
|
|
84
|
+
#
|
|
85
|
+
# @example Variable component of a dotted key
|
|
86
|
+
# entry.variable # => "url"
|
|
87
|
+
#
|
|
88
|
+
# @return [String] the variable name (everything after the last dot)
|
|
89
|
+
#
|
|
90
|
+
def variable = last_dot ? key[(last_dot + 1)..] : key
|
|
91
|
+
|
|
92
|
+
private
|
|
93
|
+
|
|
94
|
+
# Returns the index of the first dot in the key, or nil if none exists
|
|
95
|
+
#
|
|
96
|
+
# @return [Integer, nil] the zero-based index of the first dot, or `nil`
|
|
97
|
+
#
|
|
98
|
+
def first_dot = key.index('.')
|
|
99
|
+
|
|
100
|
+
# Returns the index of the last dot in the key, or nil if none exists
|
|
101
|
+
#
|
|
102
|
+
# @return [Integer, nil] the zero-based index of the last dot, or `nil`
|
|
103
|
+
#
|
|
104
|
+
def last_dot = key.rindex('.')
|
|
105
|
+
end
|
|
106
|
+
end
|