Coder Social home page Coder Social logo

amoffat / supertag Goto Github PK

View Code? Open in Web Editor NEW
573.0 10.0 23.0 15.98 MB

A tag-based filesystem

Home Page: https://amoffat.github.io/supertag/

License: GNU Affero General Public License v3.0

Makefile 0.06% Shell 0.35% Rust 99.59% C 0.01%
filesystem tags fuse fuse-filesystem tagging

supertag's Introduction

Logo

Build Status

Supertag is a tag-based filesystem, written in Rust, for Linux and MacOS. It provides a tag-based view of your files by removing the hierarchy constraints typically imposed on files and folders. In other words, it allows you to think about your files not as objects stored in folders, but as objects that can be filtered by folders.

Intersection

Installation

Linux

curl -Ls https://github.com/amoffat/supertag/releases/latest/download/supertag-x86_64.AppImage > tag
sudo install tag /usr/local/bin

Mac

brew install amoffat/rnd/supertag

supertag's People

Contributors

amoffat avatar ngirard avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

supertag's Issues

Unsure how to import a large number of files

The documentation -- which is great btw -- doesn't seem to address how to import a large number of files into a Supertag collection, and I couldn't find any script of program in the repo tree that would help.

Do you have any best practices to share ?
Could we imagine a helper tool for this ?
I guess what I'm thinking of, is a program (or a subcommand) that would take as arguments:

  • a name of a Supertag collection, or a mount point;
  • a <path> to the directory to import
  • a tag name that would be affected to all imported files (e.g. inbox)
  • an optional number of path components to strip (e.g. --strip-components=2)

and that would

  • find all files from <path> (possibly ignoring .git dirs using the ignore crate)
  • treat all path components as tags (excluding the leading components if necessary)
  • add the files to the Supertag collection, tagging them with the tags corresponding to the path components, plus the tag given as a parameter (e.g.inbox).

What do you think ?

Consider adding SQL indexes

Unless I'm mistaken, the code doesn't seem to create SQL indexes, and a quick look at the queries leaves me under the impression that they would benefit from indexes.

Any thoughts ?

Error when tagging a file with spaces in filename (NotFound)

I just installed the latest release package of tag, and started tagging my files. However when encountering a file with spaces in the filename, I get the error:
Error: IO error: Os { code: 2, kind: NotFound, message: "No such file or directory" }

$ tag ln SJ3.EXE oldies/sj3
$ mv SJ3.EXE S\ J3.EXE
$ tag ln S\ J3.EXE oldies/sj3
Error: IO error: Os { code: 2, kind: NotFound, message: "No such file or directory" }

Same result if I enclose the filename in double quotes instead of quoting the space with \

Provide a comparison with TMSU

I think it would be very useful to provide a comparison with TMSU.
It is similar in scope, written in Go, and in active development.

I understood from the Reddit thread that you weren't familiar with it, and IMHO it is an additional reason for this comparison. I'm pretty sure that it would be beneficial for you to get to know about TMSU's design choices and feature set.

Furthermore, TMSU's author (@oniony) started to program in Rust, so there could be an opportunity for you guys to join your forces and work together, which would be amazing.

documentation typo?

https://amoffat.github.io/supertag/tips_and_tricks.html states:

However, "stat transparency" means that although person-1 isn't the immediate child of photos, we can treat it as if it was. This means that you can do ls people/person-1/⋂ to list the intersection of those two tags, without needing to go through the people tag group.

Should this be: ls photos/person-1/⋂ ?

Problem tagging multiple files with glob expansion

Hey,
very cool project! I have been looking for a performant file tag organizer and this looks promising. I just have some UX issues I hope can be resolved without too much hassle.

Tagging multiple files at once
My first issue is me wanting to tag multiple files in the same directory using a wildcard. I tried:

tag ln * escher/art

Expecting all files in my directory to be added to escher & art tags but instead I got an error:

Error: IO error: Os { code: 2, kind: NotFound, message: "No such file or directory" }

spaces in file names

Thank you @amoffat for this great thing!

Are there any reasons to avoid spaces in tag names? As far as I can tell so far, no problems arise. (Of course, tags with spaces in them have to be quoted on the command line.)

Unable to compile or install supertag with macFUSE 4.0.5

I have manually installed MacFUSE 4.0.5; homebrew casks only have 3.11.2.

Running brew install amoffat/rnd/supertag as directed in the docs produced this error:

Warning: Calling depends_on :osxfuse is deprecated! There is no replacement.
Please report this issue to the amoffat/rnd tap (not Homebrew/brew or Homebrew/core):
  /usr/local/Homebrew/Library/Taps/amoffat/homebrew-rnd/supertag.rb:8

I've opened https://github.com/amoffat/homebrew-rnd/issues/1 for that.

Next, I tried to install supertag using cargo, but there was a compilation error:

  thread 'main' panicked at 'Invalid version of osxfuse: Failure { command: "\"pkg-config\" \"--libs\" \"--cflags\" \"osxfuse\" \"osxfuse >= 2.6.0\"", output: Output { status: ExitStatus(ExitStatus(256)), stdout: "", stderr: "Package osxfuse was not found in the pkg-config search path.\nPerhaps you should add the directory containing `osxfuse.pc\'\nto the PKG_CONFIG_PATH environment variable\nNo package \'osxfuse\' found\nPackage osxfuse was not found in the pkg-config search path.\nPerhaps you should add the directory containing `osxfuse.pc\'\nto the PKG_CONFIG_PATH environment variable\nNo package \'osxfuse\' found\n" } }', fuse-sys/build.rs:36:10

According to the MacFUSE release notes, the library is now simply named fuse, rather than osxfuse. So I edited fuse-sys/build.rs to change osxfuse to fuse on line 27 and then I got a new build error and decided this was beyond my current knowledge.

chaining exclusions results in no files being excluded

eg. given this setup:

# install current release version as of this issue
curl -Ls https://github.com/amoffat/supertag/releases/download/v0.1.4/supertag-x86_64.AppImage > /tmp/tag-0.1.4
chmod +x /tmp/tag-0.1.4
function tag() { /tmp/tag-0.1.4 "$@"; }

# make a debug collection
cd /mnt # change to your base (mine is ~)
sudo mkdir -p supertagdebug
sudo chown $USER:$USER supertagdebug
tag mount supertagdebug
cd supertagdebug

this test case fails:

touch /tmp/{a1,a2,ab,b1,b2,c1}
tag ln /tmp/{a1,a2,ab,b1,b2,c} $PWD/basetag/
tag ln /tmp/{a1,a2,ab} $PWD/basetag/a
tag ln /tmp/{ab,b1,b2} $PWD/basetag/b
tag ln /tmp/c1 $PWD/basetag/c

echo "actual:"
ls basetag/-a/-b/_/
echo "actual vs expected:"
diff <(ls basetag/-a/-b/_/) - << EXPECTED
c1
EXPECTED
echo "actual vs no filtering:"
diff <(ls basetag/-a/-b/_/) <(ls basetag/_/)

I get the output:

actual:
a1
a2
b1
b2
c1
actual vs expected:
1,4d0
< a1
< a2
< b1
< b2
actual vs no filtering:
2a3
> ab

it seems to be excluding the intersection of the intersected tags, rather than individually excluding each separate exclude tag.

Lints in clippy::restriction group are meant to be picked one by one

Hi @amoffat, thanks for this cool project!

I noticed you enabled the whole restriction category of Clippy. Lints in that group are not meant to be all enabled, as they are thought for very specific codebases, and some of them are even against idiomatic Rust. You should pick them one by one, if you find any of them useful.

Clippy should warn you against that, but you may be using an older version. Just wanted to make sure you are aware of that!

Does not work on arch linux

$ ./tag -vvv mount -f tmptest
Mounting to "/mnt/tmptest"
Error: ExitStatus { cmd: "xdg-open (internal)", status: ExitStatus(ExitStatus(768)), stderr: "XPCOMGlueLoad error for file /usr/lib/firefox/libmozgtk.so:\nlibselinux.so.1: cannot open shared object file: No such file or directory\nCouldn\'t load XPCOM.\nXPCOMGlueLoad error for file /usr/lib/firefox/libmozgtk.so:\nlibselinux.so.1: cannot open shared object file: No such file or directory\nCouldn\'t load XPCOM.\nxdg-open: no method available for opening \'/mnt/tmptest\'\n" }

$ uname -a
Linux ws 5.9.3-arch1-1 #1 SMP PREEMPT Sun, 01 Nov 2020 12:58:59 +0000 x86_64 GNU/Linux

selinux is required? Should that not be bundled with the appimage?

Sorting folders?

My personal programming projects folder is a disaster, and this seems just about perfect for sorting it. How could I do that?

Complement tags

For example, ~math matches everything that does not have the tag math. So you can go to pdf/~math to get all pdfs which are not about math.

Importing directory hierarchies as tag groups

I think it would be a really useful feature to import existing directory hierarchies as tag groups. By that I mean the following:
I have an existing collection of art images, e.g. Wallpapers/art/escher, Wallpapers/art/munch, etc. and I want to import them into my tag collection as tag groups like so:
$ cd Wallpapers
$ tag ln import .

This should result in subdirs of art/ being grouped as art+ and files of escher and munch being tagged with their respectives parent dir names. I hope it is clear what I mean, if not I am available for further discussion.

I can try helping out implementing this as well, though I have little experience with Rust as of now (I code more in Python and TypeScript) but would like to learn more Rust anyway.

Publish fuse-sys on crates.io

Apparently that's needed for cargo package to work. Ran into that while trying to package Supertag for Guix.

And again, I am not thrilled to have to through GitHub to report issues.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.