check50 icon indicating copy to clipboard operation
check50 copied to clipboard

check50 crashes or hangs indefinitely on "nested slugs"

Open Jelleas opened this issue 6 years ago • 5 comments

Check50 will hang or crash (on trying to create a commit) once you've previously checked a slug that is a prefix of your current slug. Steps to reproduce:

touch hello.c
check50 jelleas/foo/prefix_crash/bar
check50 jelleas/foo/prefix_crash/bar/baz

Jelleas avatar Oct 10 '19 13:10 Jelleas

I think that's always been the case. Git doesn't allow a branch to be a prefix of another. Do you have any workarounds in mind?

kzidane avatar Oct 10 '19 13:10 kzidane

Have check50, or lib50, check for this scenario and raise a pretty exception in case this occurs.

There's another underlying problem. We have an assignment that we later extended with another variant, a "more" version so to say. Now we've already used the slug for that assignment. That means students have that slug as a branch on me50. Because of this we can't create slugs that extend the previous slug with "more". This is a non obvious problem from the perspective of the user and we should probably warn them if this is the case.

Jelleas avatar Oct 10 '19 13:10 Jelleas

@kzidane If I understand you correctly I have a small correction: these are not branches that are prefixes of each other, but directories in a single branch.

We can easily fix this by putting the directories next to each other - and we have - but the base directory name is still the same and non-local check50 still crashes after fixing our checks repo :-)

stgm avatar Oct 26 '19 14:10 stgm

Nevermind, Jelle explained why branches are indeed relevant (in the background process).

stgm avatar Oct 30 '19 14:10 stgm

I think (hope) it is documented somewhere that you can not have two problems where one slug is the proper prefix of another. However, a pretty exception doesn't really help since there's nothing the user can do once this happens. We can have check50 try to preemptively delete the local branch corresponding to the prefix slug maybe?

cmlsharp avatar Nov 10 '19 01:11 cmlsharp