Title says it all pretty much. Before I introduced tag within the repo EI was showing the right branch but after tag was introduced within my repo it now only shows the tag which is not desirable. Is this possible at the moment?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

zoheir.nabavi created an issue. See original summary.

zoheir.nabavi’s picture

Status: Active » Needs review

I apologise if I am not following the process correctly and I can not write a patch at the moment but I suggest below edit on the .module file. Obviously we can make the formatting more configurable.

// Show the git branch, if it exists.
      if (
        command_exists('git') &&
        $git_describe = environment_indicator_execute_os_command('git describe --all')  &&
        $git_branch = environment_indicator_execute_os_command('git rev-parse --abbrev-ref HEAD')
      ) {
        // Execute "git describe --all" and get the last part of heads/7.x-2.x as the
        // tag/branch.
        if (empty($git_describe)) {
          return;
        }
        $release = $git_branch . '(' . $git_describe . ')';
      }
e0ipso’s picture

To create patches you can take a look at https://drupalize.me/videos/overview-learn-drupal-ladder?p=1176 and https://www.drupal.org/node/707484.

I hope that helps!

helmo’s picture

For reference here's the patch file for #2

Not really sure why but 'git describe --all' is sometimes just not giving the right answer. It gives me 'heads/develop' while I'm on a branch that has been split off from develop a dozen commits earlier.

helmo’s picture

And here's a slightly improved patch.

e0ipso’s picture

I'm not sure I'm 100% sold on this feature. It feels to me that the indicator is getting very long.

What to you think?

Maybe allowing the user to choose from branch or tag in the settings?

helmo’s picture

I agree that it's getting long. If we can add a smart check to decide which one to show... that would be nice.