Tuckr icon indicating copy to clipboard operation
Tuckr copied to clipboard

tuckr not compatible with stow --dotfiles

Open quagly opened this issue 7 months ago • 1 comments

tuckr claims to be compatible with existing stow dotfiles but this is not the case when using stow --dotfiles option which allows dotfiles to be named dot_bashrc instead of .bashrc

quagly avatar Apr 16 '25 10:04 quagly

Tuckr aims to be a replacement but not a one to one replacement, so we don't necessarily have to do what they do.

As for the --dotfiles flag, I was only really aware that it existed but never used it myself. I looked it up and that flag was only added to the manpage in 2021 even though it has existed since 2016 and this project has been around since 2020. All this to say, I never used it and was unaware of what it did so I never implemented it.

From the manpage:

       --dotfiles
           Enable  special  handling  for "dotfiles" (files or folders whose name begins with a period) in the package directory. If this option is enabled, Stow will add a preprocessing step
           for each file or folder whose name begins with "dot-", and replace the "dot-" prefix in the name by a period (.). This is  useful  when  Stow  is  used  to  manage  collections  of
           dotfiles, to avoid having a package directory full of hidden files.

I can easily do this by changing how tuckr resolves to the target path, but tuckr push already exists and it just uses a . when it inserts things into your dotfiles repo, so I would have to probably add a flag that allows toggling dot- or something.

Is there a reason why you must have dot- prefixes instead of just using regular dotfiles in your repo? Is this really a necessity or could you just get away with writing a simple script that goes over your repo and replaces dot- for .?

RaphGL avatar Apr 16 '25 14:04 RaphGL

Is there a reason why you must have dot- prefixes instead of just using regular dotfiles in your repo?

Because .xxx files are hidden by default, which can make it harder to manage or view them in some environments (like file explorers). Using dot- avoids that issue and keeps things cleaner.

ShelpAm avatar Apr 30 '25 08:04 ShelpAm

As @ShelpAm said, . files are hidden. I like that dot- files are not. It is not required but nice to have. I don't want to replace dot- with . as then the files will be hidden.

I understand a goal of tuckr is to just work and not require configuration so adding this feature may not be desirable. Alternatively update the documentation to include this incompatibility. That would have helped me to get started as I assumed it was compatible but tuckr didn't work since I had no . files.

quagly avatar May 04 '25 12:05 quagly

Yeah I can certainly add this to documentation. Maybe it might be a good idea to also revive the old from-stow command, which essentially just initialized the tuckr repo and moved everything into Configs, I could take the time to also convert the dot- in there into . and also provide a nice little explanation of the differences in approach between the 2 tools so that the porting over is has less surprises.


Regarding the processing of dot- by tuckr though, I'm still not entirely convinced, so I might leave this issue open in case someone else wants to say something about it.

My reason for not supporting it is:

  • I don't even know if changing files like that is even a good idea, I know it's been on stow for almost a decade now, but what if somehow a program decided it wants it's config files to start with a dot- and you change it, then you might just have a broken config. I do these magic suffix/prefix stuff but they're only on the group name so they don't really directly affect your configs.
  • As stated above, since this could theoretically break for some users, I'd need a flag or a config of some sort to do it and I try avoiding configuration unless absolutely necessary so that I can keep the program easier to use by making things obvious.
  • You rarely really need to directly go in the dotfiles directory unless you're going there to remove a specific file, you can just edit them through their respective symlinks. If you want to add something to a group you can just do tuckr push and it will send the file to the correct location. In those rare instances where you manually go in, most file managers including windows support enabling hidden files.

RaphGL avatar May 04 '25 12:05 RaphGL

I've added a from-stow command that does the conversion and informs the user of the basic difference between the 2 programs:

raph@archlinux ~/Projects/Tuckr/target/debug % ./tuckr from-stow .
By running this command a copy of the stow dotfiles repo is created and converted to tuckr.

    Before continuing take the time to read the following explanation if you've never used tuckr before:

        Stow and Tuckr can mostly be used as alternatives to each other, but Tuckr uses groups to give meaning to your dotfiles.
        A group is a directory with related config files. Tuckr uses those groups to validate that your dotfiles have been deployed correctly.

        Usually a group is the configs for a specific program, but you can create groups however way you like.
        After the conversion has been done, make sure you have your dotfiles separated by groups to take full advantage of Tuckr.

        For more information, check the wiki: https://github.com/RaphGL/Tuckr/wiki
    
Did you use `--dotfiles` with Stow? (y/N) y   
Tuckr does not support `dot-` like Stow does, but they will be converted into regular dotfiles in the new Tuckr dotfiles
Do you want to continue? (y/N) 

The only thing I forgot to add is detecting if the user already uses the path this new repo is going to be put in so that instead it can prefix the old one with _old. I'll do that tomorrow.

RaphGL avatar May 10 '25 23:05 RaphGL