From a16580b300d4a51797aa8fb250a3ae1ac623caf0 Mon Sep 17 00:00:00 2001 From: Snow Lee Date: Sat, 18 Jul 2026 21:24:00 -0700 Subject: [PATCH] fix(cli): log and status show the signed-in account, not the git author fallback MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit bdrive log preferred Op.Author (git/OS identity) even when the op carried the hub account (Op.User/UserName), so team history showed local git emails. Found by the agent-onboarding live e2e: device signed in as e2e-bot showed snow@runbear.io in log. Now: UserName → User → Author. bdrive status likewise shows 'signed in as Name ' when a session exists. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01VbiaaVM2ACxeRi8ySG9ybc --- cmd/bdrive/cmds.go | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/cmd/bdrive/cmds.go b/cmd/bdrive/cmds.go index de959ae..04fe884 100644 --- a/cmd/bdrive/cmds.go +++ b/cmd/bdrive/cmds.go @@ -90,7 +90,15 @@ func statusCmd() *cobra.Command { if err != nil { return err } - fmt.Printf("device: %s (%s) as %s\n\n", dev.Name, dev.ID, dev.Author) + if settings, _ := config.LoadSettings(); settings.Email != "" { + who := settings.Email + if settings.Name != "" { + who = settings.Name + " <" + settings.Email + ">" + } + fmt.Printf("device: %s (%s) signed in as %s\n\n", dev.Name, dev.ID, who) + } else { + fmt.Printf("device: %s (%s) as %s\n\n", dev.Name, dev.ID, dev.Author) + } first := true for id, mi := range mounts { if !first { @@ -179,7 +187,16 @@ func logCmd() *cobra.Command { } else { kind = "delete" } - line := fmt.Sprintf("%s %s %-40s %s on %s", when, kind, op.Path, op.Author, op.DeviceName) + // Prefer the signed-in account over the git/OS author fallback, + // so team history shows hub identities. + who := op.UserName + if who == "" { + who = op.User + } + if who == "" { + who = op.Author + } + line := fmt.Sprintf("%s %s %-40s %s on %s", when, kind, op.Path, who, op.DeviceName) if op.Kind == journal.KindPut { line += fmt.Sprintf(" (%s)", humanBytes(op.Size)) }