openBrain wrote: ↑Sat May 27, 2023 12:26 pm
OK, I have something working but found a limitation (was actually already here, but found when testing with large changesets).
The current implementation only can deal with changesets counting less than 300 files.
Is it fine limiting the CI to a maximum change of 299 files for a single PR/push, and make it early failing without even trying to build if 300+ files are changed in the patch ?
I think there will be PRs with more than 300 files.
For example, one change I would like to promote is to move the Console framework from printf syntax (%d) to format syntax ({}). This needs to be done at once for all FreeCAD. The reason is that when Console is changed to accept the format syntax, all calls to console will need to be changed to operate properly. See:
https://github.com/FreeCAD/FreeCAD-tran ... issues/226
[I just realised that the ticket should be in FreeCAD and not in FreeCAD-translations, my bad, sorry]
I am not good a git statistics, but I managed to write this:
Code: Select all
for i in `git --no-pager log --pretty=oneline -n 100 | awk -F' ' '{print $1}'`; do echo $i `git show --stat $i | tail -1`; done
So this gets the number of files changes per
commit, for the last 100 commits (feel free to change the -n 100 to get more). There are several commits with more than 300 changes.
Or better, since a date, and showing only those with more than 300 files:
Code: Select all
for i in `git --no-pager log --pretty=oneline --since="2022-05-27" | awk -F' ' '{print $1}'`; do echo $i `git show --stat $i | tail -1`; done | awk -F' ' '{if($2>300)print$2}'
497
497
545
545
766
915
915
1771
901
886
917
690
679
441
532
532
492
708
1011
1391
322
498
1225
1286
2601
307
697
805
348
434
1028
you can complement that with wc for a single line:
Code: Select all
for i in `git --no-pager log --pretty=oneline --since="2022-05-27" | awk -F' ' '{print $1}'`; do echo $i `git show --stat $i | tail -1`; done | awk -F' ' '{if($2>300)print$2}' | wc -l
31
So, 31 commits had more than 300 files affected since 27 May 2022.