Commit 0f30233
bisect--helper:
Reimplement the `bisect_write` shell function in C and add a
`bisect-write` subcommand to `git bisect--helper` to call it from
git-bisect.sh
Using `--bisect-write` subcommand is a temporary measure to port shell
function in C so as to use the existing test suite. As more functions
are ported, this subcommand will be retired but its implementation will
be called by some other methods.
Note: bisect_write() uses two variables namely TERM_GOOD and TERM_BAD
from the global shell script thus we need to pass it to the subcommand
using the arguments. We then store them in a struct bisect_terms and
pass the memory address around functions.
Add a log_commit() helper function to write the contents of the commit message
header to a file which will be re-used in future parts of the code as
well.
Also introduce a function free_terms() to free the memory of `struct
bisect_terms` and set_terms() to set the values of members in `struct
bisect_terms`.
Helped-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
Mentored-by: Lars Schneider <larsxschneider@gmail.com>
Mentored-by: Christian Couder <chriscool@tuxfamily.org>
Mentored-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Pranit Bauva <pranit.bauva@gmail.com>
Signed-off-by: Tanushree Tumane <tanushreetumane@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>bisect_write shell function in C1 parent 5e82c3d commit 0f30233
2 files changed
+106
-24
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| 22 | + | |
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
24 | 46 | | |
25 | 47 | | |
26 | 48 | | |
| |||
148 | 170 | | |
149 | 171 | | |
150 | 172 | | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
151 | 237 | | |
152 | 238 | | |
153 | 239 | | |
154 | 240 | | |
155 | 241 | | |
156 | 242 | | |
157 | 243 | | |
158 | | - | |
| 244 | + | |
| 245 | + | |
159 | 246 | | |
160 | | - | |
| 247 | + | |
161 | 248 | | |
162 | 249 | | |
163 | 250 | | |
| |||
169 | 256 | | |
170 | 257 | | |
171 | 258 | | |
| 259 | + | |
| 260 | + | |
172 | 261 | | |
173 | 262 | | |
| 263 | + | |
| 264 | + | |
174 | 265 | | |
175 | 266 | | |
| 267 | + | |
176 | 268 | | |
177 | 269 | | |
178 | 270 | | |
| |||
198 | 290 | | |
199 | 291 | | |
200 | 292 | | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
201 | 299 | | |
202 | 300 | | |
203 | 301 | | |
204 | | - | |
| 302 | + | |
| 303 | + | |
205 | 304 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
147 | | - | |
| 147 | + | |
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
| |||
220 | 220 | | |
221 | 221 | | |
222 | 222 | | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | 223 | | |
241 | 224 | | |
242 | 225 | | |
| |||
263 | 246 | | |
264 | 247 | | |
265 | 248 | | |
266 | | - | |
| 249 | + | |
267 | 250 | | |
268 | 251 | | |
269 | 252 | | |
| |||
276 | 259 | | |
277 | 260 | | |
278 | 261 | | |
279 | | - | |
| 262 | + | |
280 | 263 | | |
281 | 264 | | |
282 | 265 | | |
| |||
413 | 396 | | |
414 | 397 | | |
415 | 398 | | |
416 | | - | |
| 399 | + | |
417 | 400 | | |
418 | 401 | | |
419 | 402 | | |
| |||
0 commit comments