Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add remotes of some git server instances #2493

Merged
merged 2 commits into from
Dec 2, 2023

Conversation

hasecilu
Copy link
Contributor

@hasecilu hasecilu commented Nov 23, 2023

Currently only icons for big providers of git hosting service are available.

Organizations of open source software usually manage their own instances.

Adding the remote addresses of some of this organizations will let us to identify via a glyph icon the remote providing the source code.

For example some gitlab instances in the wild like the ones from GNOME, freedesktop.org, KDE organization can get a more personal touch.

The Debian and KDE instances didn't use gitlab subdomain making it to not even being recognized as gitlab instance getting the git icon.

NOTE: Some glyphs are from Nerd Fonts 3.1.0, you may need to update your font.

ANOTHER NOTE: In the FreeBSD section (#i) is used because FreeBSD uses uppercases on their git commands and if someone don't change it to lowercase it wouldn't get the FreeBSD icon.

IMPORTANT NOTE: The logo used for KDE organization is the logo from their KDE Plasma desktop environment because in NerdFont the KDE logo is not available, I can merge it to font-logos project to then submit it to NF but will not be available until NF next release.

screenshot1700779456

The icons are from organizations that manage a git instance by themselves.
Currently only icons for big providers of git hosting service are available.

Organizations of open source software usually manage their own instances.

Adding the remote addresses of some of this organizations will let us to
identify via a glyph icon the provider of the source code.
@romkatv
Copy link
Owner

romkatv commented Nov 24, 2023

Very nice! Thanks for the PR.

Some of the icons are unavailable in Nerd Fonts v3.0 and the wizard currently does not attempt to detect fonts with a higher version than that. Eventually I'll add such detection but it's too early to do so. Are there reasonable alternatives for the following icons for people using Nerd Fonts v3.0?

  • VCS_GIT_CODEBERG_ICON
  • VCS_GIT_FREEDESKTOP_ICON
  • VCS_GIT_GNOME_ICON
  • VCS_GIT_KDE_ICON

If these are all hosted by gitlab, perhaps a gitlab logo?

@hasecilu
Copy link
Contributor Author

Codeberg is not a gitlab instance, it uses forgejo. The gitea and forgejo logos were also added on Nerd Font 3.1.0 in case someone need to use them.

The GNOME and freedesktop.org instances already have the gitlab logo because "gitlab" is their subdomain, in case of KDE they use "invent" and get the git logo.

@romkatv
Copy link
Owner

romkatv commented Nov 24, 2023

Are there reasonable alternatives for the following icons for people using Nerd Fonts v3.0?

  • VCS_GIT_CODEBERG_ICON
  • VCS_GIT_FREEDESKTOP_ICON
  • VCS_GIT_GNOME_ICON
  • VCS_GIT_KDE_ICON

I cannot merge the PR as is because it'll result in broken icons for people on Nerd Fonts v3.0.

@hasecilu
Copy link
Contributor Author

What do you think about to directly assigning VCS_GIT_ICON to codeberg and VCS_GIT_GITLAB_ICON to the other 3 without modifying the icons.zsh file and when 3.1.0 is properly supported revert that change.

@romkatv
Copy link
Owner

romkatv commented Nov 24, 2023

Thanks, that's exactly what I was asking: which fallback to use. You gave me the right kind of info. You don't need to make any changes to the PR, I'll do it myself.

@ShellTux
Copy link

Hey, I really like using p10k to theme my zsh prompt, I would like to contribute to this project
So I have some repos where the remote repo is a gitea server.
I would like to have a gitea icon for those repos, and I found that recent version of nerd fonts have a gitea icon.
So I found this pull request, instead of creating a new pull request, can I submit a new commit for this one?
by just implementing VCS_GIT_GITEA_ICON to '\uF339 ' and add the rest accordingly

@hasecilu
Copy link
Contributor Author

I think that would be cool but since the gitea icon is from NF 3.1.0 I don't know if romkatv would like to a change of something before.

@hasecilu
Copy link
Contributor Author

I just remembered about another repository called sourcehut (https://sourcehut.org), where the repos are hosted at https://sr.ht their logo is a circle, so we can use nf-fa-circle_thin at \uf1db ().

romkatv added a commit that referenced this pull request Dec 2, 2023
romkatv added a commit that referenced this pull request Dec 2, 2023
When you choose "Many icons" option in the configuration wizard,
git repositories with a remote receive an icon that depends on
the remote's URL. In the past the matching of the URL was rather
lax: both https://foo.bar/github.com and https://jackfan.us.kg.foo.bar/
were recognized as belonging to github.com. This is no longer the
case.

If you start seeing the plain "git" icon where you were used to
seeing a github/gitlab/etc logo, please open an issue. Make sure
to mention the remote URL of your repo.

This change also allows you to specify the mapping from remote URLs
to icons. Here's an example:

    typeset -g POWERLEVEL9K_VCS_GIT_REMOTE_ICONS=(
      '*@my-company.com:*' VCS_GIT_MY_COMPANY_ICON
      '?*'                 VCS_GIT_ICON
      '*'                  ''
    )

    POWERLEVEL9K_VCS_GIT_MY_COMPANY_ICON='my-company-logo'

The matching is done in the specified order: the first match wins.
@romkatv romkatv merged commit 783588c into romkatv:master Dec 2, 2023
@romkatv
Copy link
Owner

romkatv commented Dec 2, 2023

I've merged this PR and applied a few changes on top. If your font has Nerd Fonts v3.1 icons, you can use them like this:

typeset -g POWERLEVEL9K_VCS_GIT_CODEBERG_ICON='\uF330'

You can now also override the mapping from remote git URLs to icons. See 7fd7637.

@hasecilu
Copy link
Contributor Author

hasecilu commented Apr 8, 2024

IMPORTANT NOTE: The logo used for KDE organization is the logo from their KDE Plasma desktop environment because in NerdFont the KDE logo is not available, I can merge it to font-logos project to then submit it to NF but will not be available until NF next release.

Hi, release of Nerd Fonts 3.2.0 has been done, so, the KDE logo is now available as nf-linux-kde at \uf373

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants