Skip to content

Commit

Permalink
Show commit hash after making a wip commit on the console
Browse files Browse the repository at this point in the history
  • Loading branch information
simonharrer committed Aug 17, 2021
1 parent b2bda78 commit 53c06c2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
9 changes: 6 additions & 3 deletions mob.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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) {
Expand Down Expand Up @@ -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.")
Expand Down

0 comments on commit 53c06c2

Please sign in to comment.