The canonical technique in Gimp 2.10 and Gimp3 is to set the image layer above the shape layer and to set the image layer's "Composite mode" to Clip to backdrop. You can keep both layers in a layer group to limit the scope of Clip to backdrop:
This technique allows you to move the layers around later to adjust the position of the cut.