Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log Git tool commands when running in verbose mode #15514

Merged
merged 5 commits into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions conan/tools/scm/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def run(self, cmd):

:return: The console output of the command.
"""
self._conanfile.output.verbose(f"Running git {cmd}")
AbrilRBS marked this conversation as resolved.
Show resolved Hide resolved
with chdir(self._conanfile, self.folder):
# We tried to use self.conanfile.run(), but it didn't work:
# - when using win_bash, crashing because access to .settings (forbidden in source())
Expand Down
3 changes: 2 additions & 1 deletion conans/test/functional/tools/scm/test_git.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,8 @@ def test_clone_checkout(self):

c = TestClient()
c.save({"conanfile.py": self.conanfile.format(url=url, commit=commit)})
c.run("create .")
c.run("create . -v")
assert "pkg/0.1: Running git clone" in c.out
assert "pkg/0.1: MYCMAKE: mycmake" in c.out
assert "pkg/0.1: MYFILE: myheader!" in c.out

Expand Down