Skip to content

git.latest: add option to hard-reset only when there are remote changes#46854

Merged
rallytime merged 3 commits intosaltstack:developfrom
terminalmage:issue35888
Apr 6, 2018
Merged

git.latest: add option to hard-reset only when there are remote changes#46854
rallytime merged 3 commits intosaltstack:developfrom
terminalmage:issue35888

Conversation

@terminalmage
Copy link
Contributor

This adds a third potential value for the force_reset argument, 'remote-changes' which if used will not discard uncommitted changes unless the local clone is not up-to-date with the remote repository.

Resolves #35888.

This allows for local changes to be discarded only when the repo is not
already up-to-date.
Copy link
Contributor

@rallytime rallytime left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just have a couple of really picky comments, otherwise this looks really nice and ++ for tests. :)

Windows only. Required when specifying ``user``. This parameter will be
ignored on non-Windows platforms.

.. versionadded:: 2016.3.4
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this whole function is new, then I don't think this versionadded here is correct.

If ``True``, do not log an error to the minion log if the git command
returns a nonzero exit status.

.. versionadded:: 2015.8.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment here as above.

be observed (i.e. the encoding specified by the locale will be
tried first, and if that fails, UTF-8 will be used as a fallback).

.. versionadded:: 2018.3.1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also probably not needed, I think. :)

This removes some versionadded/versionchanged lines that were
unnecessary in a brand new function, but ended up there because of
copypasta. It also updates the output_encoding documentation to match
the updated docs from a recent PR that hasn't yet been merged from
2018.3 to develop.
@terminalmage
Copy link
Contributor Author

@rallytime good catch, updated. Thanks!

@terminalmage terminalmage requested a review from rallytime April 5, 2018 20:48
@rallytime rallytime merged commit ed8e94a into saltstack:develop Apr 6, 2018
@terminalmage terminalmage deleted the issue35888 branch April 11, 2018 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants