From 53c06c2d9eaea8cad766f9dab27abaff3077d380 Mon Sep 17 00:00:00 2001 From: Simon Harrer Date: Tue, 17 Aug 2021 21:38:00 +0200 Subject: [PATCH] Show commit hash after making a wip commit on the console --- CHANGELOG.md | 3 +++ mob.go | 9 ++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c53b4555..289252db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +# 1.9.0 +- Show commit hash of WIP commits made by the `mob` tool on the console. + # 1.8.0 - `mob next` does not show the same committer multiple times in the list of previous committers. - `mob next` does not suggest the current Git user to be the next typist as long as there were other persons involved in the mob. diff --git a/mob.go b/mob.go index ef8c8f52..313d59c4 100644 --- a/mob.go +++ b/mob.go @@ -764,10 +764,7 @@ func next(configuration Configuration) { } } else { makeWipCommit(configuration) - - changes := getChangesOfLastCommit() git("push", "--no-verify", configuration.RemoteName, currentWipBranch.Name) - say(changes) } showNext(configuration) @@ -787,6 +784,8 @@ func getCachedChanges() string { func makeWipCommit(configuration Configuration) { git("add", "--all") git("commit", "--message", configuration.WipCommitMessage, "--no-verify") + say(getChangesOfLastCommit()) + sayIndented(gitCommitHash()) } func fetch(configuration Configuration) { @@ -1043,6 +1042,10 @@ func git(args ...string) { } } +func gitCommitHash() string { + return silentgitignorefailure("rev-parse", "HEAD") +} + func sayGitError(commandString string, output string, err error) { if !isGit() { sayError("mob expects the current working directory to be a git repository.")