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

Git helper for pending push #295

Closed
fgarcia opened this issue Mar 26, 2015 · 2 comments
Closed

Git helper for pending push #295

fgarcia opened this issue Mar 26, 2015 · 2 comments

Comments

@fgarcia
Copy link

fgarcia commented Mar 26, 2015

I believe that some type of warning or error message when trying to deploy with pending commits would be a sane default.

I use this little helper that prevents my most frequent deployment problem. I leave to the maintainers deciding if this is useful and if it should be a default or a helper function.

def no_push_pending!
  pending = system "[ $(git log origin/master..master | wc -l) -ne 0 ]"
  fail "Pending git push!" if pending
end

desc "Deploys the current version to the server."
task :deploy => :environment do
  no_push_pending!
  deploy do
    invoke :'git:clone'
    invoke :'deploy:link_shared_paths'
    ....
  end
end

Obviously the current helper is limited because it only considers the 'master' branch.

@13k
Copy link
Contributor

13k commented May 1, 2015

You could improve it by using the branch setting instead of hard-coding master

@d4be4st
Copy link
Member

d4be4st commented Jul 5, 2015

would love a PR for this. and using branch setting :)

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

3 participants