Snaipe / dot-git

Managing your dotfiles the Git Way™
44 stars 26 forks source link

Not working as intended? #2

Closed S3NTYN3L closed 7 years ago

S3NTYN3L commented 7 years ago

When I fork your repo and follow your instructions, bin , ignore and share don't appear in the ~/.config/dotgit/ directory on my machine.

Thus, things like dot profile and dot files are utterly broken.

Please look into this.

S3NTYN3L commented 7 years ago

Seems to be working now. Something must have gotten corrupted during transfer. I don't know how that could have happened twice, with a reboot in between, but the third time is the charm, as they say... ;)

For my third attempt, I ended up rm -rfing my ~/.config/dotgit directory. I deleted my dot-git fork and forked yours again. From there, I just followed step 2 in the README less the alias and shell sourcing bits.

Sorry to have bothered you.

S3NTYN3L commented 7 years ago

I've spoken too soon. I keep seeing the following error any time I try commands like dot files. ~/.config/dotgit/bin/git-profile: line 251: type: dot_master: not found

I also cannot create any profiles. For example, the command dot profile add vim returns; 1 dot: Revision 'dot-vim' does not exist.

Do you have any insight to provide?

Snaipe commented 7 years ago

It seems that refactoring the code to create a new work tree in place broke it. Let me see if I can fix that.

In the mean time, you can just create a new orphan branch named dot-vim, and create a profile off it. Let me know if you have any issue with that.

Snaipe commented 7 years ago

I fixed the profile code -- profile add should now work as expected. Let me know if this fixes anything for you.

S3NTYN3L commented 7 years ago

Running dot files returns Expansion of alias 'profiles' failed: 'profile' is not a git command. There is also a bunch of code spat out on the screen.

Running dot profile add vim returns git: 'profile' is not a git command. See 'git --help'

Snaipe commented 7 years ago

What does type dot return? $HOME/.config/dotgit/bin needs to be present in your path (though this should have been done in the dot alias), and $HOME/.config/dotgit/bin/git-profile need to exist/be executable.

If you're missing the git-profile script, you can bring it back with dot checkout -f -- ~/.config/dotgit/bin.

S3NTYN3L commented 7 years ago

type dot returns dot is aliased to 'PATH="$HOME/.config/dotgit/bin:$PATH" git --git-dir="$HOME/.config/dotgit/repo" --work-tree="$HOME"'

Alas, when running the dot files command, while it does indeed now return the added files, there is also an error at the top of the output: /home/s3ntyn3l/.config/dotgit/bin/git-profile: line 245: type: dot-master: not found

If I run dot profile add vim and then run dot files, a new line is prepended with the same message. /home/s3ntyn3l/.config/dotgit/bin/git-profile: line 245: type: dot-vim: not found

Finally, if I run dot profile add vim and then dot profile add vim .vimrc, I get; /home/s3ntyn3l/.config/dotgit/bin/git-profile: line 245: type: dot-vim: not found

This seems to be the same error as before, just happening with a different command.

Snaipe commented 7 years ago

This seem to come from something else. Is /bin/sh symlinked to another shell on your system?

Also, could you edit the first line of git-profile from #!/bin/sh -e to #!/bin/sh -ex, run dot files 2>&1 | curl -F c=@- https://ptpb.pw, and paste the link here?

Snaipe commented 7 years ago

I can reproduce the issue when running the script with bash rather than a strictly-compliant shell like dash -- type prints to stderr if he can't find a symbol in this case.

This should now be fixed -- try pulling from me with dot pull --rebase https://github.com/Snaipe/dot-git master, and let me know if that fixes it for you too.

S3NTYN3L commented 7 years ago

Sorry, I've been busy the last few days. Everything seems to be working as it should now.

Thanks much for addressing this! ;)