[go: up one dir, main page]

Skip to content

implementation of "split at" is not as documented

I read the documentation of split at to mean that the first post-split event would include the first few fileops, and the second post-split event would include the remainder:

Finally, some file operations - starting at the one matched or indexed by the split argument - are moved forward from the original commit into the new one. Legal indices are 2-n, where n is the number of file operations in the original commit.

In fact, the opposite appears to be the case, as shown by the following example:

<25> inspect
<25> split at 2
<25>,<25.split> inspect

resulting in:

Event 123 ===============================================================
commit refs/heads/master
#legacy-id 25
mark :122
committer Walter Hoehn <wassa@memphis.edu> 1023210163 +0000
data 57
Added encoding of usernames so that "||" can be handled.
from :119
M 100755 :120 src/edu/internet2/middleware/shibboleth/common/AQHTest.java
M 100755 :121 src/edu/internet2/middleware/shibboleth/common/AttributeQueryHandle.java

reposurgeon: new commits are events 123 and 124.
Event 123 ===============================================================
commit refs/heads/master
#legacy-id 25
mark :122
committer Walter Hoehn <wassa@memphis.edu> 1023210163 +0000
data 57
Added encoding of usernames so that "||" can be handled.
from :119
M 100755 :121 src/edu/internet2/middleware/shibboleth/common/AttributeQueryHandle.java

Event 124 ===============================================================
commit refs/heads/master
#legacy-id 25.split
mark :10367
committer Walter Hoehn <wassa@memphis.edu> 1023210163 +0000
data 57
Added encoding of usernames so that "||" can be handled.
from :122
M 100755 :120 src/edu/internet2/middleware/shibboleth/common/AQHTest.java

The code in question is:

    def split_commit_by_index(self, where, splitpoint):
        return self.split_commit(where,
                                 lambda ops: (ops[splitpoint:],
                                              ops[:splitpoint]))

I may just be misreading the documentation (in which case a clarification there is all that is needed) but the current behaviour seems counter-intuitive to me.

If the current behaviour is not as intended, then the option of just documenting what is happening is still a possibility, as fixing it by changing the code would obviously have an effect on some people in the middle of repository conversions at present who have used split at.

Adding to the list of options (at, by) would allow making the more natural behaviour available as an option without perturbing existing scripts. Ugly, though.