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

feature(git): add keep local changes option #425

Merged
merged 1 commit into from
Sep 11, 2019

Conversation

jfroche
Copy link

@jfroche jfroche commented Jul 1, 2019

Add an option to keep local changes when revision changes.
As we do a git checkout --force all local modifications are removed.
We just add an option that stash the modification before the checkout and
unstash the modification after the checkout.

This change is backward compatible, as by default, we keep the current
behaviour and do not keep local modification.

@jfroche jfroche force-pushed the feature/keep-local-changes branch from 052db53 to 02e6e3b Compare July 1, 2019 14:37
user => 'someUser',
}
~~~

Choose a reason for hiding this comment

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

Since the module is stringified Reference.md will be generated automatically with the required information.
##### keep_local_changes`

Valid values: true, false

Keep local changes on files tracked by the repository when changing revision

Default value: `false``

We can use this command to generate the contents in REFERENCE.md
bundle exec puppet strings generate --format markdown --out REFERENCE.md

@sheenaajay
Copy link

sheenaajay commented Aug 1, 2019

Thanks for submitting the PR @jfroche .PR looks great. Thanks for your contribution.
Could you please add the feature information to this section too.

@jfroche jfroche force-pushed the feature/keep-local-changes branch 2 times, most recently from 7ce9510 to c2aee8d Compare August 9, 2019 21:59
@jfroche
Copy link
Author

jfroche commented Aug 9, 2019

@sheenaajay tell me if the change is ok for you. Thank you!

REFERENCE.md Outdated
@@ -141,3 +141,11 @@ Trust server certificate

Default value: `false`

##### `keep_local_changes`

Choose a reason for hiding this comment

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

We can remove from line number 144 to 150. It will be generated automatically with stringify during the release step.

@sheenaajay
Copy link

@jfroche Just a small comment. Rest of the changes looks good. Thank you. I have restarted travis job since the tests failed with time out error.

Add an option to keep local changes when revision changes.
As we do a `git checkout --force` all local modifications are removed.
We just add an option that stash the modification before the checkout and
unstash the modification after the checkout.

This change is backward compatible, as by default, we keep the current
behaviour and do not keep local modification.
@sheenaajay
Copy link

Screen Shot 2019-09-11 at 14 49 27
Thanks for submitting the PR @jfroche .Great work.

@sheenaajay sheenaajay merged commit 4af2453 into puppetlabs:master Sep 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants