Open benoit-pierre opened 1 month ago
Hi @benoit-pierre! I hope you're doing well. It's been a while since we corresponded on Plover-related stuff!
Unfortunately, I think this feature never worked as intended: https://github.com/arxanas/git-branchless/pull/512. It seems like that PR caused the flag to be accepted in all positions, but, for whatever reason, the actual value is only processed in some positions. I see this note in the documentation now:
NOTE: Global arguments only propagate down, not up (to parent commands), however their values once a user uses them will be propagated back up to parents. In effect, this means one should define all global arguments at the top level, however it doesn’t matter where the user uses the global argument.
That being said, it might also be a misuse of the way that we parse global options while ignoring errors.
I don't know what the best solution is in this case —
Hi - new git-branchless user here. I just wanted to say I was trying to figure out how to set up a pager for 'smartlog' output, while also keeping the color, and had no idea at all why it wasn't working. Every variation of git sl --color=always | less -R
I tried was not maintaining the colors. Thank you very much Benoit! git branchless --color=always smartlo | less -R
is working for me now.
(As an aside - are the rest of git-branchless users not piping smartlog output to a pager? Or they are, and just aren't having colored output? I can barely imagine living like that!)
On 27 May 2024 at 2:57:46 PM, Mark Fulbright @.***> wrote:
(As an aside - are the rest of git-branchless users not piping smartlog output to a pager? Or they are, and just aren't having colored output? I can barely imagine living like that!)
Your smartlog is LONG enough to NEED a pager? That sounds like a no-merge smell….
-- "Great artists are extremely selfish and arrogant things" — Steven Wilson, Porcupine Tree
I've also started seeing some applications permit global options only at the top-level, before any subcommands, which doesn't seem wholly unreasonable to me.
This wouldn't work for most cases of aliases, namely git sl --color=XXX
, so probably not a good option here.
Description of the bug
Expected behavior
Colors in all 3 cases, no matter the position of the
--color xxx
option in the command line.Actual behavior
Inconsistent behavior.
Version of
rustc
rustc 1.75.0 (82e1608df 2023-12-21)
Automated bug report
No response
Version of
git-branchless
git-branchless-opts 0.8.0
Version of
git
git version 2.45.0