mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 18:51:29 +00:00
[gclient] Fix an issue with gclient hanging.
gclient hangs when I try to update my infra checkout, running pstree reveals that we're waiting for less to complete, which it can't do because of how gclient invokes less. In the absence of a more robust mechanism for making git non-interactive, I vote we just set the pager to cat and the editor to false and call it a day. Change-Id: Icc66c0a91d45426bb5f65f2ffb325c4f6b6e532d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/7008969 Commit-Queue: Gregory Nisbet <gregorynisbet@google.com> Reviewed-by: Gavin Mak <gavinmak@google.com>
This commit is contained in:
16
gclient.py
16
gclient.py
@@ -4657,6 +4657,22 @@ def can_run_gclient_and_helpers():
|
|||||||
def main(argv):
|
def main(argv):
|
||||||
"""Doesn't parse the arguments here, just find the right subcommand to
|
"""Doesn't parse the arguments here, just find the right subcommand to
|
||||||
execute."""
|
execute."""
|
||||||
|
|
||||||
|
# gclient will sometimes hang when trying to `gclient sync` an infra checkout.
|
||||||
|
# Running pstree reveals what's happening:
|
||||||
|
#
|
||||||
|
# | |-tmux: server-+-bash-+-python3---git---less
|
||||||
|
# | | | `-vim---{vim}
|
||||||
|
# | | |-bash
|
||||||
|
# | | `-bash-+-pstree
|
||||||
|
# | | `-vim
|
||||||
|
#
|
||||||
|
# `less` in this case is the git pager. So, let's set the pager to something harmless.
|
||||||
|
# For good measure, let's also set the editor to false so that we don't even try to
|
||||||
|
# get the user to edit something.
|
||||||
|
os.environ["GIT_PAGER"] = "cat"
|
||||||
|
os.environ["GIT_EDITOR"] = "false"
|
||||||
|
|
||||||
if not can_run_gclient_and_helpers():
|
if not can_run_gclient_and_helpers():
|
||||||
return 2
|
return 2
|
||||||
disable_buffering()
|
disable_buffering()
|
||||||
|
|||||||
Reference in New Issue
Block a user