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

[Feature Request] Reject commits with a matching file name ONLY if said file is being modified #13

Open
otherguy opened this issue Feb 16, 2016 · 7 comments

Comments

@otherguy
Copy link

Reject commits with a matching file name ONLY if said file is being modified, i.e. not if the file is being created.

@christiangalsterer
Copy link
Owner

@darkwinternight: What would be the use case to check only for modified files? Please also note that once a file is added to git it stays in the history.

@otherguy
Copy link
Author

My specific use case would be database migration scripts. My coworkers sometimes ahem edit old database migration scripts which then don't get run on production deployments, breaking a site.

People should be able to add files but not modify or delete them. All my database migration scripts have a specific filename pattern and I can write a regex for that.

@christiangalsterer
Copy link
Owner

Thanks for providing some inside into the use case. Shouldn't be too complicated to implement. I will try to look into it in the next days.

@christiangalsterer
Copy link
Owner

BTW: Which version do you currently use?

@christiangalsterer
Copy link
Owner

What about moving a file? Should this be possible?

@otherguy
Copy link
Author

Bamboo 5.10.1.1
File Hooks Plugin 2.2.0

@otherguy
Copy link
Author

Well at least in my case, once a file has been pushed, it should never be touched. Deletion, modification and moving of the file shouldn't be possible (if I need to rollback a database migration, the migration script needs to exist).

From a UX perspective of your plugin, it would be nice to have checkboxes next to the regex field (adding, modifying, deleting, ...) that would restrict the match to the type of action that is being performed on the file.

I.e.:

  • you cannot add files matching foo.bar
  • you cannot delete files matching readme.*
  • you cannot delete, modify or move files matching database/migrations/*.php

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants