about summary refs log tree commit diff
diff options
context:
space:
mode:
authorHudson Ayers <hudsonayers@google.com>2021-07-27 13:54:51 +0000
committerHudson Ayers <hudsonayers@google.com>2021-07-27 14:53:02 +0000
commit12597428658fc7b72244e8717d0ca6fc83fca11c (patch)
tree80f0931a3b261fa9c8cf92c9f3ce1fb433703c6a
parentfc24bcead1d401ae061538d011e4a319c4195b56 (diff)
downloadrust-12597428658fc7b72244e8717d0ca6fc83fca11c.tar.gz
rust-12597428658fc7b72244e8717d0ca6fc83fca11c.zip
bootstrap.py: remove unused `git log` option
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.
-rw-r--r--src/bootstrap/bootstrap.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py
index d2cf929aa26..f2e38a7eab6 100644
--- a/src/bootstrap/bootstrap.py
+++ b/src/bootstrap/bootstrap.py
@@ -473,7 +473,7 @@ class RustBuild(object):
             ]).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),