Skip to content

Commit a27ad42

Browse files
authored
Merge pull request #1900 from dscho/fix-opening-broken-link-issue
Fix broken link in v2.47.0
2 parents 3784570 + 4593a42 commit a27ad42

File tree

7 files changed

+213
-9
lines changed

7 files changed

+213
-9
lines changed

.github/actions/deploy-to-github-pages/action.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,19 @@ runs:
106106
-H "Content-Type: application/json" \
107107
-d '{ "purge_everything": true }'
108108
109-
- name: construct `--remap` option for lychee
109+
- name: construct `--remap` options for lychee
110110
id: remap
111111
shell: bash
112112
run: |
113113
base_url='${{ steps.pages.outputs.base_url }}'
114114
echo "result=$(echo "$base_url" |
115115
sed 's|^\(.*\)\(/git-scm\.com\)$|(\1)?\2(.*)|') file://$PWD/public\$2" \
116116
>>$GITHUB_OUTPUT
117+
# When running in forks, do detect when links try to break out of the
118+
# `/git-scm.com/` subdirectory
119+
echo "remap-dotdot=$(echo "$base_url" |
120+
sed 's|^\(.*\)\(/git-scm\.com\)$|--remap '\''(\1.*) file://../$1'\''|')" \
121+
>>$GITHUB_OUTPUT
117122
118123
- name: check for broken links
119124
id: lychee
@@ -125,6 +130,7 @@ runs:
125130
--fallback-extensions html
126131
--base '${{ steps.pages.outputs.base_url }}'
127132
--remap '${{ steps.remap.outputs.result }}'
133+
${{ steps.remap.outputs.remap-dotdot }}
128134
--exclude file:///path/to/repo.git/
129135
--exclude file:///caminho/para/o/reposit%C3%B3rio.git/
130136
--exclude file:///ruta/a/repositorio.git/
@@ -150,8 +156,8 @@ runs:
150156
return s.replace(/^([^]{0,65000}\n)[^]*\n(.+)\n?$/, '$1\n[...]\n\n$2')
151157
})(await fs.promises.readFile('lychee.md', 'utf8'))
152158
159+
const req = { owner: context.repo.owner, repo: context.repo.repo }
153160
const issues = await (async () => {
154-
const req = { owner: context.repo.owner, repo: context.repo.repo }
155161
const q = `"Link+Checker+Report"+in:title+is:issue+label:linkchecker+is:open+repo:${req.owner}/${req.repo}`
156162
try {
157163
return await github.rest.search.issuesAndPullRequests({ ...req, q, sort: 'created', per_page: 1 })
Lines changed: 190 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,190 @@
1+
Platform Support Policy
2+
=======================
3+
4+
Git has a history of providing broad "support" for exotic platforms and older
5+
platforms, without an explicit commitment. Stakeholders of these platforms may
6+
want a more predictable support commitment. This is only possible when platform
7+
stakeholders supply Git developers with adequate tooling, so we can test for
8+
compatibility or develop workarounds for platform-specific quirks on our own.
9+
Various levels of platform-specific tooling will allow us to make more solid
10+
commitments around Git's compatibility with that platform.
11+
12+
Note that this document is about maintaining existing support for a platform
13+
that has generally worked in the past; for adding support to a platform which
14+
doesn't generally work with Git, the stakeholders for that platform are expected
15+
to do the bulk of that work themselves. We will consider such patches if they
16+
don't make life harder for other supported platforms or for Git contributors.
17+
Some contributors may volunteer to help with the initial or continued support,
18+
but that's not a given. Support work which is too intrusive or difficult for the
19+
project to maintain may still not be accepted.
20+
21+
Minimum Requirements
22+
--------------------
23+
24+
The rest of this doc describes best practices for platforms to make themselves
25+
easy to support. However, before considering support at all, platforms need to
26+
meet the following minimum requirements:
27+
28+
* Has C99 or C11
29+
30+
* Uses versions of dependencies which are generally accepted as stable and
31+
supportable, e.g., in line with the version used by other long-term-support
32+
distributions
33+
34+
* Has active security support (taking security releases of dependencies, etc)
35+
36+
These requirements are a starting point, and not sufficient on their own for the
37+
Git community to be enthusiastic about supporting your platform. Maintainers of
38+
platforms which do meet these requirements can follow the steps below to make it
39+
more likely that Git updates will respect the platform's needs.
40+
41+
Compatible by next release
42+
--------------------------
43+
44+
To increase probability that compatibility issues introduced in a release
45+
will be fixed in a later release:
46+
47+
* You should send a bug report as soon as you notice the breakage on your
48+
platform. The sooner you notice, the better; watching `seen` means you can
49+
notice problems before they are considered "done with review"; whereas
50+
watching `master` means the stable branch could break for your platform, but
51+
you have a decent chance of avoiding a tagged release breaking you. See "The
52+
Policy" in link:/docs/../howto/maintain-git["How to maintain Git"] for an
53+
overview of which branches are used in the Git project, and how.
54+
55+
* The bug report should include information about what platform you are using.
56+
57+
* You should also use linkgit:git-bisect[1] and determine which commit
58+
introduced the breakage.
59+
60+
* Please include any information you have about the nature of the breakage: is
61+
it a memory alignment issue? Is an underlying library missing or broken for
62+
your platform? Is there some quirk about your platform which means typical
63+
practices (like malloc) behave strangely?
64+
65+
* If possible, build Git from the exact same source both for your platform and
66+
for a mainstream platform, to see if the problem you noticed appears only
67+
on your platform. If the problem appears in both, then it's not a
68+
compatibility issue, but we of course appreciate hearing about it in a bug
69+
report anyway, to benefit users of every platform. If it appears only on your
70+
platform, mention clearly that it is a compatibility issue in your report.
71+
72+
* Once we begin to fix the issue, please work closely with the contributor
73+
working on it to test the proposed fix against your platform.
74+
75+
Example: NonStop
76+
https://lore.kernel.org/git/[email protected]/[reports
77+
problems] when they're noticed.
78+
79+
Compatible on `master` and releases
80+
-----------------------------------
81+
82+
To make sure all stable builds and regular releases work for your platform the
83+
first time, help us avoid breaking `master` for your platform:
84+
85+
* You should run regular tests against the `next` branch and
86+
publish breakage reports to the mailing list immediately when they happen.
87+
88+
** Ideally, these tests should run daily. They must run more often than
89+
weekly, as topics generally spend at least 7 days in `next` before graduating
90+
to `master`, and it takes time to put the brakes on a patch once it lands in
91+
`next`.
92+
93+
** You may want to ask to join the mailto:[email protected][security
94+
mailing list] in order to run tests against the fixes proposed there, too.
95+
96+
* It may make sense to automate these; if you do, make sure they are not noisy
97+
(you don't need to send a report when everything works, only when something
98+
breaks; you don't need to send repeated reports for the same breakage night
99+
after night).
100+
101+
* Breakage reports should be actionable - include clear error messages that can
102+
help developers who may not have access to test directly on your platform.
103+
104+
* You should use git-bisect and determine which commit introduced the breakage;
105+
if you can't do this with automation, you should do this yourself manually as
106+
soon as you notice a breakage report was sent.
107+
108+
* You should either:
109+
110+
** Provide on-demand access to your platform to a trusted developer working to
111+
fix the issue, so they can test their fix, OR
112+
113+
** Work closely with the developer fixing the issue; the turnaround to check
114+
that their proposed fix works for your platform should be fast enough that it
115+
doesn't hinder the developer working on that fix. Slow testing turnarounds
116+
may cause the fix to miss the next release, or the developer may lose
117+
interest in working on the fix at all.
118+
119+
Example:
120+
https://lore.kernel.org/git/CAHd-oW6X4cwD_yLNFONPnXXUAFPxgDoccv2SOdpeLrqmHCJB4Q@mail.gmail.com/[AIX]
121+
provides a build farm and runs tests against release candidates.
122+
123+
Compatible on `next`
124+
--------------------
125+
126+
To avoid reactive debugging and fixing when changes hit a release or stable, you
127+
can aim to ensure `next` always works for your platform. (See "The Policy" in
128+
link:/docs/../howto/maintain-git["How to maintain Git"] for an overview of how
129+
`next` is used in the Git project.) To do that:
130+
131+
* You should add a runner for your platform to the GitHub Actions or GitLab CI
132+
suite. This suite is run when any Git developer proposes a new patch, and
133+
having a runner for your platform/configuration means every developer will
134+
know if they break you, immediately.
135+
136+
** If adding it to an existing CI suite is infeasible (due to architecture
137+
constraints or for performance reasons), any other method which runs as
138+
automatically and quickly as possible works, too. For example, a service
139+
which snoops on the mailing list and automatically runs tests on new [PATCH]
140+
emails, replying to the author with the results, would also be within the
141+
spirit of this requirement.
142+
143+
* If you rely on Git avoiding a specific pattern that doesn't work well with
144+
your platform (like a certain malloc pattern), raise it on the mailing list.
145+
We'll work case-by-case to look for a solution that doesn't unnecessarily
146+
constrain other platforms to keep compatibility with yours.
147+
148+
* If you rely on some configuration or behavior, add a test for it. Untested
149+
behavior is subject to breakage at any time.
150+
151+
** Clearly label these tests as necessary for platform compatibility. Add them
152+
to an isolated compatibility-related test suite, like a new t* file or unit
153+
test suite, so that they're easy to remove when compatibility is no longer
154+
required. If the specific compatibility need is gated behind an issue with
155+
another project, link to documentation of that issue (like a bug or email
156+
thread) to make it easier to tell when that compatibility need goes away.
157+
158+
** Include a comment with an expiration date for these tests no more than 1 year
159+
from now. You can update the expiration date if your platform still needs
160+
that assurance down the road, but we need to know you still care about that
161+
compatibility case and are working to make it unnecessary.
162+
163+
Example: We run our
164+
https://git.kernel.org/pub/scm/git/git.git/tree/.github/workflows/main.yml[CI
165+
suite] on Windows, Ubuntu, Mac, and others.
166+
167+
Getting help writing platform support patches
168+
---------------------------------------------
169+
170+
In general, when sending patches to fix platform support problems, follow
171+
these guidelines to make sure the patch is reviewed with the appropriate level
172+
of urgency:
173+
174+
* Clearly state in the commit message that you are fixing a platform breakage,
175+
and for which platform.
176+
177+
* Use the CI and test suite to ensure that the fix for your platform doesn't
178+
break other platforms.
179+
180+
* If possible, add a test ensuring this regression doesn't happen again. If
181+
it's not possible to add a test, explain why in the commit message.
182+
183+
Platform Maintainers
184+
--------------------
185+
186+
If you maintain a platform, or Git for that platform, and intend to work with
187+
the Git project to ensure compatibility, please send a patch to add yourself to
188+
this list.
189+
190+
NonStop: Randall S. Becker <[email protected]>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
### DO NOT EDIT! Generated by script/update-docs.rb
3+
4+
redirect_to: https://github.com/git/git/blob/HEAD/Documentation/howto/maintain-git.txt
5+
---

external/docs/content/docs/platform-support.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ <h2 id="_compatible_by_next_release"><a class="anchor" href="#_compatible_by_nex
8080
notice problems before they are considered "done with review"; whereas
8181
watching <code>master</code> means the stable branch could break for your platform, but
8282
you have a decent chance of avoiding a tagged release breaking you. See "The
83-
Policy" in <a href="../howto/maintain-git.txt">"How to maintain Git"</a> for an
83+
Policy" in <a href="{{< relurl "docs/howto/maintain-git" >}}">"How to maintain Git"</a> for an
8484
overview of which branches are used in the Git project, and how.</p>
8585
</li>
8686
<li>
@@ -192,7 +192,7 @@ <h2 id="_compatible_on_next"><a class="anchor" href="#_compatible_on_next"></a>C
192192
<div class="paragraph">
193193
<p>To avoid reactive debugging and fixing when changes hit a release or stable, you
194194
can aim to ensure <code>next</code> always works for your platform. (See "The Policy" in
195-
<a href="../howto/maintain-git.txt">"How to maintain Git"</a> for an overview of how
195+
<a href="{{< relurl "docs/howto/maintain-git" >}}">"How to maintain Git"</a> for an overview of how
196196
<code>next</code> is used in the Git project.) To do that:</p>
197197
</div>
198198
<div class="ulist">

external/docs/content/docs/platform-support/2.47.0.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ <h2 id="_compatible_by_next_release"><a class="anchor" href="#_compatible_by_nex
7979
notice problems before they are considered "done with review"; whereas
8080
watching <code>master</code> means the stable branch could break for your platform, but
8181
you have a decent chance of avoiding a tagged release breaking you. See "The
82-
Policy" in <a href="../howto/maintain-git.txt">"How to maintain Git"</a> for an
82+
Policy" in <a href="{{< relurl "docs/howto/maintain-git" >}}">"How to maintain Git"</a> for an
8383
overview of which branches are used in the Git project, and how.</p>
8484
</li>
8585
<li>
@@ -191,7 +191,7 @@ <h2 id="_compatible_on_next"><a class="anchor" href="#_compatible_on_next"></a>C
191191
<div class="paragraph">
192192
<p>To avoid reactive debugging and fixing when changes hit a release or stable, you
193193
can aim to ensure <code>next</code> always works for your platform. (See "The Policy" in
194-
<a href="../howto/maintain-git.txt">"How to maintain Git"</a> for an overview of how
194+
<a href="{{< relurl "docs/howto/maintain-git" >}}">"How to maintain Git"</a> for an overview of how
195195
<code>next</code> is used in the Git project.) To do that:</p>
196196
</div>
197197
<div class="ulist">

external/docs/data/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71365,7 +71365,7 @@ pages:
7136571365
removed: 0
7136671366
platform-support:
7136771367
version-map:
71368-
2.47.0: 16dd48c906456ee4beb3635b7795761fc483363d
71368+
2.47.0: 817d53c8da22db548200fb25ec14c9d0f51cfded
7136971369
latest-changes: 2.47.0
7137071370
page-versions:
7137171371
- name: 2.47.0

script/update-docs.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -400,14 +400,17 @@ def index_doc(filter_tags, doc_list, get_content)
400400
page_data = data["pages"][docname]
401401

402402
content = expand_content((get_content.call sha).force_encoding("UTF-8"), path, get_content_f, generated)
403+
# Handle `link:../howto/maintain-git.txt`, which should point to
404+
# a `.html` target instead
405+
content.gsub!(/link:\.\.\/howto\/maintain-git\.txt/, 'link:../howto/maintain-git.html')
403406
# Handle `gitlink:` mistakes (the last of which was fixed in
404407
# dbf47215e32b (rebase docs: fix "gitlink" typo, 2019-02-27))
405408
content.gsub!(/gitlink:/, "linkgit:")
406409
# Handle erroneous `link:api-trace2.txt`, see 4945f046c7f5 (api docs:
407410
# link to html version of api-trace2, 2022-09-16)
408411
content.gsub!(/link:api-trace2.txt/, 'link:api-trace2.html')
409-
# Handle `linkgit:git-config.txt` mistake, fixed in ad52148a7d0
410-
# (Documentation: fix broken linkgit to git-config, 2016-03-21)
412+
# Handle `linkgit:git-config.txt` mistake, fixed in ad52148a7d0
413+
# (Documentation: fix broken linkgit to git-config, 2016-03-21)
411414
content.gsub!(/linkgit:git-config.txt/, 'linkgit:git-config')
412415
content.gsub!(/link:(?:technical\/)?(\S*?)\.html(\#\S*?)?\[(.*?)\]/m, "link:/docs/\\1\\2[\\3]")
413416

0 commit comments

Comments
 (0)