Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FR: Add an easy way to view commit message/description in jj log #3688

Open
gpanders opened this issue May 14, 2024 · 1 comment
Open

FR: Add an easy way to view commit message/description in jj log #3688

gpanders opened this issue May 14, 2024 · 1 comment

Comments

@gpanders
Copy link
Collaborator

Is your feature request related to a problem? Please describe.

For a new user, it is not clear how to view the full commit message/description of a change with jj log. There is a builtin_log_detailed template, which is closer to the default log format that git users are probably used to. However, this has two (minor) issues:

  1. Discoverability. Speaking from my own subjective experience, this is not easy to find for a new user, for what is likely a common operation. Reading jj log -h or jj help log does not offer any clues that builtin_log_detailed exists (if one is lucky, one might run jj log -T with no argument and see builtin_log_detailed in the list). In my case, I did not discover this until I cloned the jj repo and found this listed in the templates.toml file.

  2. Information density. builtin_log_detailed lives up to its name and is quite detailed. Ideally, there should be a way to view the entire commit message/description in the log, but with the "normal" log output format. The builtin_log_detailed template shows the full commit/change ID (without highlighting the "shortest prefix") and puts each piece of information on a separate line.

Describe the solution you'd like

Two proposed solutions:

  1. Add a new flag to show the full commit message in the log (similar to how -p shows a diff and -s shows changed files). Perhaps -d/--description?
  2. Show the full commit message/description with jj log -s instead.

My personal preference is for option (1) as this allows the option to compose with other flags (e.g. one could use -p -d or -d -s).

Describe alternatives you've considered

One alternative could be shipping a new default template which sits somewhere between builtin_log_compact and builtin_log_detailed which looks just like compact but includes the full description instead of just the first line. This could be used with jj log -T builtin_log_descriptive, however this is still quite a bit to type compared to jj log -d.

jj show shows the full description, however this can be tedious to use when I want to view full descriptions in the log pager. The current jj log also does not indicate whether a change includes a description body (in addition the first line), so it's not clear just from viewing jj log if there is any more message to see with jj show.

Additional context

Perhaps wanting to view full descriptions in the log is not as common as I think it is. I personally find it quite valuable, but I'm willing to accept that I'm the odd one out, in which case I could create my own template.

@gpanders
Copy link
Collaborator Author

Thinking about this further I'm not sure a new flag would work: -p and -s both add additional information which is not captured by the templates, and works independently of the template. But that would not apply to the proposed -d flag.

So perhaps the best answer is a new "out of the box" template, or just a docs update.

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

No branches or pull requests

1 participant