-
-
Notifications
You must be signed in to change notification settings - Fork 150
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#410: added duration to latest commit for a remote branch to mob status
- Loading branch information
Showing
2 changed files
with
31 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package main | ||
|
||
import ( | ||
config "github.com/remotemobprogramming/mob/v4/configuration" | ||
"github.com/remotemobprogramming/mob/v4/say" | ||
) | ||
|
||
func status(configuration config.Configuration) { | ||
if isMobProgramming(configuration) { | ||
currentBaseBranch, currentWipBranch := determineBranches(gitCurrentBranch(), gitBranches(), configuration) | ||
say.Info("you are on wip branch " + currentWipBranch.String() + " (base branch " + currentBaseBranch.String() + ")") | ||
|
||
sayLastCommitsList(currentBaseBranch.String(), currentWipBranch.String()) | ||
} else { | ||
currentBaseBranch, _ := determineBranches(gitCurrentBranch(), gitBranches(), configuration) | ||
say.Info("you are on base branch '" + currentBaseBranch.String() + "'") | ||
showActiveMobSessions(configuration, currentBaseBranch) | ||
} | ||
} | ||
|
||
func showActiveMobSessions(configuration config.Configuration, currentBaseBranch Branch) { | ||
existingWipBranches := getWipBranchesForBaseBranch(currentBaseBranch, configuration) | ||
if len(existingWipBranches) > 0 { | ||
say.Info("remote wip branches detected:") | ||
for _, wipBranch := range existingWipBranches { | ||
time := silentgit("log", "-1", "--pretty=format:(%ar)", wipBranch) | ||
say.WithPrefix(wipBranch+" "+time, " - ") | ||
} | ||
} | ||
} |