From 1328c35a4d0b47c7e8c00fe351f0e587481e28c2 Mon Sep 17 00:00:00 2001 From: Xin Li Date: Wed, 8 Sep 2021 00:25:30 -0700 Subject: [PATCH] superproject: Provide accurate feedback for user choice Currently the code would give a message that would appear like the user have enrolled the experiment regardless of the actual choice. For users who choose to not enroll in the experiment, we should give them instructions to override (enable) superproject once instead of how to disable it, which is what the code already behave. Bug: [google internal] b/199167992 Change-Id: Iba3314cb510aedf024375a26baa8bc1d5e2846cf Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/317382 Tested-by: Xin Li Reviewed-by: Raman Tenneti --- git_superproject.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/git_superproject.py b/git_superproject.py index 3b23d292..19b91259 100644 --- a/git_superproject.py +++ b/git_superproject.py @@ -369,9 +369,14 @@ def _UseSuperprojectFromConfiguration(): if user_expiration is not None and (user_expiration <= 0 or user_expiration >= time_now): # TODO(b/190688390) - Remove prompt when we are comfortable with the new # default value. - print(('You are currently enrolled in Git submodules experiment ' - '(go/android-submodules-quickstart). Use --no-use-superproject ' - 'to override.\n'), file=sys.stderr) + if user_value: + print(('You are currently enrolled in Git submodules experiment ' + '(go/android-submodules-quickstart). Use --no-use-superproject ' + 'to override.\n'), file=sys.stderr) + else: + print(('You are not currently enrolled in Git submodules experiment ' + '(go/android-submodules-quickstart). Use --use-superproject ' + 'to override.\n'), file=sys.stderr) return user_value # We don't have an unexpired choice, ask for one.