Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1741)

Unified Diff: scm.py

Issue 18173003: Replace --no-pager with GIT_PAGER=cat (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Code review comments addressed Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « git_cl.py ('k') | tests/git_cl_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scm.py
diff --git a/scm.py b/scm.py
index 8810c2aa2603535eb9937e080c015393acb92ae2..835e0ed5e5d7788314d0688999889a3eab25c18f 100644
--- a/scm.py
+++ b/scm.py
@@ -98,9 +98,12 @@ class GIT(object):
@staticmethod
def Capture(args, cwd, **kwargs):
+ env = os.environ.copy()
+ # 'cat' is a magical git string that disables pagers on all platforms.
+ env['GIT_PAGER'] = 'cat'
return subprocess2.check_output(
- ['git', '--no-pager'] + args,
- cwd=cwd, stderr=subprocess2.PIPE, **kwargs).strip()
+ ['git'] + args,
+ cwd=cwd, stderr=subprocess2.PIPE, env=env, **kwargs).strip()
@staticmethod
def CaptureStatus(files, cwd, upstream_branch):
« no previous file with comments | « git_cl.py ('k') | tests/git_cl_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698