Skip to content

[RBB] Ahead/Behind Branch Commit Counts #3968

Closed

Description

@nerdneha

This is part of #3956 and shows how many commits your branch has diverged from other branches

User Flow to check functionality:

  • click on compare tab
  • click into the "compare a branch..." input and see a list of branches
  • for each branch, see the # of commits that branch is ahead and behind your current branch
  • start typing the name of an existent branch in "compare a branch..." input
  • see the same #s for ahead/behind without recalculating

Changes:

  • # of commits your branch is behind \/ that branch
  • # of commits your branch is ahead ^ that branch

Other pieces:

Before:
screen shot 2018-02-08 at 2 11 27 am

(branch list in app for reference)
screen shot 2018-02-12 at 11 02 10 pm

After:
filtering branch

Activity

  1. added this to the milestone on Feb 8, 2018
  2. changed the title [-]Filter Branch to Compare[/-] [+] Ahead/Behind Branch Commit Counts[/+] on Feb 13, 2018
  3. nerdneha commented on Feb 13, 2018

    @nerdneha
    ContributorAuthor

    @niik do we have to worry about O(n) calculations here to calculate ahead/behind? would the app stall if there are >100 branches open?

  4. niik commented on Feb 13, 2018

    @niik
    Member

    @niik do we have to worry about O(n) calculations here to calculate ahead/behind? would the app stall if there are >100 branches open?

    Yes, you're right that this can't be done in one operation, we need to shell out for each branch. Doing so is fairly quick though and I think as long as we do it on-demand as items are shown as opposed to running it for every branch regardless of whether it's visible in the list there shouldn't be any problem. We'll probably need to be careful so that we don't spin up as many git processes as there are visible branches in one go though, some task management is probably necessary.

    We already calculate ahead/behind for all local branches (that has an upstream) after each background fetch in order to perform the background fast-forward.

  5. j-f1 commented on Feb 13, 2018

    @j-f1
    Contributor

    You could also cache the numbers in memory and only update them when a commit or fetch happens.

  6. jeremyzilar commented on Feb 14, 2018

    @jeremyzilar

    🤔So we have been using the date in the master list dropdown as a way to indicate which branches were most recently updated and/or worked on. The number of commits behind master is not really the same thing as, recency. Might be helpful to have both at some point.

  7. changed the title [-] Ahead/Behind Branch Commit Counts[/-] [+][RBB] Ahead/Behind Branch Commit Counts[/+] on Mar 19, 2018
  8. locked as resolved and limited conversation to collaborators on Jul 17, 2018
  9. unlocked this conversation on Sep 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions