WIP: Automatic suggestion of DSID ranges from commit script [skip ci]
As discussed in #29 (closed)
Still WIP since I think this may be far from what we want
How the suggestion mechanism works
When doing the dry-run of the commit script users are supposed to use -s in order to get a suggestion of the DSID ranges that they should use.
The script will:
- loop over all DSIDs in the commit
- identify the jO in each DSID directory and extract the first generator
- query all the heads in
origin, find the min and max allowed DSID for the generator determined in (2) and return the minimum free DSID
Example
I've added (not yet committed 999xxx/999997:mc.Ph_1.py, 999xxx/999998/mc.Sh_2.py, 999xxx/999999/mc.Sh_1.py and run:
./scripts/commit_new_dsid.sh -d=999997-999999 -n -s
INFO: will use following remote for pushing: origin
Suggesting DSID ranges ...
jO: 999xxx/999997/mc.Ph_1.py -> generator = Ph
jO: 999xxx/999998/mc.Sh_2.py -> generator = Sh
jO: 999xxx/999999/mc.Sh_1.py -> generator = Sh
Suggested DSID range for Ph ...
999xxx/999997 -> 600xxx/600010
Suggested DSID range for Sh ...
999xxx/999998 -> 700xxx/700055
999xxx/999999 -> 700xxx/700056
Not yet implemented
- The script does not try to "fill holes", e.g. in
700xxxthe first two DSIDs are700000, 700005so in principle the two DSIDs above could be moved to700001, 700002 - Generators not implemented: HI, Misc, validation. Someone should suggest an algorithmic way of deciding what is Misc and what is validation
- Enforcing a given DSID assignment as suggested by the script
Edited by Spyros Argyropoulos