8000 checkout: make safe checkout the default by ethomson · Pull Request #6037 · libgit2/libgit2 · GitHub
[go: up one dir, main page]

Skip to content

checkout: make safe checkout the default #6037

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 8000 emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 19, 2024
Merged

Conversation

ethomson
Copy link
Member
@ethomson ethomson commented Sep 6, 2021

Make GIT_CHECKOUT_SAFE the default. NONE is never what the user wants by default; people expect checkout to, well, check things out. Instead, it should be an opt-in "dry run" mode.

But, in fact, it should be a dry run and fire notifications. So we keep DRY_RUN and remove the NONE mode entirely.

This removes some odd code in internal callers of checkout that takes a git_checkout_options and updates the mode to SAFE. This is now unnecessary since everything has better defaults.

@ethomson ethomson force-pushed the ethomson/checkout_safety branch 3 times, most recently from e9b8db6 to 03bd069 Compare March 2, 2022 17:44
@ethomson
8000 Copy link
Member Author
ethomson commented Mar 2, 2022

I made some updates to remove the API breaking parts of these changes; this should be ABI breaking only.

@ethomson ethomson force-pushed the ethomson/checkout_safety branch from 03bd069 to 09a51af Compare March 23, 2022 12:36
@ethomson ethomson force-pushed the ethomson/checkout_safety branch from 09a51af to 6f7875b Compare October 19, 2024 12:09
@ethomson ethomson force-pushed the ethomson/checkout_safety branch 2 times, most recently from 54547f1 to 165a748 Compare October 19, 2024 21:33
Make `GIT_CHECKOUT_SAFE` the default.  `NONE` is never what the user
wants _by default_; people expect checkout to, well, check things out.
Instead, it should be an opt-in "dry run" mode.

This removes some odd code in internal callers of `checkout` that takes
a `git_checkout_options` and updates the mode to `SAFE`.  This is now
unnecessary since everything has better defaults.
Instead of dealing with the clone options sub-options (fetch, checkout,
etc) individually, treat them as a cohesive whole when passing them
throughout the system.

Additionally, move some functions around within the file to avoid
unnecessary decls at the top of the file.  And change a function
signature to avoid conflating truth with error.
@ethomson ethomson force-pushed the ethomson/checkout_safety branch from 165a748 to 6955504 Compare October 19, 2024 22:01
@ethomson ethomson merged commit 68bffe4 into main Oct 19, 2024
18 of 19 checks passed
@ethomson ethomson deleted the ethomson/checkout_safety branch October 19, 2024 23:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
0