andsens / homeshick

git dotfiles synchronizer written in bash
MIT License
2.1k stars 147 forks source link

add push command #185

Closed endorama closed 5 years ago

endorama commented 5 years ago

Hello, I've been using homeshick for quite a lot now, and the most common things that happens is that I forgot to push changes (thus trying to updated terminates with lots of ahead).

So I found useful a push command, that in pair with pull pushes to all remote castles.

Hoping this can be useful to others, here comes the PR.

Thanks a lot for this project!

endorama commented 5 years ago

Could you outline why push wouldn't be part of your normal flow after you have tracked a file and then committed the changes while in the repo?

The primary use comes from "experimental" or to be tested additions: I generally commit them to the local repository, in order to keep track of them. Then they lie there for some time, and if I'm satisfied I push them to the remote.

Basically I split the "adding this to a castle" and "sharing with others" steps.

My only concern is that this would open up for other subcommands like git commit and git add, which would just end up making homeshick a proxy for the git command.

I unserstand the concern, but if you look at homeshick cd or homeshick track those are already "proxy", just very very handy in daily operations :)

I would say that proxying git is not a homeshick responsability, but having handy tool for managing underline repository is.

Also, we need tests for this, without them any changes that could break this subcommand will go undiscovered.

I just wanted to share the code to get feedback, if you are ok accepting it I'll work on tests. I'm not so fond on bats, but I'll try my best.