summaryrefslogtreecommitdiffstats
path: root/main.py
diff options
context:
space:
mode:
authorRaman Tenneti <rtenneti@google.com>2021-03-16 14:24:14 -0700
committerRaman Tenneti <rtenneti@google.com>2021-03-18 14:58:24 +0000
commita5b40a28450c965bb4b77656820fdd0a78768fe4 (patch)
treeb7ecf5bad6ea40c131f4736065ff748ab995ef86 /main.py
parent511a0e54f5801a3f36c00fac478a596d83867d10 (diff)
downloadgit-repo-a5b40a28450c965bb4b77656820fdd0a78768fe4.tar.gz
repo: Add a new "command" event type to git trace2 logging in repo.
Add a new "event": "command", which is emitted at when all command arguments have been processed. Additional fields: "name": Name of the primary command (ex: repo, git) "subcommands"': List of the sub-commands once command-line arguments are processed Examples: Command: repo --version Event: {"event": "command", <common fields>, "name": "repo", "subcommands": ["version"] } Bug: [google internal] b/178507266 Testing: - Unit tests - Verified repo git trace2 logs had expected data Change-Id: I825bd0ecedee45135382461a4ba10f987f09aef3 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/300343 Reviewed-by: Ian Kasprzak <iankaz@google.com> Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: Raman Tenneti <rtenneti@google.com>
Diffstat (limited to 'main.py')
-rwxr-xr-xmain.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/main.py b/main.py
index ba5d9d20..9abda6a9 100755
--- a/main.py
+++ b/main.py
@@ -254,6 +254,7 @@ class _Repo(object):
254 cmd_event = cmd.event_log.Add(name, event_log.TASK_COMMAND, start) 254 cmd_event = cmd.event_log.Add(name, event_log.TASK_COMMAND, start)
255 cmd.event_log.SetParent(cmd_event) 255 cmd.event_log.SetParent(cmd_event)
256 git_trace2_event_log.StartEvent() 256 git_trace2_event_log.StartEvent()
257 git_trace2_event_log.CommandEvent(name='repo', subcommands=[name])
257 258
258 try: 259 try:
259 cmd.ValidateOptions(copts, cargs) 260 cmd.ValidateOptions(copts, cargs)