Git status display

Git status shows the following information:

  • number of ahead / behind commits for current branch
  • current branch
  • tags on HEAD

Information is displayed in these locations:

  • Project View - ahead / behind, branch name, tags on HEAD

    status-project-view

  • status bar - ahead / behind

    status-status-bar

Numbers for ahead and behind are based on number of commits not present in each of the branches. This information is obtained from output of git rev-list <current-ref>...<parent-ref> --left-right command.

Information presentation depends on the selected parent branch mode:

  1. if parent-ref is a remote tracking branch of a current branch
    • simple branch name is displayed
    • ahead shows number of not yet pushed commits
    • behind shows number of remote commits not present in local branch
  2. if parent-ref is a remote branch not tracking current branch (possible with Auto or selected parent modes)
    • extended branch name is displayed
      • <current branch> -> <parent branch> when both branches have the same remote
      • <current branch> -> <parent remote>/<parent branch> when both branches have different remotes
    • ahead shows number of commits from a current branch not present in remote parent branch
    • behind shows number of commits on a remote parent not present in the current branch

Parent branch mode

There are following modes available:

  1. Auto - if Task Management plugin is enabled then get tracked branch of tasks parent branch, use tracked branch of current branch otherwise
  2. Tracked remote - tracked branch of current branch
  3. Selected parent - tracked branch of selected local branch. Branch selection goes through steps:
    1. if branch name contains / then match against names of remote branches prefixed with remote
    2. else find local branch with given name and use it’s remote branch as parent