Skip to content

Conversation

@stefanjakov
Copy link

This PR implements the feature requested in Issue #1135: “Option to customize git log in side panel”, which asked for the commit list pane to be configurable in the same way as the main branchLogCmd.
The original issue noted that the side-pane log was fixed to <short sha> <message> with no way to show extra details such as the author.

PR Description

This PR adds a new configuration option git.log.customPaneLogFormat which allows users to control exactly how each commit appears in the commit list side panel. The default preserves the existing layout ("%h %a %as %g %d %s"), ensuring backward compatibility.

Why it Solves the Problem

Issue #1135 described a clear limitation:

“Currently the git log in the pane only shows <short commit> <message>. I’d like the ability to show <short sha> <Commit author> <message>.”

This PR directly addresses this need by letting users define their own layout with tokens, so the following configuration is possible.

git:
  log:
    customPaneLogFormat: "%h %an %s"

What is Included

New config option added to:
  • Config.md
  • user_config.go
  • JSON schema (config.json)
New flexible custom formatter
  • Supports %h, %H, %s, %an, %ae, %as, %cd, %g, %d, %a
  • Integrates graph lines, decorations, actions, and dates
  • Handles emoji parsing and UpdateRef renaming
  • Collapses excess whitespace for clean output
  • Only used when the user overrides the default format (keeps old behavior otherwise)
Updated test suite
  • Added tests for email- and graph-based formatting
  • Added tests for custom format strings (e.g., %ae %s, %h %g)
  • Each test now isolates config using a fresh common.Common
  • Ensures custom formatting cannot leak into unrelated tests
Backward-compatible behavior
  • Default remains: "%h %a %as %g %d %s"
  • Existing users experience no changes unless they opt in

Please check if the PR fulfills these requirements

  • Cheatsheets are up-to-date (run go generate ./...)
  • Code has been formatted (see here)
  • Tests have been added/updated (see here for the integration test guide)
  • Text is internationalised (see here)
  • If a new UserConfig entry was added, make sure it can be hot-reloaded (see here)
  • Docs have been updated if necessary
  • You've read through your own file changes for silly mistakes etc

… docs

This change introduces `customPaneLogFormat` so users can control how
commit entries are rendered in the side panel. The default preserves the
existing layout, but the new formatter allows integrating graph lines,
decorations, authors, and dates in arbitrary orders.

Schema and docs are updated so the option appears in validation and
Config.md. Test cases now apply per-test config overrides to avoid
global state configurations once formatting influences
presentation/config logic. Also added tests to specifically test the
formatting.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant