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

Add --only-if-changed option. #3376

Closed
wants to merge 4 commits into
base: devel
from

Conversation

Projects
None yet
4 participants
@skorokithakis
Contributor

skorokithakis commented Jun 29, 2013

I added an option, -o, or --only-if-changed, to only run the playbook if the repository has changed. In my use case, there's no sense in running the playbook if the repository hasn't changed, as it's idempotent, so it won't do anything.

Hopefully this can be merged, as it would be extremely useful to me, and I'm sure to other people as well.

@mpdehaan

This comment has been minimized.

Show comment
Hide comment
@mpdehaan

mpdehaan Jun 29, 2013

Contributor

This looks pretty good but I think the main function should return an integer 0 rather than a string to be consistent. Can you take care of this?

Thanks!

Contributor

mpdehaan commented Jun 29, 2013

This looks pretty good but I think the main function should return an integer 0 rather than a string to be consistent. Can you take care of this?

Thanks!

@skorokithakis

This comment has been minimized.

Show comment
Hide comment
@skorokithakis

skorokithakis Jun 29, 2013

Contributor

Ugh, yes, good catch, I made a mental note to do that but forgot afterwards. Will do ASAP, thanks.

Contributor

skorokithakis commented Jun 29, 2013

Ugh, yes, good catch, I made a mental note to do that but forgot afterwards. Will do ASAP, thanks.

@skorokithakis

This comment has been minimized.

Show comment
Hide comment
@skorokithakis

skorokithakis Jun 29, 2013

Contributor

There, how's that? I meant to print all along.

Contributor

skorokithakis commented Jun 29, 2013

There, how's that? I meant to print all along.

@mpdehaan

This comment has been minimized.

Show comment
Hide comment
@mpdehaan

mpdehaan Jun 30, 2013

Contributor

Much better!

Contributor

mpdehaan commented Jun 30, 2013

Much better!

@mpdehaan

This comment has been minimized.

Show comment
Hide comment
@mpdehaan

mpdehaan Jun 30, 2013

Contributor

You have a merge commit in the history now.

Please always use "git pull --rebase" vs "git pull" and "git rebase" vs "git merge".

You should also always do work on a "topic" branch so features don't get mixed in with one another, in this case maybe the branch should be named something like "only if changed"

In any case, I'm fine with this feature, but need it resubmitted without merge commits.

Thanks!

Contributor

mpdehaan commented Jun 30, 2013

You have a merge commit in the history now.

Please always use "git pull --rebase" vs "git pull" and "git rebase" vs "git merge".

You should also always do work on a "topic" branch so features don't get mixed in with one another, in this case maybe the branch should be named something like "only if changed"

In any case, I'm fine with this feature, but need it resubmitted without merge commits.

Thanks!

@mpdehaan mpdehaan closed this Jun 30, 2013

@skorokithakis

This comment has been minimized.

Show comment
Hide comment
@skorokithakis

skorokithakis Jun 30, 2013

Contributor

Hmm, that's odd, I used Github to fork, committed and then used Github to submit the pull request, so it's odd that it would have the merge. It might have been my old fork, I'll resubmit, thanks.

Contributor

skorokithakis commented Jun 30, 2013

Hmm, that's odd, I used Github to fork, committed and then used Github to submit the pull request, so it's odd that it would have the merge. It might have been my old fork, I'll resubmit, thanks.

@smiller171

This comment has been minimized.

Show comment
Hide comment
@smiller171

smiller171 Apr 10, 2014

Contributor

I was directed here from an article that @skorokithakis wrote. Was this ever merged elsewhere?

Contributor

smiller171 commented Apr 10, 2014

I was directed here from an article that @skorokithakis wrote. Was this ever merged elsewhere?

@jctanner

This comment has been minimized.

Show comment
Hide comment
@jctanner

jctanner Apr 10, 2014

Member

@smiller171 it looks like the parameter does exist in devel ...

    parser.add_option('-o', '--only-if-changed', dest='ifchanged', default=False, action='store_true',
                      help='only run the playbook if the repository has been updated')

It came about in version 1.3.0 per 53207dd

Member

jctanner commented Apr 10, 2014

@smiller171 it looks like the parameter does exist in devel ...

    parser.add_option('-o', '--only-if-changed', dest='ifchanged', default=False, action='store_true',
                      help='only run the playbook if the repository has been updated')

It came about in version 1.3.0 per 53207dd

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