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

Don't overwrite hooks without --force #42

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

Don't overwrite hooks without --force #42

wants to merge 1 commit into from

Conversation

emlun
Copy link
Member

@emlun emlun commented Jan 24, 2024

Currently, bark install silently overwrites any reference-transaction hook that may be present. This is a potentially very destructive action, so we should take proper care before doing so.

I don't think there's a good way to automatically resolve the conflict in case the file already exists, so this implementation simply lists the conflicting files and leaves it to the user to resolve the conflict manually. (For example, we could move both hook files into hooks/reference-transaction.d/ and make hooks/reference-transaction a script that calls all scripts in reference-transaction.d/, but it's not obvious that things like order of execution wouldn't matter.)

Currently, `bark install` silently overwrites any
`reference-transaction` hook that may be present. This is a
potentially very destructive action, so we should take proper care
before doing so.

I don't think there's a good way to automatically resolve the conflict
in case the file already exists, so this implementation simply lists
the conflicting files and leaves it to the user to resolve the
conflict manually. (For example, we could move both hook files into
`hooks/reference-transaction.d/` and make
`hooks/reference-transaction` a script that calls all scripts in
`reference-transaction.d/`, but it's not obvious that things like
order of execution wouldn't matter.)
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.

1 participant