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
{{ message }}
This repository has been archived by the owner on Oct 25, 2024. It is now read-only.
In your homework, you've seen that even for just 24 commits (and there can be many more), you need to type quite a few, repetitive git bisect commands to find the commit you're looking for.
It's therefore something that is useful to automate. This section in the notes may be useful. Given the same situation as in this week's homework:
Write some code to solve Charlene's problem using git bisectautomatically.
Hint: To do this, you can use subprocess to run a command. For example:
subprocess.run(["ls", "-lh"])
will execute the ls command with the -lh arguments.
If you're on Windows, ideally use Git Bash (If you're on the Windows Command Prompt cmd, you need to pass cmd-compatible commands to subprocess, e.g. dir instead of ls). On Windows, you might also need to pass shell=True as an additional argument.
subprocess.run(["ls", "-lh"], shell=True)
Use assert or a similar function (e.g., np.testing.assert_array_equal) to make the program fail, and so distinguish between "good" and "bad" commits.
Do you get the same result (commit hash and date) as you did in your homework?
The text was updated successfully, but these errors were encountered:
In your homework, you've seen that even for just 24 commits (and there can be many more), you need to type quite a few, repetitive
git bisect
commands to find the commit you're looking for.It's therefore something that is useful to automate. This section in the notes may be useful. Given the same situation as in this week's homework:
Write some code to solve Charlene's problem using
git bisect
automatically.Hint: To do this, you can use
subprocess
to run a command. For example:will execute the
ls
command with the-lh
arguments.If you're on Windows, ideally use Git Bash (If you're on the Windows Command Prompt
cmd
, you need to passcmd
-compatible commands to subprocess, e.g.dir
instead ofls
). On Windows, you might also need to passshell=True
as an additional argument.Use
assert
or a similar function (e.g.,np.testing.assert_array_equal
) to make the program fail, and so distinguish between "good" and "bad" commits.Do you get the same result (commit hash and date) as you did in your homework?
The text was updated successfully, but these errors were encountered: