-
-
Notifications
You must be signed in to change notification settings - Fork 660
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
Highlight btrfs subvolumes and mount points; output mount point info #452
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Identify by inode number for now; need to check filesystem too
Pull latest from upstream
Merge latest from upstream
I was almost sure I left a comment here a few weeks/months ago, but apparently not… Would you be able to update your code so that it can be merged? That sounds like an interesting feature to have, especially since Btrfs is used a lot nowadays. |
Yeah, I've been meaning to do this for ages! I'll send a new PR when I've rebased it (or rewritten it with my improved Rust knowledge). |
Superseded by #941 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Ref: #434
I don't expect you to pull this straight in; I'm not a Rust developer so a lot of this code probably isn't very Rust-y and will need error handling and fixups.
That said, I've tested locally and it does what I think it should: identifies
btrfs
subvolumes and highlights them with the^
character in the first column (list view) and funky colouring. Mount points are also underlined in all views and in list view include an arrow->
pointing to the device name and filesystem type. That would probably be better as an option, of course.The code for looking up mount points was borrowed from https://github.com/acdha/mountstatus/tree/master/src/get_mounts and expanded to get the fs type and device name. It would be nice to also get the mount options because the mount point alone isn't very useful for btrfs at least. Also, I don't have a non-Linux system to test on so
bsd.rs
is almost certainly broken.There's also the case that a directory could be both a mount point and a subvolume - i.e. a btrfs subvolume is mounted at that point. I'd like to highlight that in the colouring somehow but couldn't think of a good way to do it (background and underline maybe). Likewise, first character in list view would be nice to have different for mount points. Perhaps it would be possible to do something funky with colours.
Comments welcome.