| Any reason not to fix this the other way around? Besides the effort needed, of course. The thing is - "detached HEAD" builds by commit hash is just too popular. It's much too often you see tasks like "Our latest commit broke the production, deploy revision ad3ad12 immediately!" (and, of course, there is no tag or branch head pointing to this revision, it's just HEAD^ from master or something like it), and to be able to perform such tasks efficiently you have to stick with the "long" Git checkout syntax in your pipelines. Regardless of the syntax, checking out by commit hash by putting it in "branches" parameter is confusing enough already, so different behaviour of a shortcut adds yet another quirk to keep in mind. Also checkout([$class: "GitSCM", ...]) looks too similar to how you used to wrap pre-pipeline era plugins in generic build steps, so it's counter-intuitive that you should use this syntax to get the things done: you don't do step([$class: "ArtifactArchiverStep", ...]) instead of clearer archiveArtifact ..., why do checkout([$class: "GitSCM", ...]) instead of git ... ? |