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

feat: Added disclaimer for branch checkout #8957

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dds05
Copy link
Contributor

@dds05 dds05 commented Mar 7, 2025

To fix #6876

Copy link
Contributor

@timsehn timsehn left a comment

Choose a reason for hiding this comment

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

This needs to be a bit more robust.

Also we need a BATS test in:

https://github.com/dolthub/dolt/blob/main/integration-tests/bats/sql-checkout.bats

Some of those tests will need to be updated because we use dolt sql -q "call dolt_checkout('-b', ...)" a bunch of places.

@@ -176,6 +178,10 @@ func doDoltCheckout(ctx *sql.Context, args []string) (statusCode int, successMes
if err != nil {
return 1, "", err
}
terminal_command:=strings.Join(os_args, " ")
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we need to be a bit more clever here. I think we need to check and make sure that call dolt_checkout() with the -b option is the only sql statement being run.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@timsehn
Okay but what if the user calls the command like dolt sql --q "call dolt_checkout('myBranch2');" i.e. without the -b option.
I believe this also needs to be handled.

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.

Warn users about running dolt sql -q "call dolt_checkout(...);"
3 participants