Code Monkey home page Code Monkey logo

Comments (3)

roeme avatar roeme commented on July 19, 2024

The groundwork's been done. The current design for that functionality is as follows:

  1. Aliases and completions are noted in $_git_cmd_cfg.
  2. Completion styles may differ, currently shgit knows only stdcmpl.
  3. In case of stdcmpl, shgit looks in the completions folder for a completion file with the corresponding command name.

Also, it's all bog-standard bash completion. Granted, that has a bit of a learning curve, but comes naturally once one gets the hang of it.

I'm gradually adding completions, PR's are welcome as well.

As for porting, one can extract a lot of the completions from git-sh's git-completion.bash.
Caveats for this:

  1. Some completions are intertwined with various other functions
  2. Some completions trigger a lot of I/O and repo-accesses, slowing everything down

My philosophy for adding completions is make to as useful as possible for the user; some commands have tons and tons of flags. Hence, I don't require completions to be exhaustive.

from shgit.

krlmlr avatar krlmlr commented on July 19, 2024

Autocompletion for branch names and remote names would be most important for me, these should also work for the aliased commands. Having the most important flags available helps too. The way I understand it, I/O is triggered only when TAB is pressed?

How important is it to split the completions into separate files? Having everything in one script has its advantages -- installation is much simpler. Perhaps we can still develop in separate files but provide a "builder" script that composes everything into a single (version-controlled) file at development time?

from shgit.

roeme avatar roeme commented on July 19, 2024

Autocompletion for branch names and remote names would be most important for me, these should also work for the aliased commands. Having the most important flags available helps too. The way I understand it, I/O is triggered only when TAB is pressed?

Aliased commands are now being completed as well.

For non-standard commands, shgit cannot know to complete them further, this can only decided by the alias' author. I aim to add useful completions for the standard ones.

How important is it to split the completions into separate files? Having everything in one script has its advantages -- installation is much simpler.

Quite important, it makes maintaining the code much simpler, and much easier for users to customize. As for installing, I aim to follow the same route as popularized by homebrew; the installation will only be symlinked (so updating/downgrading will be simply done through git).

Perhaps we can still develop in separate files but provide a "builder" script that composes everything into a single (version-controlled) file at development time?

Sure, that could be done, bit esoteric, but I'm not opposed. Would need to handle that in a different issue though.

Branch & remote names will be added next.

from shgit.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.