Summary: | Git migration: Update hook to enforce QA filename policy | ||
---|---|---|---|
Product: | Gentoo Infrastructure | Reporter: | Ulrich Müller <ulm> |
Component: | Git | Assignee: | Gentoo Infrastructure <infra-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | mgorny, qa |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 333531 | ||
Attachments: |
update hook
update hook update hook update hook v2 update hook v3 update hook v4 |
Description
Ulrich Müller
2015-07-04 09:47:57 UTC
Created attachment 406158 [details]
update hook
Created attachment 406160 [details]
update hook
Created attachment 408700 [details]
update hook
Add a list of exceptions:
.gitignore
metadata/.gitignore
Why did you loop over the list of files rather than apply grep to it? Also, if there are multiple bad files, this looks like it exits after the first bad file. some rough puesdocode to improve it: ==== badfiles=$(git diff ... | egrep -v -e "${regex}") rc=0 for f in badfiles ; do if exception ; continue ; fi echo "Bad file: $f" rc=1 done exit $rc ==== On some pathological input, your validation takes many seconds; whereas putting grep in first ensures it is much faster. I'll attach a new skipt using grep as soon as I've found a way to work around bug 574662. Created attachment 425430 [details]
update hook v2
Updated version including robbat2's suggestions.
Ping. What prevents this from being deployed? This bug is open since more than one year now. Created attachment 465434 [details] update hook v3 Updated version using grep -z again. Needs >=sys-apps/grep-2.24 (where bug 574662 is fixed). I'm sorry for replying this late but could you please use: while... < <(...) Instead of putting the loop on end of pipeline? Created attachment 468130 [details] update hook v4 (In reply to Michał Górny from comment #10) > I'm sorry for replying this late but could you please use: > > while... < <(...) > > Instead of putting the loop on end of pipeline? Sure, see attachment. (: backwards is pipeline the because though read to harder it make will That I've added 'IFS=' before 'read', and a guard for checking 'master' branch only, then committed it to git-gx86-tools [1], added to gitolite and enabled for repo/gentoo. Let's see if people can still push now ;-). [1]:https://github.com/gentoo/git-gx86-tools I had a little slip but it should work now. I have just confirmed that I'm able to push again ;-). |