git-branchless icon indicating copy to clipboard operation
git-branchless copied to clipboard

smartlog: replace `--reverse` flag with config opt

Open e-q opened this issue 1 year ago • 3 comments
trafficstars

My perspective, based on my own experience, is that folks generally stick to one log orientation/direction. In principle, the reverse flag can be incorporated by default via an alias, but this doesn’t catch the auto-smartlog that is emitted after some operations.

This PR adds a Boolean configuration option that replaces the —reverse flag: branchless.smartlog.reverse

This is a breaking CLI change, so I don’t imagine this would incorporated as-is. However, I didn’t want to go too far down this path without considering your thoughts and opinions on how a configuration option may be incorporated. (Not to mention my very limited Rust experience 😅)

What do you think? Thanks for all your work on such a helpful tool!

e-q avatar May 20 '24 15:05 e-q

A configuration option makes sense to me, since I've never once wanted to enable it for git-branchless and never once wanted to disable the equivalent option for jj 😅.

The git-branchless-smartlog output isn't really meant to be machine parseable (you can use git-branchless-query for that), so I'm optimistic that nobody's workflow would be broken by this. I posted in git-branchless Discord and jj Discord as well to see if anyone had any thoughts.

If we're worried about it, we could make the command-line flag deprecated (print a warning when used) but continue to support it.

arxanas avatar May 26 '24 20:05 arxanas

Thanks for considering this! I’ve added a commit that puts the CLI flag back, and prints a deprecation warning. Feel free to modify this as you see fit.

e-q avatar May 28 '24 14:05 e-q

Hi! Any blockers to merging this? I was just writing up a discussion topic requesting this exact config flag. :)

kevinmost avatar Jan 14 '25 23:01 kevinmost