summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Frysinger <vapier@google.com>2020-02-25 15:09:01 -0500
committerMike Frysinger <vapier@google.com>2020-02-25 23:31:47 +0000
commit5f11eac1478fb4797766ca4f5225a7f60d9cb993 (patch)
treee3707343a6314343dc711740f095922c599a1faf
parentb0fbc7fb58af8ee1875993daad481b87bf8c2f94 (diff)
downloadgit-repo-5f11eac1478fb4797766ca4f5225a7f60d9cb993.tar.gz
launcher/version: include OS/CPU info in output
We often ask users what OS/version they're running when debugging. Include that in the version output to simplify the process. Change-Id: Ie480b6d1c874e6f4c6f4996a03795077b844f858 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/256732 Reviewed-by: David Pursehouse <dpursehouse@collab.net> Tested-by: Mike Frysinger <vapier@google.com>
-rwxr-xr-xrepo4
-rw-r--r--subcmds/version.py7
2 files changed, 11 insertions, 0 deletions
diff --git a/repo b/repo
index 8b05def3..0e9dd033 100755
--- a/repo
+++ b/repo
@@ -993,6 +993,10 @@ def _Version():
993 print(' (from %s)' % (__file__,)) 993 print(' (from %s)' % (__file__,))
994 print('git %s' % (ParseGitVersion().full,)) 994 print('git %s' % (ParseGitVersion().full,))
995 print('Python %s' % sys.version) 995 print('Python %s' % sys.version)
996 uname = platform.uname()
997 print('OS %s %s (%s)' % (uname.system, uname.release, uname.version))
998 print('CPU %s (%s)' %
999 (uname.machine, uname.processor if uname.processor else 'unknown'))
996 sys.exit(0) 1000 sys.exit(0)
997 1001
998 1002
diff --git a/subcmds/version.py b/subcmds/version.py
index 92316549..91dbe68f 100644
--- a/subcmds/version.py
+++ b/subcmds/version.py
@@ -15,7 +15,10 @@
15# limitations under the License. 15# limitations under the License.
16 16
17from __future__ import print_function 17from __future__ import print_function
18
19import platform
18import sys 20import sys
21
19from command import Command, MirrorSafeCommand 22from command import Command, MirrorSafeCommand
20from git_command import git, RepoSourceVersion, user_agent 23from git_command import git, RepoSourceVersion, user_agent
21from git_refs import HEAD 24from git_refs import HEAD
@@ -52,3 +55,7 @@ class Version(Command, MirrorSafeCommand):
52 print('git %s' % git.version_tuple().full) 55 print('git %s' % git.version_tuple().full)
53 print('git User-Agent %s' % user_agent.git) 56 print('git User-Agent %s' % user_agent.git)
54 print('Python %s' % sys.version) 57 print('Python %s' % sys.version)
58 uname = platform.uname()
59 print('OS %s %s (%s)' % (uname.system, uname.release, uname.version))
60 print('CPU %s (%s)' %
61 (uname.machine, uname.processor if uname.processor else 'unknown'))