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

Fix --delete-it-all and --delete commands #913

Merged
merged 4 commits into from
Jun 13, 2023
Merged

Conversation

edeustua
Copy link
Contributor

@edeustua edeustua commented Apr 24, 2023

There are two issues with deleting:

  1. If --delete-it-all is used, atuin will enter an infinite loop since searches are performed on the whole history, including deleted items.
  2. Blanking the command field may violate the unique(timestamp, cwd, command) condition.

This PR adds a deleted_at is null condition to the search query to fix issue 1. And removes the blanking of the command to fix 2.

@vercel
Copy link

vercel bot commented Apr 24, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
atuin ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 13, 2023 7:32am

Since entries are searched everytime a delete process ends, the
--delete-it-all command will enter an infinite loop if searching the
whole history.
Command blanking may violate the `unique(timestamp, cwd, command)`
condition.
@ellie
Copy link
Member

ellie commented Jun 13, 2023

Sorry for the rebase, CI wasn't starting and needed a poke

Copy link
Member

@ellie ellie left a comment

Choose a reason for hiding this comment

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

Thank you for sorting this out!

Seeing as this is your first time contributing, if you would like a holographic contributors-only Atuin sticker, then please fill out this form!

We do also have a Discord if you'd like to ask any questions, or just fancy hanging out!

@ellie ellie enabled auto-merge (squash) June 13, 2023 07:35
@ellie ellie merged commit 79f7b1d into atuinsh:main Jun 13, 2023
9 checks passed
@edeustua edeustua deleted the fix_delete branch June 14, 2023 16:37
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

2 participants