From b354d7dd275042114307a896f088e869d875c68a Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sat, 24 Feb 2024 11:56:02 -0600 Subject: [PATCH] try to show actual changes --- common.go | 10 ++++++++++ git.go | 9 +++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/common.go b/common.go index 8cfed10..e57409c 100644 --- a/common.go +++ b/common.go @@ -24,6 +24,7 @@ func (rs *RepoStatus) getChanges() string { } func (rs *RepoStatus) NoteChange(s string) { + log.Log(REPOWARN, "NoteChange() got", rs.String(), s) rs.changed = true rs.changes += s + "\n" } @@ -191,3 +192,12 @@ func (rs *RepoStatus) SetPrivate(b bool) { rs.private.SetText("false") } } + +// returns a name for human consuption only +// todo: implement nicknames +func (rs *RepoStatus) Name() string { + if rs.IsGoLang() { + return rs.GoPath() + } + return rs.Path() +} diff --git a/git.go b/git.go index bc7a986..c4714ca 100644 --- a/git.go +++ b/git.go @@ -209,7 +209,7 @@ func (rs *RepoStatus) CheckDirty() bool { log.Error(err, "CheckDirty() git status error") rs.dirtyLabel.SetValue("error") if start != "error" { - rs.NoteChange("repo git status is in error " + fmt.Sprint(err)) + rs.NoteChange("git status is in error " + fmt.Sprint(err)) } return true } @@ -220,15 +220,16 @@ func (rs *RepoStatus) CheckDirty() bool { log.Log(REPO, "CheckDirty() no", rs.realPath.String()) rs.dirtyLabel.SetValue("no") if start != "no" { - rs.NoteChange("repo is no longer dirty") + log.Log(REPOWARN, "is no longer dirty") + rs.NoteChange("is no longer dirty") } return false } rs.dirtyLabel.SetValue("dirty") if start != "dirty" { - log.Log(REPOWARN, "repo is now dirty") - rs.NoteChange("repo is now dirty") + log.Log(REPOWARN, "is now dirty") + rs.NoteChange("is now dirty") } return true