truncate ref if too long
Merge branch 'master' into v1.5.4