-
Notifications
You must be signed in to change notification settings - Fork 17
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
Show git submodule #42
Comments
@pablogipi Can you clarify the request?
If you're just asking for # 1, i.e. add an optional But if you're asking for # 2, then it quickly gets murky. Git doesn't seem to have a way to do that, so it would have to be 100% custom code. It would require running additional git commands to find all submodules and their respective directories, compare against the current working directory, and filter away modified files that are from a different submodule/repo than the current directory. And it would raise many questions about confusing/quirky situations:
|
Hello Chris.
cmder-powerline-prompt works in this way, it gives preference for submodules when you ire inside it, which is relly really useful. We can do a test with option 1 as an starter. Thanks |
That's interesting, because that's the project that was the original source for clink-flex-prompt, and that's mentioned near the top of the README in this repo. You stated that both the branch status and file status are being shown from the parent. Are you sure the file status is inaccurate? I see something a little different:
|
Yes, that is exactly what motivated me to open this issue. |
Ok, what misled me was the statement that "flex-prompt show the parent repo states/branch instead of the submodule's". But it's only the branch info that's inaccurate. And I see why. I'll make a fix. |
Thanks Chris!! |
When support for worktrees was added, detection of submodules got broken. |
I'll check scoop to update it in my systems. |
Tested today and working fine, thanks |
Which icon do you suggest? |
He! Apparently in devicons there is one for submodules: https://icons8.com/icons/set/git-submodule I think is can go between the git logo and the branch icon. Thanks! |
@pablogipi There's been a misunderstanding. Text terminals can't use graphical icon files. You'd have to look in Nerd Fonts Cheat Sheet for icons that can potentially be available in some customized nerd fonts. Many such icons end up illegible at the small font sizes typically used in terminal windows. For example, like this: In the screenshot I searched for "submodule" and there are two nerd icons available matching that keyword (searching for "folder" or other keywords may find other potentially suitable icons). In the screenshot I hovered over the first one, which makes a menu show up for "COPY" options. If you click "Icon" it copies the selected nerd icon character into the clipboard, and then you can paste it into a terminal window. Here is what that icon actually looks like in Windows Terminal, when using a nerd font that includes that icon (not all nerd fonts include all icons): By the way, the second icon from the screen shot isn't available in most nerd fonts, and it pastes as the "character not present in font" symbol. This is why it's important to test whether a proposed icon is available in nerd fonts. Also, just because it's available in one nerd font doesn't mean it's available in others. The icons currently used by clink-flex-prompt are available in most nerd fonts; it takes time and effort to find suitable icons and verify them. Those are the reasons why my response to the suggestion to use a different icon for submodules was to ask "which icon?" Because there are very few options, very little control available, and a lot of verification effort is required. So, while I agree that using another icon could be nice, I definitely need specified suggestions, and ideally the suggestions need to have been verified to be truly viable (i.e. that the icon is legible enough to be recognizable and that the icon is actually present in most nerd fonts). Also, are you suggesting to show several icons in a row? One for "git", one for "submodule", and one for "branch"? Or are you suggesting to replace the "git" icon with a "submodule" icon? Or are you suggesting to replace the "branch" icon with a "submodule" icon? |
Yep I know, the links I sent before were for the devicons that are part of the NerdFonts. |
I was looking for a specific suggestion of a textual Unicode codepoint to use, since that's the only thing that can actually be used. A link to an image file isn't usable. I would prefer something legible. In this case, the majority of the work is hunting down possible icons and verifying how widely they're actually available in nerd fonts. That involves many hours, and it's work that others can do just as easily as myself. If you or someone else does the work of finding a suitable icon, then it's pretty quick for me to add code to use it. |
NerdFonts recently released a v3 of the fonts and icons. It's a major change in what icons are available, which Unicode codepoint they're available at, and how wide they are. The good news is there's a submodule icon and it's double-wide now so it's very legible. The bad news is:
Ugh. |
I think is better to stick to v2.
|
I think you mean supporting v2 is worthwhile. Yes, of course. But I can't make v3 not exist, and I can't make people not use it, and it has better icons. If you're saying flexprompt shouldn't even add support for v3 at all, then that wouldn't make sense. I'll be adding support for v3, which means making the wizard help figure out which one is being used, so that flexprompt can support both v2 and v3 (obviously not at the same time on a given computer).
I'll take a look at them and their availability, thanks for the suggestions! |
No, I mean stick to v2 for the submodule icon. |
Do you recognize the consequences of that proposal? It would mean flexprompt would be incompatible with the current versions of NerdFonts, and people would be unable to use flexprompt (with icons) with NerdFonts anymore. That wouldn't make any sense. Maybe the meaning of "v2" and "v3" was unclear? It refers to the version of the fonts themselves. A font cannot be "both" v2 and v3. A v2 nerd font and a v3 nerd font have different icons at different Unicode codepoints. If flexprompt "sticks to v2" that means it will not work when using a v3 font, and that is very unacceptable. As I said, I will make flexprompt support v2 when you use v2, and support v3 when you use v3. |
Full support is coming for:
Plus, an option to use color emoji in Windows Terminal for certain icons. |
Uuuh that's great, thanks for the update! |
The combination of Clink v1.4.28 and clink-flex-prompt v0.14 should handle showing an icon for git submodule, and supporting different versions and widths of nerdfonts, and supporting certain color emoji in Windows Terminal. The new releases have been published. |
At the moment if you go to a folder thta is a git submodule, flex-prompt show the parent repo states/branch instead of the submodule's.
Would be gret to have parameter for the git module to get the status/branch from the submodule if present, instead of showing the parent repo.
Thanks.
The text was updated successfully, but these errors were encountered: