From: "Ashley E Desimone" <ashley.e.desimone@intel.com>
To: "Desimone, Nathaniel L" <nathaniel.l.desimone@intel.com>,
"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: "Pandya, Puja" <puja.pandya@intel.com>,
"Bjorge, Erik C" <erik.c.bjorge@intel.com>,
"Agyeman, Prince" <prince.agyeman@intel.com>,
"Bret Barkelew" <Bret.Barkelew@microsoft.com>,
Philippe Mathieu-Daude <philmd@redhat.com>
Subject: Re: [edk2-staging/EdkRepo] [PATCH V2 0/3] EdkRepo: Command completion in bash/zsh
Date: Mon, 6 Apr 2020 18:32:46 +0000 [thread overview]
Message-ID: <DM6PR11MB362878E858C04717D80F9A8FB2C20@DM6PR11MB3628.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20200403234932.2497-1-nathaniel.l.desimone@intel.com>
For the series:
Reviewed-by: Ashley DeSimone <ashley.e.desimone@intel.com>
-----Original Message-----
From: Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>
Sent: Friday, April 3, 2020 4:49 PM
To: devel@edk2.groups.io
Cc: Desimone, Ashley E <ashley.e.desimone@intel.com>; Pandya, Puja <puja.pandya@intel.com>; Bjorge, Erik C <erik.c.bjorge@intel.com>; Agyeman, Prince <prince.agyeman@intel.com>; Bret Barkelew <Bret.Barkelew@microsoft.com>; Philippe Mathieu-Daude <philmd@redhat.com>
Subject: [edk2-staging/EdkRepo] [PATCH V2 0/3] EdkRepo: Command completion in bash/zsh
Changes since V1:
- Now uses the new combinations_in_manifest() function
introduced by Erik's patch series.
This patch series adds command completions (also referred to as [TAB] completions) to EdkRepo. It also adds the currently checked out branch combination to the command prompt. This is a significant quality of life improvement for EdkRepo's users.
The bash and zsh shells are supported. The reason why bash and zsh were choosen is based on their popularity in the UNIX world.
zsh is the default shell on macOS and most contemporary Linux distributions use bash as the default shell. Git for Windows also uses bash.
Performance was a strong consideration in the design of this feature. Since EdkRepo has become a fairly large amount of Python code with lots of dependencies, the "boot time" for the Python interperter to load and execute the EdkRepo entrypoint is approximately 1-2 seconds. A 2 second delay on TAB completion would not be a good user experience.
To mitigate this, instead of enumerating and instantiating all the command classes to generate the list of EdkRepo sub-commands every time the user presses the TAB key, this is done once and stored in a auto-generated shell script at installation time. This way, the shell has all the information needed for static completions without having to invoke the Python interperter at all.
There are cases where TAB completions need some dynamic data.
For example, completing the 3rd parameter after "edkrepo checkout " requires the shell to know the list of branch combinations, this requires parsing the manifest XML.
command_completion_edkrepo.py provides a means for the shell to get that type of data. A new command_completion_edkrepo.py script has been added for this purpose.
command_completion_edkrepo.py is callable by the shell when dynamic completion data is needed.
command_completion_edkrepo.py has been tuned to limit imports as much as possible so that it executes quickly.
command_completion_edkrepo.py is also used to retrieve the currently checked out branch combination so that it can be added to the prompt. For performance considerations, this operation is only done iff the present working directory was changed by the last command the shell executed.
Cc: Ashley DeSimone <ashley.e.desimone@intel.com>
Cc: Puja Pandya <puja.pandya@intel.com>
Cc: Erik Bjorge <erik.c.bjorge@intel.com>
Cc: Prince Agyeman <prince.agyeman@intel.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Philippe Mathieu-Daude <philmd@redhat.com>
Signed-off-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
Nate DeSimone (3):
EdkRepo: Generate command completion scripts
EdkRepo: Add command completion setup to install.py
EdkRepo: Add command completion setup to Windows installer
edkrepo/command_completion_edkrepo.py | 87 ++++++
edkrepo/edkrepo_cli.py | 61 +++-
.../EdkRepoInstaller/InstallWorker.cs | 212 +++++++++++--
.../EdkRepoInstaller/InstallerStrings.cs | 44 ++-
.../Vendor/win_edkrepo_prompt.sh | 60 ++++
edkrepo_installer/linux-scripts/install.py | 285 +++++++++++++++++-
setup.py | 8 +-
7 files changed, 730 insertions(+), 27 deletions(-) create mode 100644 edkrepo/command_completion_edkrepo.py
create mode 100644 edkrepo_installer/Vendor/win_edkrepo_prompt.sh
--
2.26.0.windows.1
prev parent reply other threads:[~2020-04-06 18:33 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-03 23:49 [edk2-staging/EdkRepo] [PATCH V2 0/3] EdkRepo: Command completion in bash/zsh Nate DeSimone
2020-04-03 23:49 ` [edk2-staging/EdkRepo] [PATCH V2 1/3] EdkRepo: Generate command completion scripts Nate DeSimone
2020-04-03 23:49 ` [edk2-staging/EdkRepo] [PATCH V2 2/3] EdkRepo: Add command completion setup to install.py Nate DeSimone
2020-04-03 23:49 ` [edk2-staging/EdkRepo] [PATCH V2 3/3] EdkRepo: Add command completion setup to Windows installer Nate DeSimone
2020-04-06 18:32 ` Ashley E Desimone [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DM6PR11MB362878E858C04717D80F9A8FB2C20@DM6PR11MB3628.namprd11.prod.outlook.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox