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: jj log -from flag #2177

Closed
cflewis opened this issue Aug 28, 2023 · 5 comments
Closed

FR: jj log -from flag #2177

cflewis opened this issue Aug 28, 2023 · 5 comments

Comments

@cflewis
Copy link

cflewis commented Aug 28, 2023

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

Follow up to #229 (comment), where without the implementation of removing empty commits from rebase, jj log gets really messy.

Describe the solution you'd like

jj log could take a -from flag which from a certain tag, rather than all the commits it knows. The obvious use cases being jj log -from main and jj log -from HEAD@git.

@cflewis
Copy link
Author

cflewis commented Aug 28, 2023

Worth noting I figured out how to do this with shell scripting so I'm not out on a limb:

$ jj log --color=always | sed '/main/q'
@  zqywvzzo [email protected] 2023-08-28 19:28:08.000 +00:00 9b173c98
│  (empty) (no description set)
◉  nkuoktpr [email protected] 2023-08-28 19:28:08.000 +00:00 HEAD@git 3b31827a
│  [recipe_wrapper] Allow BCID tests to use real tool
◉  vzkpxvmp [email protected] 2023-08-25 21:58:20.000 +00:00 main master 794119f5

...albeit my Stack Overflow searching/script fu is insufficient to show me the subject of the commit at main :)

@ilyagr
Copy link
Contributor

ilyagr commented Aug 28, 2023

Have you tried jj log -r main:: or jj log -r 'main..' or jj log -r 'main..@'? The last two have the disadvantage of not showing the "root" of the log (the commits on the main branch), if that bothers you, you can also try jj log -r 'main..|(main..)-'.

I have a [revset-alias] configured to show 'siddot(from, to)'= '(from..to)|(from..to)-'. It needs a better name, and I'm wondering if we can come up with something similar that could be provided out of the box.

The docs for this (for the prerelease version) are all in https://github.com/martinvonz/jj/blob/main/docs/revsets.md.

@cflewis
Copy link
Author

cflewis commented Aug 28, 2023

Ah, jj log -r main:: does exactly what I want!

  1. What does the :: mean? Is that common jj syntax?
  2. Perhaps the help text on jj log could mention this?

@ilyagr
Copy link
Contributor

ilyagr commented Aug 28, 2023

What does the :: mean? Is that common jj syntax?

Indeed! See the link I gave.

Perhaps the help text on jj log could mention this?

I think it would be good to mention the revset docs from jj log help.

@cflewis
Copy link
Author

cflewis commented Aug 28, 2023

Awesome, thank you for your help. This was great and has really improved my jj experience.

I'll close this out, feel free to reopen if you want it to track any help doc changes!

@cflewis cflewis closed this as completed Aug 28, 2023
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

2 participants