You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: Clarify that tag fetch defaults did not change in v6
Section 3 incorrectly claimed that FetchOptions defaulted to AllTags in v5
and changed to NoTags in v6. This was false.
Actual behavior (both v5 and v6):
- CloneOptions.Tags defaults to AllTags
- FetchOptions.Tags defaults to TagFollowing (not AllTags, not NoTags)
TagFollowing fetches tags reachable from fetched commits, matching git CLI
behavior. This has been the default in both v5 and v6.
PR #1459 was not a behavior change - it only fixed a test that incorrectly
expected AllTags behavior without setting it explicitly.
Changes made:
- Corrected section 3 to clarify no default behavior changed
- Explained what TagFollowing actually means
- Removed misleading checklist item about tag fetch defaults changing
- Updated examples to show defaults work identically in both versions
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Signed-off-by: Arieh Schneier <15041913+AriehSchneier@users.noreply.github.com>
### 3. Tags are no longer fetched by default on `Fetch` ✅ Merged
112
+
### 3. Understanding tag fetch defaults (no change between v5 and v6) ✅ Clarification
114
113
115
-
**What changed:**`git.FetchOptions` previously defaulted to fetching all
116
-
tags (`AllTags`). In v6 the default is **no tags**. This aligns go-git's
117
-
behaviour with the `git fetch` CLI, which only auto-follows tags
118
-
reachable from fetched commits when no explicit tag refspec is given.
114
+
**What is the default behavior:** Tag fetching defaults have **not changed** between v5 and v6. Both versions use:
115
+
-`CloneOptions.Tags` defaults to `AllTags` (fetch all tags)
116
+
-`FetchOptions.Tags` defaults to `TagFollowing` (fetch tags reachable from fetched commits)
119
117
120
-
**Why:**When comparing actual `git fetch`behaviour with the test
121
-
expectations in go-git, it became clear that the tests expected all tags to
122
-
be pulled without the user explicitly requesting them.
118
+
**What `TagFollowing` means:**`TagFollowing` fetches tags that point to commits being fetched (matching `git fetch`behavior without explicit tag refspecs). This is different from:
119
+
-`AllTags` — fetch all tags from the remote (like `git fetch --tags`)
120
+
-`NoTags` — fetch no tags at all (like `git fetch --no-tags`)
123
121
124
-
**Impact:** Code that relied on tags being silently included in every
125
-
`Fetch` call will no longer receive them.
122
+
**Why this section exists:** A test fix in PR #1459 corrected a test that incorrectly expected `AllTags` behavior without setting it. This was not a behavior change—just a test correction.
126
123
127
-
**How to migrate:** If you need all remote tags, set `Tags: git.AllTags`
128
-
explicitly:
124
+
**Impact:** None. If you were relying on default behavior in v5, it works identically in v6.
125
+
126
+
**If you need all tags with `Fetch`:** Explicitly set `Tags: git.AllTags`:
129
127
130
128
```go
131
-
// v5 — tags were returned by default
129
+
//Both v5 and v6 — default behavior (TagFollowing)
0 commit comments