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

go/cmd/dolt: Add create new branch suggestion to dolt checkout {commit_hash} #3277

Merged
merged 2 commits into from
Apr 22, 2022

Conversation

druvv
Copy link
Contributor

@druvv druvv commented Apr 22, 2022

Closes #3276

Instead of showing the following when trying to checkout a specific commit:

dolt checkout 400435pip70vh165ggsq4etmggdh6h5i
error: could not find 400435pip70vh165ggsq4etmggdh6h5

We instead show:

dolt checkout 400435pip70vh165ggsq4etmggdh6h5i
dolt does not support a detached head state. To create a branch at this commit instead, run:

	dolt checkout 400435pip70vh165ggsq4etmggdh6h5i -b {new_branch_name}

@druvv druvv changed the title Add create new branch suggestion to dolt checkout {commit_hash} go/cmd/dolt: Add create new branch suggestion to dolt checkout {commit_hash} Apr 22, 2022
@timsehn
Copy link
Sponsor Contributor

timsehn commented Apr 22, 2022

Nice speed run. Bats looks good. I might have used a regex instead of cut but I think it's fine as is.

Copy link
Contributor

@fulghum fulghum left a comment

Choose a reason for hiding this comment

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

Looks good! Thanks for taking this one on and improving the customer experience with this improved error message.

@druvv druvv merged commit 70c6316 into main Apr 22, 2022
@Hydrocharged Hydrocharged deleted the dhruv/suggest-new-branch branch April 22, 2022 20:47
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.

dolt checkout {commit_hash} should ask the user for a new branch name
3 participants