bash-it icon indicating copy to clipboard operation
bash-it copied to clipboard

aliases: Add new git-omz alias file

Open NoahGorny opened this issue 4 years ago • 19 comments
trafficstars

Description

Adds git-zsh alias file, with aliases copied from ohmyzsh. Currently there is no simple way of updating the aliases easily, and maybe we need to think about it.

Motivation and Context

Prompted by #1191, this is a re-iteration of #1201.

How Has This Been Tested?

Locally

Types of changes

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [x] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • [x] My code follows the code style of this project.
  • [ ] If my change requires a change to the documentation, I have updated the documentation accordingly.
  • [x] I have read the CONTRIBUTING document.
  • [x] If I have added a new file, I also added it to clean_files.txt and formatted it using lint_clean_files.sh.
  • [ ] I have added tests to cover my changes, and all the new and existing tests pass.

NoahGorny avatar Feb 06 '21 20:02 NoahGorny

Anyone else torn on whether we should use zsh-<whatever> vs <whatever>-zsh?

cornfeedhobo avatar Feb 06 '21 20:02 cornfeedhobo

Anyone else torn on whether we should use zsh-<whatever> vs <whatever>-zsh?

I went with git-zsh as I wanted to keep it close to the git alias, it makes more sense this way IMO

NoahGorny avatar Feb 06 '21 21:02 NoahGorny

Hey @bittner, wanna take a look?

NoahGorny avatar Feb 12 '21 10:02 NoahGorny

How will we keep this aligned with the Oh My Zsh project implementation?

In PR #1201 I tried to document a scripted approach. Would it make sense to do something similar here?

bittner avatar Feb 13 '21 13:02 bittner

How will we keep this aligned with the Oh My Zsh project implementation?

In PR #1201 I tried to document a scripted approach. Would it make sense to do something similar here?

This is indeed a problem, as the plugin will not work right out of the box.. Simply seding the file will still not work, as the aliases sometimes use the $(git_current_branch) variable. We might vendor it, and add a file in init.d vendor directory which explains how to update, and also defines the needed functions. It will be maintained by us, and when we update, we will change the file if necessary.

The workflow might be git-vendor + removing uneeded file + seding the wanted file + adding git-zsh loader that defines the needed functions and load the wanted file

NoahGorny avatar Feb 13 '21 14:02 NoahGorny

How many approvals does a PR need? :zany_face:

bittner avatar Feb 13 '21 14:02 bittner

How may approvals does a PR need? 🤪

haha, I still need to add some kind of script that updates this completion.. so its not ready yet. thanks for the CR though @bittner

NoahGorny avatar Feb 24 '21 17:02 NoahGorny

I am also okay with vendoring it as it is right now- and update it once in a while. what do you think @cornfeedhobo @bittner ?

NoahGorny avatar Aug 03 '21 20:08 NoahGorny

May I suggest that the new alias file be named git-omz? It's providing aliases from Oh My Zsh, not from Zsh itself. Just a nitpick... 😆

gaelicWizard avatar Aug 13 '21 01:08 gaelicWizard

May I suggest that the new alias file be named git-omz? It's providing aliases from Oh My Zsh, not from Zsh itself. Just a nitpick...

Nice idea- done!

NoahGorny avatar Aug 14 '21 08:08 NoahGorny

Howdy folks! I have added ohmyzsh as a vendored library using git-vendor with @buhl changes. this will hopefully be easier to maintain, although I still changed some code from the plugin so it will be loaded successfully let me know what you think @cornfeedhobo @bittner @gaelicWizard

NoahGorny avatar Sep 17 '21 12:09 NoahGorny

@NoahGorny I like it. The only question I have remaining is if you are open to the idea of applying patches to vendored libs and what that should look like. I still need to submit a patch to deal with pre-exec's clobbering of ignoreboth and ignorespace, and in the case of this PR, I'd rather not pollute the global namespace with the vaguely named is-at-least function.

cornfeedhobo avatar Sep 19 '21 17:09 cornfeedhobo

The only question I have remaining is if you are open to the idea of applying patches to vendored libs and what that should look like. I still need to submit a patch to deal with pre-exec's clobbering of ignoreboth and ignorespace, and in the case of this PR, I'd rather not pollute the global namespace with the vaguely named is-at-least function.

@cornfeedhobo, I've already submitted a PR upstream for preexec's history shenanigans, based on an existing PR that they had been ignoring. They did accept an unrelated PR for unbound parameters, but no traction on this one yet.

As for weird function names, we can handle that in our loader. I'll give it a go and post it here later tonight.

I'd like to suggest that it's quite valuable to avoid, whenever possible, carrying any patches over vendor'd libs. I like Homebrew's stance on this: only carry patches that are already approved or merged in an upstream dev branch. But, that said, it might not be entirely right for Bash It.

gaelicWizard avatar Sep 19 '21 19:09 gaelicWizard

@gaelicWizard I think you saw my open issue with preexec. They aren't going to budge on this one. We either maintain a fork in our github organization, and patch that way, or figure out a scheme for patching on PR and documenting the diff.

cornfeedhobo avatar Sep 19 '21 19:09 cornfeedhobo

@cornfeedhobo, I did a whole PR which keeps their desired behavior in place, but behaves properly when we change it. My idea was to let them have their way, and then we just set $HISTCONTROL back after we load them.

gaelicWizard avatar Sep 19 '21 20:09 gaelicWizard

@NoahGorny I like it. The only question I have remaining is if you are open to the idea of applying patches to vendored libs and what that should look like. I still need to submit a patch to deal with pre-exec's clobbering of ignoreboth and ignorespace, and in the case of this PR, I'd rather not pollute the global namespace with the vaguely named is-at-least function.

The problem with patches is that we need to apply them somewhere, probably during installation. We need to think about how we do this and how other places are doing it. Simply having patches around isn't going to cut it sadly. I also think that committing directly into the vendored file like I did isn't great, but it is the simplest solution currently

NoahGorny avatar Sep 20 '21 11:09 NoahGorny

Hello all, Is there any news about merging these changes into master?

samtsevich avatar May 27 '23 13:05 samtsevich

@NoahGorny Would you have a minute to resolve the conflicts of the PR and merge it, finally?

That would be great! :100:

bittner avatar Sep 22 '23 15:09 bittner

Hello again :) I asked this question a year ago and still would like to see this implementation merged into master. Is there any chance of seeing this in the near future?

samtsevich avatar Mar 10 '24 00:03 samtsevich