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

An example of why ignore or a list option is useful #67

Open
KharmaScribbles opened this issue Aug 6, 2018 · 2 comments
Open

An example of why ignore or a list option is useful #67

KharmaScribbles opened this issue Aug 6, 2018 · 2 comments

Comments

@KharmaScribbles
Copy link

I'm sure I'm just missing out on some command somewhere, but my help info only shows me "add, unlinjk. status, link, remove, help" as the only commands with the version from master.

This has happened to me a few times now, and I keep face-palming myself for not remembering how "link" acts. I'm thinking that internally dotfiles keeps track of only files I've "dotfiles add"ed.. however it appears it keeps track of all the files in the repo, each one representing a dotfile according to 'dotfiles'.

For my use case this is incorrect, as I have quite a few files in my Dotfiles repo that are not actually part of my dotfile configuration and I wish them to not be tracked by dotfiles. Is this possible? Dotfiles also should do as it's told, if I tell it to unlink a file, I don't want it talking back to me with an error about how such and such file is within the repo, there is no force option so I'm kinda stuck fixing everything the hard way. Cheaky dotfiles! :p

screenshot from 2018-08-06 16-31-18

In this case, I used "dotfiles link" to ensure that all my dotfiles were symlinked properly since I had been adding and removing a lot today. I forgot it thinks everything in my repo should be tracked. Turns out, I didn't want any of the new links it made! Those are either an encrypted version of a dotfile I use only to push to the repo, I already had the decrypted version linked (this could have caused a loss of data had the one file not ended in .gpg).. or files related to my encryption program, nothing of which I needed linked in my $HOME.. Oops.

As we figured out in my last issue, I fail at life.. my fault for doing this like 3 times now... but I think dotfiles should either be smarter with linking or at least make it easier to clean up. If I want a link removed, remove it.. I am boss. As you can see, it won't listen to me. Dotfiles owns me right now, it is totally playing the dom in this relationship..:p

*FYI the 2nd command I ran.. "dot" is a dotfiles alias, obvious maybe but just clarifying..

@jbernard
Copy link
Owner

jbernard commented Aug 10, 2018 via email

@KharmaScribbles
Copy link
Author

KharmaScribbles commented Aug 22, 2018

Ahh, misunderstanding.. I was just showing that dotfiles was linking everything in my repo, I didn't mean to point out the error messages, but basically everything that did not error I did NOT want linked... lol , for example, ".keyring/live/.gitattributes" ".keyrings/live/.pubring.kbx" all the files ending in .gpg basically (or rather, any of the files under the .keyring dir) and it also linked "..gitattributes"

I do add files to my dotfiles repo manually - I have an encryption program, which in turn I run on plaintext sensitive files, and it makes that file encrypted with the extension .gpg I only encrypt to push to my public github remote, any files containing secrets basically. It adds the extension .gpg so at the end my repo contains as example irissi/config.gpg however this was the original irissi/config file that dotfiles already linked earlier, but with the filename change it attempts to make a new link on irissi/config.gpg.. After I'm done commiting and push to the remote, I unencrypt that .gpg file and it goes back to being irissi/config. My mistake was asking dotfiles to check links before I was done and unencrypted.. but I wanted to make sure I had everything up to date before my push.. I would rather have it ignore anything in the .keyrings dir as well. .. My encryption program needs to run/be cloned in the root of the repository it will be used in, and it looks for/creates and uses this .keyrings dir. I also sometimes add submodules to my dotfiles repo, like themes or antigen/plugin managers.. I haven't this time around yet but I like having those all within the same "project" aka my dotfiles.

The error I mentioned about it not listening to me, was that for example, running "unlink .keyring/live/.gitattributes" in the repo threw up an error about how it basically wasn't going to unlink because that file I'm asking it to unlink is within the repo. I did discover that running that command outside the repo on the filename it symlinked to my homedir made it unlink successfully, so a suitable workaround but it should just do as I command within the repo anyways.

I guess I could do my workflow a completely different way to avoid this, but I just thought I'd mention this as having a dotfilesignore would just solve it all for me.

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

No branches or pull requests

2 participants