Skip to content

Commit 91d5e6a

Browse files
authored
Merge pull request #4070 from luarss/topic/fix-2213
[docs] add GitGuideAdapter for ORFS docs clarification
2 parents e670c24 + 246fbc7 commit 91d5e6a

3 files changed

Lines changed: 39 additions & 4 deletions

File tree

docs/conf.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
"docs/releases/PostAlpha2.1BranchMethodology.md",
7979
"main",
8080
"index.md",
81+
"contrib/GitGuideAdapter.md",
8182
]
8283

8384
# The name of the Pygments (syntax highlighting) style to use.
@@ -162,14 +163,22 @@ def setup(app):
162163
url = "https://raw.githubusercontent.com/The-OpenROAD-Project/OpenROAD/master/docs/index.md"
163164
get_file_from_url(url, "SupportedOS.md")
164165

165-
# edit OpenROAD to OpenROAD-flow-scripts for GitGuide
166+
# Adapt the downloaded GitGuide for ORFS: rename references and inject
167+
# ORFS-specific submodule forking instructions from GitGuideAdapter.md.
166168
with open("contrib/GitGuide.md", "r") as f:
167169
content = f.read()
170+
content = (
171+
content.replace(
172+
"user/Build.md", "../index.md#build-or-installing-orfs-dependencies"
173+
)
174+
.replace("OpenROAD", "OpenROAD-flow-scripts")
175+
.replace("The-OpenROAD-flow-scripts", "The-OpenROAD")
176+
)
177+
with open("contrib/GitGuideAdapter.md", "r") as f:
178+
adapter_content = f.read()
168179
content = content.replace(
169-
"user/Build.md", "../index.md#build-or-installing-orfs-dependencies"
180+
"## Creating a branch", adapter_content + "\n## Creating a branch"
170181
)
171-
content = content.replace("OpenROAD", "OpenROAD-flow-scripts")
172-
content = content.replace("The-OpenROAD-flow-scripts", "The-OpenROAD")
173182
with open("contrib/GitGuide.md", "w") as f:
174183
f.write(content)
175184

docs/contrib/GitGuide.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
# Git Quickstart
22

33
If you have reached this file on GitHub - please refer to this [link](https://openroad-flow-scripts.readthedocs.io/en/latest/contrib/GitGuide.html) for latest documentation.
4+
5+
For ORFS-specific forking instructions (including forking the OpenROAD submodule), see [GitGuideAdapter.md](./GitGuideAdapter.md).

docs/contrib/GitGuideAdapter.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
### Forking OpenROAD
2+
3+
OpenROAD-flow-scripts uses OpenROAD as a Git submodule at `tools/OpenROAD`. When you
4+
fork OpenROAD-flow-scripts, the submodule URL in `.gitmodules` still points to the
5+
upstream OpenROAD repository. If your contribution requires changes to OpenROAD, you
6+
must also fork it and update the submodule remote in your local clone.
7+
8+
1. Fork [OpenROAD](https://github.com/The-OpenROAD-Project/OpenROAD) on GitHub.
9+
10+
2. After cloning your OpenROAD-flow-scripts fork recursively, update the submodule
11+
remote to point to your OpenROAD fork:
12+
13+
```shell
14+
cd tools/OpenROAD
15+
git remote set-url origin https://github.com/your-user-name/OpenROAD.git
16+
git remote add upstream https://github.com/The-OpenROAD-Project/OpenROAD.git
17+
```
18+
19+
3. Verify the remotes are set correctly:
20+
21+
```shell
22+
git remote -v
23+
```
24+

0 commit comments

Comments
 (0)