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

diff sub command #84

Open
aarcro opened this issue Mar 24, 2014 · 6 comments
Open

diff sub command #84

aarcro opened this issue Mar 24, 2014 · 6 comments

Comments

@aarcro
Copy link

aarcro commented Mar 24, 2014

homeshick diff <castle> [<file1> <file2>]

Should diff the current files against the ones in the castle. useful before linking to know what's getting clobbered or should be merged in.

@andsens
Copy link
Owner

andsens commented Mar 25, 2014

Hm, interesting feature. That'd be quite useful.
The file arguments would be relative to $HOME right?

What should the syntax of the output look like? Just like link or more like git status?

p.s.: What's a "homestick" :-)

@aarcro
Copy link
Author

aarcro commented Mar 26, 2014

I was thinking diff -u for the output. I've also found that on one host I need a different .gitconfig, so I don't link it, but do a vimdiff when there are changes in the castle to merge in.

Maybe a DIFFTOOL env variable and/or --difftool='' flag would be useful.

@andsens
Copy link
Owner

andsens commented Mar 26, 2014

I was thinking diff -u for the output

Hm, ok. I thought you meant that homeshick should show what was going to be symlinked and which files would conflict. I don't think it falls into the purview of homeshick to do such a fine-grained diff like you are suggesting. It'd be nice to somehow be able to integrate homeshick with a git alias though and through that obtain your suggested feature. To do that #70 ("make homeshick output machine readable") needs to be fixed first, then you could write all kinds of cool little scripts that combine homeshick and git features.

I've also found that on one host I need a different .gitconfig

Did you know you can do this now?

[include]
    path = ~/.gitconfig-local

That's a rather handy feature they introduced.

@aarcro
Copy link
Author

aarcro commented Mar 27, 2014

Thanks for the tip on gitconfig-local. Already doing _local's with .bashrc and .vimrc.

Homeshick already prompts to replace existing files with symlinks. But I never want to just say yes, I want to compare the files so I know what i'm losing if anything. Right now I frequently do homeshick cd dotfiles; diff -u home/.bashrc ~/.bashrc

So I figured homeshick diff dotfiles home/.bashrc could save some keystrokes.

I don't think git helps, since it's diffing a file in the repo to a static file outside of version control.

If you think it's out of scope though, go ahead and close this.

@andsens
Copy link
Owner

andsens commented Mar 27, 2014

Ah, ok. So additionally to the [yN] options, you'd like a [d] option that opens up diff -u and compares the file in $HOME with the file in the repo. That is definitely in scope.
I'll have a look at it and see how it could be implemented, should be straightforward (though I think the prompting tool may need a rewrite).

@aarcro
Copy link
Author

aarcro commented Mar 27, 2014

That would be awesome! If it picked up an environment variable for the actual diff command that would be even better. I can take a look at the implementation as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants