`commentChar` isn't working in git butler cli
Version
but 0.19.10
Operating System
macOS
Distribution Method
dmg (Mac OS - Apple Silicon)
Describe the issue
I used git config --global core.commentChar ";" to set commentChar to ";".
I tried to commit with git - it worked.
I tried to commit with but - it showed me # as a commentChar instead of ;.
I tried something at least with but and wrote but config --global core.commentChar ";" - and of course I got error, because commentChar as a parameter isn't implemented
How to reproduce (Optional)
- Set another
commentChar- e. g.git config --global core.commentChar ";" - Try to commit anything with
but - Got comments with
#
Expected behavior (Optional)
- Set another
commentChar- e. g.git config --global core.commentChar ";" - Try to commit anything with
but - Get comments with
;
Im curios what the reason is to changing the comment char. I’ve never needed to do that myself.
Im curios what the reason is to changing the comment char. I’ve never needed to do that myself.
I already implemented this feature, and as you can see in pull requst I wrote in "affected issues" section number of the issue, it's "#13845". So, at my work we also use these numbers that indicate issues to navigate through issues. And we write commit messages with them in the start of the commit message.
As far as they written with "#" means when I'm using but commit and write #13845 - made this and that ... - whole message for a commit would be commented. So I need to change commentChar
As far as they written with "#" means when I'm using but commit and write #13845 - made this and that ..., so whole message for a commit would be commented. So I need to change commentChar
That makes sense. Thanks for clarifying.
Makes me wonder if we should instead use a different char/string. Jujutsu uses JJ: which I imagine you're less likely to start lines with. We could use BUT:.
I would definitely consider using the common char instead as clearly it is expected that but behaves similar to git as configured, in similar situations, and this seems to be one of them.
To me it seems that would solve the problem at hand and be the least surprising to users, while also being less verbose, i.e. a single characters X vs BUT.
I would definitely consider using the common char instead as clearly it is expected that but behaves similar to git as configured, in similar situations, and this seems to be one of them.
To me it seems that would solve the problem at hand and be the least surprising to users, while also being less verbose, i.e. a single characters
XvsBUT.
Ok, then let's leave my solution as is? What else needs to be discussed? I reckon it's just basic setting that must be in git butler CLI
I reckon it's just basic setting that must be in git butler CLI
I disagree. I think if we could find a way to fix your issue without adding more configs then thats better.
I reckon it's just basic setting that must be in git butler CLI
I disagree. I think if we could find a way to fix your issue without adding more configs then thats better.
but this is flexability, you can set any comment char that you want, just like in classic git
Taking the role of the moderator here. To me, it seems everybody can have their way.
My suggestion is to support core.commentChar, but to actually treat it as string. Then those who set it get what they set, even if it's a prefix like BUT.
And GitButler can decide what it wants to do if it's unset - it could easily fall back to BUT if that's the desire.
I for one would want to change that to something makes my editor highlighting work correctly, and with this suggestion I can (I just set commentChar explicitly).
For this PR it would mean to change char to String.
What do you think @davidpdrsn?
Sure!
@Byron @davidpdrsn I made change char to String. Check it out in PR.
I'll take a look!
Is there any progress on this? I randomly ran into the same issue and can't figure out how to change the commentChar as of now ...
Is there any progress on this? I randomly ran into the same issue and can't figure out how to change the commentChar as of now ...
I've implemented this feature and requested review 4 month ago... I guess they don't care.... So I just built git butler locally with this feature and using it, and it works flawlessly. So I guess you can just clone my fork of that repo and just build git butler locally to use that feature.
While I understand any frustration coming from not getting something seemingly simple done after such a long time, the reasons for this are often quite mundane, but not caring is not one of them 😅.
I advise against using the fork of @UeberTimei though as the respective PR is conflicting and very old - you wouldn't get the best version of GitButler if built locally. I closed it for now, maybe @davidpdrsn has time to push a substitute, or close this issue if it's not anything he wants to tackle right now.