Skip to content

Commit e070d72

Browse files
committed
09_git.ipynb: Fix error making CI to fail
The notebook didn't ensure that the `repos/` subdirectory existed by creating it before trying to store git.git repository in it. This made other commands to fail non-fatally (because they shell out), and the error message occured much later in the notebook, when trying to draw histogram of 'level' of nodes in the commit graph. There was no problem in local installation, because 'repos/' directory existed there.
1 parent 4901068 commit e070d72

File tree

1 file changed

+43
-2
lines changed

1 file changed

+43
-2
lines changed

09_git.ipynb

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,32 @@
139139
"- sparse: 14.9s - 19.4s"
140140
]
141141
},
142+
{
143+
"cell_type": "markdown",
144+
"metadata": {},
145+
"source": [
146+
"Prepare the directory to store repositories (note: `mkdir -d <directory>` should show no error if `<directory>` exists. \n",
147+
"Clone example repository (for exploration)."
148+
]
149+
},
150+
{
151+
"cell_type": "code",
152+
"execution_count": null,
153+
"metadata": {},
154+
"outputs": [
155+
{
156+
"name": "stderr",
157+
"output_type": "stream",
158+
"text": [
159+
"A subdirectory or file repos already exists.\n",
160+
"Error occurred while processing: repos.\n"
161+
]
162+
}
163+
],
164+
"source": [
165+
"!mkdir -p repos"
166+
]
167+
},
142168
{
143169
"cell_type": "code",
144170
"execution_count": null,
@@ -157,13 +183,28 @@
157183
"!git -C repos clone --mirror --filter=tree:0 --quiet https://github.com/git/git.git"
158184
]
159185
},
186+
{
187+
"cell_type": "markdown",
188+
"metadata": {},
189+
"source": [
190+
"Extract the history of the project"
191+
]
192+
},
160193
{
161194
"cell_type": "code",
162195
"execution_count": null,
163196
"metadata": {},
164-
"outputs": [],
197+
"outputs": [
198+
{
199+
"name": "stderr",
200+
"output_type": "stream",
201+
"text": [
202+
"A subdirectory or file datasets already exists.\n"
203+
]
204+
}
205+
],
165206
"source": [
166-
"!mkdir datasets"
207+
"!mkdir -p datasets"
167208
]
168209
},
169210
{

0 commit comments

Comments
 (0)