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

only re-add svg files which were already added #798

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

PeterNerlich
Copy link

in pre-commit, only re-add svg files which were already added to prevent wrong files to be committed unintentionally

The pre-commit hook used to automatically vacuum SVGs changes files, thus they have to be added again. This was done using git add . before. However, this can be considered hazardous, because it adds all files, tracked and untracked, added or not, to the commit, as the contributor might have experimented around leaving various files.

This change tries to minimize that risk by only considering files already marked for commit (but not files which are "only" tracked) and whose names also end in .svg.

in pre-commit, only re-add svg files which were already added to prevent wrong files to be committed unintentionally

The pre-commit hook used to automatically vacuum SVGs changes files, thus they have to be added again. This was done using `git add .` before. However, this can be considered hazardous, because it adds all files, tracked and untracked, added or not, to the commit, as the contributor might have experimented around leaving various files.

This change tries to minimize that risk by only considering files already marked for commit (but not files which are "only" tracked) and whose names also end in `.svg`.
@PeterNerlich
Copy link
Author

also, we can skip vacuuming and speed up committing when no SVG is to be committed

@jeremypw
Copy link

@danrabbit: Has no recent activity. Does this need closing or converting to draft? I do not have the necessary rights.

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