jenkins CI and GIT plugin - “detached head” state at some point

Can some "GIT guru" please have a short look here?

We use jenkins CI for simple deployments. Most jobs make use of the "GIT plugin", and there is some issue with this. Even, if we set the plugin to track the "master" branch. At some point we end up to have a "detached state" in the build directory.

like this.

root@jinx [...]/workspace/build # git branch -a
* (detached from 12dbf9b)
  remotes/origin/dev
  remotes/origin/master

The build process does not report an error. This is the log from GIT plugin.

 > git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
 > git config remote.origin.url git@our.gitlab.server:q3i/our-repo.git # timeout=10
Fetching upstream changes from git@our.gitlab.server:q3i/our-repo.git
 > git --version # timeout=10
 > git fetch --tags --progress git@our.gitlab.server:q3i/our-repo.git +refs/heads/master:refs/remotes/origin/master
 > git rev-parse origin/master^{commit} # timeout=10
Checking out Revision 12dbf9b8eb8fd71580f874ae963162f72221e577 (origin/master)
 > git config core.sparsecheckout # timeout=10
 > git checkout -f 12dbf9b8eb8fd71580f874ae963162f72221e577
 > git rev-list 58f1f1ae97628a0b5f2d5e3090a24416c7952f0e # timeout=10

I see that the detached commit 12dbf9b is in fact the HEAD. Is it an expected state, what might be the advantage of this form the perspective of jenkins GIT plugin?

Thank you for some new GIT knowledge :-)

0
задан 8 February 2018 в 14:06
1 ответ

Трудно сказать, ожидается ли это, не увидев вашу конфигурацию Jenkins, но на самом деле все это означает, что Git проверил конкретную фиксацию напрямую, а не по имени ветки, так что ничего изначально хорошо или плохо об этой ситуации. В зависимости от того, какие плагины вы используете и как они настроены, это может быть нормальным, а может и нет.

0
ответ дан 5 December 2019 в 06:37

Теги

Похожие вопросы