Skip to content

Commit

Permalink
bootstrap.py: remove unused git log option
Browse files Browse the repository at this point in the history
When determining which LLVM artifacts to download, bootstrap.py
calls: `git log --author=bors --format=%H -n1 -m --first-parent --
src/llvm-project src/bootstrap/download-ci-llvm-stamp src/version`.
However, the `-m` option has no effect, per the `git log` help:

> -m
> This option makes diff output for merge commits to be shown in the
> default format. -m will produce the output only if -p is given as
> well. The default format could be changed using log.diffMerges
> configuration parameter, which default value is separate.

Accordingly, this commit removes use of the -m option in favor of
`--no-patch`, to make clear that this command should never output
diff information, as the SHA-1 hash is the only desired output.
Tested using git 2.32, this does not change the
output of the command.

The motivation for this change is that some patched versions of git
change the behavior of the `-m` flag to imply `-p`, rather than to do
nothing unless `-p` is passed. These patched versions of git lead to
this script not working. Google's corp-provided git is one such example.
  • Loading branch information
hudson-ayers committed Jul 27, 2021
1 parent fc24bce commit 1259742
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/bootstrap/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ def download_toolchain(self, stage0=True, rustc_channel=None):
]).decode(sys.getdefaultencoding()).strip()
llvm_sha = subprocess.check_output([
"git", "log", "--author=bors", "--format=%H", "-n1",
"-m", "--first-parent",
"--no-patch", "--first-parent",
"--",
"{}/src/llvm-project".format(top_level),
"{}/src/bootstrap/download-ci-llvm-stamp".format(top_level),
Expand Down

0 comments on commit 1259742

Please sign in to comment.