Skip to content

Discussion: My work refactoring bash-It and possible integration paths #1678

Closed

Description

@ahmadassaf

I am a huge fan of bash-it, but the more I used it, the more I ran into some issues. Thats when I started to dig into the codebase, open PRs and contribute to the codebase. It is however, after digging deeper into some areas that I found myself moving lots of parts and restructuring big chunks the code. Moreover, I found various inconsistencies when it came to code style and adherence to bash best practices.

gaudi-bash is my fork with lots of opinionated changes in the code to suit my OCD-like nature. I am by no means a bash expert but I tried my best to conform to the best practices in here.

I also found lots of unused and redundant code, a huge part of that was to ensure backward compatibility with the older versions of bash-it. Sometimes, it is better to start fresh and put the past behind us!

The main changes in this repo are:

  • Split the core engine from the components (plugins, aliases, completions and themes to be done soon)
  • Split the code into smaller set of files e.g., components, helpers, utils, etc.
  • Ensure consistent way of writing bash code (function definitions, comments, etc.)
  • Following as much as possible bash best practices
  • Make sure to comply with shellcheck as much as possible
  • Ensure high coverage unit tests for all core functions and split test functions as well into small units
  • Merged some of the work from bash-it issues and open PRs that made sense to me
  • Adding more functions like bash-it backup and bash-it restore

Again, I am by no means a bash expert but tried my best to work something that made sense to me, so I hope some of these decisions make sense to you as well :)

Activity

  1. NoahGorny commented on Oct 15, 2020

    @NoahGorny
    Member

    As I said in #1664 (comment), I think the way forward for merging this into the mainline is by creating small PRs and make this as many incremental changes as we can

  2. ahmadassaf commented on Oct 15, 2020

    @ahmadassaf
    ContributorAuthor

    @NoahGornyI agree with the approach but I am wondering what changes/things you would like to see moving over?

  3. nwinkler commented on Oct 16, 2020

    @nwinkler
    Member

    Well, I guess we need to start at the lowest level... Can you walk us through the first item on your list (split core engine from components)? What does that entail?

  4. NoahGorny commented on Dec 6, 2020

    @NoahGorny
    Member

    gentle ping @ahmadassaf

  5. gaelicWizard commented on Aug 22, 2021

    @gaelicWizard
    Contributor

    @ahmadassaf, since you uploaded a new repository rather than forking on GitHub, it's kind of hard to compare your changes without specifically spending time to configure a local git repo for this purpose. That makes it harder for anyone who isn't already invested specifically in your fork to work with it. I can post instructions for re-creating your GitHub repo as a fork of this one and then I'll be happy to help bring incremental improvements upstream. Are you still interested in contributing upstream?

  6. NoahGorny commented on Sep 10, 2021

    @NoahGorny
    Member

    I am reopening this as this is an important issue!

  7. gaelicWizard commented on Sep 10, 2021

    @gaelicWizard
    Contributor

    I think the no-response bot needs some tweaking. For the moment, maybe remove the "needs response" label?

  8. deleted a comment from no-response on Sep 10, 2021
  9. deleted a comment from no-response on Sep 10, 2021
  10. gaelicWizard commented on Sep 10, 2021

    @gaelicWizard
    Contributor

    Looking at his repo, it seems like it's been untouched since he submitted this issue.

  11. ahmadassaf commented on Sep 16, 2021

    @ahmadassaf
    ContributorAuthor

    hello all! sorry for being absent! yes I am definitely keen to contribute to the upstream. I think the repo is in a pretty stable version and I have been using my fork since then.

    Please let me know how to move forward and am keen to kick this off again!

  12. gaelicWizard commented on Sep 16, 2021

    @gaelicWizard
    Contributor

    @ahmadassaf, since you uploaded a new repository rather than forking on GitHub, it's kind of hard to compare your changes without specifically spending time to configure a local git repo for this purpose. That makes it harder for anyone who isn't already invested specifically in your fork to work with it. I can post instructions for re-creating your GitHub repo as a fork of this one and then I'll be happy to help bring incremental improvements upstream. Are you still interested in contributing upstream?

    @ahmadassaf, the most helpful thing from my point of view would be to make your repo be a fork of the upstream repo. Would you be open to this if I post instructions?

    Short version: delete the repo from GitHub.com, fork the main repo on GitHub.com, rename on GitHub.com to match your preexisting repo (so the url is the same as it was), then force-push from your local repo. The result will be that the "new" forked repo will have exactly the code you have in there now, but GitHub will now treat it as a fork and make it really easy to compare and do pull requests and all that stuff.

    At that point, I'd be happy to help do the leg work of bringing in improvements piecemeal. I've accidentally started doing a lot of improvements myself so I've already got some momentum going with the workflow.

    Note: I'm not a member of the project, just another contributor like yourself so if @NoahGorny or @davidpfarrell or another maintainer says something else please listen to them. 😃

  13. NoahGorny commented on Sep 16, 2021

    @NoahGorny
    Member

    The way we should merge your changes upstream should go by creating small PRs with specific commits that add specific functionality. This will require a fork, but after doing this chore and opening up PRs I will gladly take a look and try to merge them here!

  14. ahmadassaf commented on Sep 17, 2021

    @ahmadassaf
    ContributorAuthor

    alright lads! will be a festive weekend then! looking forward to it

  15. ahmadassaf commented on Sep 21, 2021

    @ahmadassaf
    ContributorAuthor

    update: I have made the fork and I am trying to wrap my head around what the hell did I do almost a year ago now! taking time but getting there

  16. ahmadassaf commented on Sep 21, 2021

    @ahmadassaf
    ContributorAuthor

    As a question before making a PR. Does it make sense to you guys to separate the main "core" of bash-it from the plugins, completions, themes, etc. @NoahGorny @gaelicWizard @nwinkler

    Example is in here whereas everything was moved into a components folder and will be fetched as submodules.

    If so, then happy to make that as PR 1

  17. NoahGorny commented on Sep 23, 2021

    @NoahGorny
    Member

    As a question before making a PR. Does it make sense to you guys to separate the main "core" of bash-it from the plugins, completions, themes, etc. @NoahGorny @gaelicWizard @nwinkler

    Example is in here whereas everything was moved into a components folder and will be fetched as submodules.

    If so, then happy to make that as PR 1

    I think that splitting part of the repo into a submodule will not be very helpful, as it will be harder to maintain. I personally dislike submodules anyway.

    I think we can incorporate your changes without actually splitting part of the repo into a submodule.

    Let me know what you think @ahmadassaf 😄

  18. buhl commented on Nov 29, 2021

    @buhl
    Contributor

    I too have had the urge to do a little spring cleaning 😸
    I second the notion of splitting this into little manageable PR's.
    I hope to soon have the time to go through your suggested changes @ahmadassaf

  19. locked and limited conversation to collaborators on Dec 5, 2022
  20. converted this issue into a discussion #2178 on Dec 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions