Skip to content

feat: configure backup strategy - #12985

Open
aster-void wants to merge 5 commits into
helix-editor:masterfrom
aster-void:feat/select-write-strategy
Open

feat: configure backup strategy#12985
aster-void wants to merge 5 commits into
helix-editor:masterfrom
aster-void:feat/select-write-strategy

Conversation

@aster-void

@aster-void aster-void commented Feb 28, 2025

Copy link
Copy Markdown
Contributor

what does this PR allow?

it allows choosing backup strategy from these three:

  • move original to backup, create a new file, then move the backup back if it fails / use COPY strategy if the file is hard-link (current behaviour, will be the default)
  • copy original to backup, write to the original, then copy the backup back if it fails
  • directly write to the original file

why?

some tools such as Vite and Tinymist fails to detect changes because of helix's current backup behaviour. As a workaround, I want to change how helix creates backup.

other things

The diff is subset of #11374, so this can be closed if it gets merged

lmk if there's better name for this, because I'm bad at naming things :)

@aster-void aster-void changed the title feat: choose writing strategy feat: choose backup strategy Feb 28, 2025
@TornaxO7

Copy link
Copy Markdown
Contributor

Is this related to #11374 somehow?

@aster-void

aster-void commented Feb 28, 2025

Copy link
Copy Markdown
Contributor Author

@TornaxO7 Probably yes.
I just needed a quick patch to not stop my vite watch every other :w's.

I'm willing to change the config variable to something that makes more sense after that PR

@aster-void
aster-void force-pushed the feat/select-write-strategy branch 2 times, most recently from da6d182 to 8b0a422 Compare March 1, 2025 04:00
@mo8it

mo8it commented Mar 7, 2025

Copy link
Copy Markdown
Contributor

Maybe we should ask @kirawi before proceeding because of the overlap of both PRs. The PR by @kirawi could rebase on top of this one which would also make it smaller and easier to review.

@aster-void aster-void changed the title feat: choose backup strategy feat: configure backup strategy Mar 11, 2025
@aster-void
aster-void force-pushed the feat/select-write-strategy branch from aff08e0 to f40a200 Compare March 31, 2025 15:51
@kirawi

kirawi commented Mar 31, 2025

Copy link
Copy Markdown
Member

Sorry, I haven't had a time to look at this yet. I likely won't be able to push the linked PR anytime soon, so I am fine with a knob to choose backup strategy.

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.

5 participants