Giter VIP home page Giter VIP logo

Comments (6)

jbernard avatar jbernard commented on July 19, 2024 1

This is a lot ;) Thanks for all of the feedback, I'll go through each piece in order, starting the the repo environment variable. I'm reasonably certain this is working in general, so I'll need more info on your OS, python version, shell, etc. It might be better to open a separate bug for this and we can work through it there - but I'm confident we can get it working.

Dotfiles can keep track of symlinks as well (not yet documented). If you have a file like "~/.foo" and that is a symlink to "/dev/null", when you add that file, dotfiles will leave the original symlink in place and add a link in the repo to the target (/dev/null in this case). The link command understands this and can put the symlink in place if it's missing. For me personally, I use an IRC client called weechat, and it symlinks plugins to be autoloaded, so I need dotifles to handle that case. It's not tested very well tested yet, so there may be issues but I'll get them sorted.

Copy is coming ;) In fact, status already understands it and will show a C in the status column when a file is copied. I need to expose it on the CLI and add tests, but it's not too much work to finish up.

WRT a list command, there is a status which lists only dotfiles that are missing or in some not-good state, and a status -a command which lists everything dotfiles knows about (the contents of the repository) and each file's respective state. The latter sounds like what you're asking for, am I missing the idea?

from dotfiles.

jbernard avatar jbernard commented on July 19, 2024

Hey,

The short answer is no, there isn't a configuration file for the master branch at the moment. My hope was that I could make enough useful choices in the code that a configuration file would not be needed. So the status command only shows files that are in an error state (things that need your attention), and files that are fine or totally unlinked are not shown at all (unless you use -a flag). Does that make sense? What are your thoughts?

from dotfiles.

KharmaScribbles avatar KharmaScribbles commented on July 19, 2024

from dotfiles.

jbernard avatar jbernard commented on July 19, 2024

from dotfiles.

KharmaScribbles avatar KharmaScribbles commented on July 19, 2024

Thank you for explaining the environment variable.

Edit: even after exporting DOTFILES_REPO, even "echo $DOTFILES_REPO" reads the correct var .. but it still used the default, so I'm too stupid to figure that out.. I made an alias using -r flag though so it works great now..

Sorry I am so late to reply, I had some personal issues. I am usually online 24/7 ;)

This is long, my suggestions are at the end under TL;DR.

you can read it all to figure out why I suggest the ideas, and gather some newbie user feedback if you really want. Sorry if I'm confussing.

I am suggesting a list option which lists all the dotfiles that are in an OK state, and which are located in the repository (which I guess would qualify as ok state anyway - being located in the repo). An option which lists everything dotfiles is keeping track of and which I moved into the repo with dotfiles add.

Random question, which may already be answered itself, can dotfiles keep track of files that are NOT symlinked? Yet know that they are not.. If so, the "list" option I suggest should also show whether a symlink has been made or not.

I may need to open another issue for this, but I ran into a huge problem the other day. It was totally a 'PEBCAK' mistake on my part, but nonetheless..

I stupidly symlinked my "authorised_keyfile" in my .ssh folder with dotfiles, and Google Cloud Platform does not appreciate that at all. I dual boot my Chromebook, I have both Linux and ChromeOS installed, and Termux (android) technically... I did not have a key to one of my VM's for Linux and on this day had to *Powerwash my ChromeOS due to a Chrome update bricking my owner account..

To get to my point, I had no current keys, and couldn't edit my SSH file to add new ones. I could not access dotfiles because I could not ssh into the server, I made new keys to manually add via GCP console, but Google refused to update the "authorised_keys" file because it was a symlink, so it also prohibited me from logging in via Google's "ssh" button for in-browser ssh, because behind the scenes the VM also uses that file for the browser ssh.

I was able to ssh in as a different user ( good thing I already had a secondary user on this server though!) (root login is disallowed on this VM).. as this different user, even as su, I could not use dotfiles properly;
I could not remove the dotfile, or remove the link. I basically had to delete the file completely from the filesystem.
I was smart enough to make a copy and remake the file before deleting.. but it took me forever to realize the problem about it being a symlink in the first place, (I had to view my serial console, I never do that) and then once I came up with the remedy to ssh as user n2, I was further frustrated by not being able to use dotfiles to easily fix the issue as a different user on the same machine (or even as su)..

It wasn't that I got "command not found" it was an error straight from dotfiles saying some error about not being able to operate on the file, which I can get the error verbatim for you if you need to see it.. I don't remember it clearly except that I was able to use the dotfiles command, just not from a repo that the current user didn't own (I guess?)

I am learning to code, only a beginner in HTML/CSS on the designing side.. and I only sysadmin with already created tools. I am a writer/poet, very creative with tons of ideas but no knowledge on the difficulty/possibility of implementing them, no idea how to code them, I want for so much but have no way to create :(
Wouldn't even know where to start. Linux is still at the "For Dummies" stage with me as it is, so application code? Lost on me.
-- Sorry that my wishes are the kind where I want so much but don't participate in helping create, I am always more of a designer and docs contributing type githubber ;) I am a user with feedback hopefully valuable. I may never learn to code software/script something from scratch, but at least I can help mold programs I use enthusiastically to have them become more perfect towards my use case. Or at least inform the devs what I would need/like for the program to become perfect, hopefully inspiring them to make it be close enough.

The opinionated blogger in me also makes me write super long posts, I hope I don't lose you..

TL;DR - Don't hate me

Not sure what I am suggesting here.. I can make a separate issue for problem 2 too maybe with clear ideas.. Mostly,

  1. dotfiles could allow tracking of files without using symlinks.. It could show in the list of tracked files some way of knowing if the file in the repo/being tracked by dotfiles is symlinked or not. Also show a status if it is Copied, hypothetically assuming the copy flag is implemented ;) (read below re: 'copied')..
    *my file encrypt program "elasticdog/transcrypt", won't encrypt symlinked files, so it would be great to store the sensitive ones (like authorised_keys ;) ) encrypted in my repo but still tracked by dotfiles.

  2. here's the idea to remedy idea 1; or as well as idea 1.. to also allow a "copy" option instead of the default "symlink". Normally, dotfiles would work as normal, moving the file to the repo and creating a symlink, however with the "copy" flag, it would make a duplicate of the file and NOT create a symlink. It would use the same prefix scheme in naming the copied file, and it would move the duplicate file to the repo, but leave the original in-place in the home dir (or wherever it is) and the original unchanged, instead of a symlinked version.

*This would bring the need of the --list flag I mentioned in the Too Long area, as well as brings another need: perhaps "sync" could create a new copy/overwrite of the duplicated file in the REPO for files made with the copy flag, and do what it currently does for symlinked files. (so, say I copy a file with --copy flag, it will stay in the repo with the content copied at time of creation, without a symlink the original in my home dir will not be the same as the repo version if I make changes.. Using "dotfiles sync" flag would make re-links as it normally does for files created the default way but if it's tracking any files that were made with the --copy flag, it would make a new copy of the file as it stands in the homeDir, overwriting the version in my repo with an updated copy. I hope you understand this.. My brain exploded trying to get my meaning across.

  1. dotfiles should have a --force option again, perhaps hidden in the manual (not listed as an option via --help/-h flag) that would have allowed me to --force symlink removal as su user or even to allow dotfiles to run as sudo user without needing the force option.. maybe just a warning if it's about to do anything destructive under sudo. Anyways, when trying to fix my issue on the authorised_keys file, I did try force, and it told me there was no such option as force. You will need to read the Too Long area to understand why I came to needing this, even as an emergancy option.

I love this dotfiles manager, I so wish I could code.. I am in love with the --copy idea, heh.. Maybe I will see if I can figure out how to code..something..

Sorry for the long post.
I hope it didn't sound pushy or anything. 
I love writing so regardless if you use my feedback or not;
it doesn't matter to me. I'd just appreciate you reading it honestly,
and even if nothing changes I will still use this.  
Thank you so much for your time. 

from dotfiles.

KharmaScribbles avatar KharmaScribbles commented on July 19, 2024

I am so grateful you took the time to read this. I'm sorry for the explosion of words.

I use ZSH for my shell, and tried exporting DOTFILES_REPO but dotfiles still tried to use the default ~/Dotfiles.. I do many of my permanent environment exports within my .zshenv file, maybe I'll try exporting this particular one in zshrc. As a workaround, I just set up an alias to use the -repo flag but I'd love to get the environment variable working correctly just for practice.

So in order for dotfiles to track files linked to a custom path (like ~foo -> dev/null) all I'd need to do is make sure the symlink already exists and then dotfiles add ~foo? Which I assume puts the file foo in my repo but maintains that it's symlinked to dev/null? and so if I cloned this repo on another machine and did "dotfiles link", even on this other machine, dotfiles would know to link foo with dev/null?

I am excited for the Copy feature coming! That along with status -a is exactly what I was talking about. I did not realize there was an -a flag for status, and it works perfectly.
What are the icons representing in the "status" list? What is the difference between ? and ! for example? Are there others?

Another question cropped up as I was refining my dotfiles the other day, is there a way to set a configuration for dotfiles to only manage a specific branch of a repo? I decided to use branches for my different machine setups, and ran into a minor thing when I was in my repo but on a branch for another machine.. I understand it would be impossible to control the symlinks changing contact per branch, but can we control dotfiles to only pay attention to the status of files and to only add files to a particular branch of the repo regardless of the branch I'm currently checking out ? Just a random idea, I will continue being careful of which branch I'm on before running a dotfiles command.

Using this repo's version of dotfiles is great, it;s just not well documented yet and I see many of my questions and ideas are incorporated or coming along, which is awesome! Thank you so much!

(Is it possible to manage multiple repos on the same machine by making an alias to use the -r flag pointing at different repos? I guess that was kind of the point of the -r flag.. any caveats to managing multiple repos this way?

from dotfiles.

Related Issues (20)

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.