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

Add --no-history option to not push parent history for gh_deploy #2594

Merged
merged 3 commits into from Mar 26, 2022
Merged

Add --no-history option to not push parent history for gh_deploy #2594

merged 3 commits into from Mar 26, 2022

Conversation

wlmchen
Copy link
Contributor

@wlmchen wlmchen commented Oct 4, 2021

No description provided.

@wlmchen wlmchen changed the title Add --no-history option to not push parent history Add --no-history option to not push parent history for gh_deploy Oct 6, 2021
Copy link
Contributor

@oprypin oprypin left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution. This will be accepted.

mkdocs/__main__.py Outdated Show resolved Hide resolved
wlmchen and others added 2 commits October 8, 2021 15:02
Co-authored-by: Oleh Prypin <oleh@pryp.in>
@oprypin
Copy link
Contributor

oprypin commented Oct 9, 2021

Actually you know what? I have tried all kinds of combinations and I still can't guess what this flag does, or, to me it appears to not do anything. I used mkdocs gh-deploy -b test --no-history and it still creates a new commit on top of old ones.

@oprypin
Copy link
Contributor

oprypin commented Oct 9, 2021

Is it supposed to affect the time of creation of a new branch, or is it about an existing destination branch?

@wlmchen
Copy link
Contributor Author

wlmchen commented Oct 9, 2021

It affects the destination branch. If the destination branch already contains commits from a previous deployment, using mkdocs gh-deploy will push a commit on top of the previous commits. Using --no-history sets the newest deployment as the initial and only commit for the destination branch.

An example scenario is simply running mkdocs gh-deploy -b test without --no-history multiple times, which will create duplicate commits (In reality these will be deployments for different commits). Using --no-history will result in only one commit.

Copy link
Sponsor Contributor

@pawamoy pawamoy left a comment

Choose a reason for hiding this comment

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

So it seems this PR simply makes use of ghp-import's no_history option, which in turn creates a commit without a parent one. I'll have to test it on one of my projects to really see how it behaves.

Copy link
Contributor

@oprypin oprypin left a comment

Choose a reason for hiding this comment

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

Sorry for the delay.

Indeed it works as per the description.

Replace the whole Git history with one new commit.

@oprypin oprypin merged commit 052ba86 into mkdocs:master Mar 26, 2022
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.

None yet

4 participants