RefactoringCombos / ArlosCommitNotation

A notation for small commits messages that show the risk involved in each step
310 stars 30 forks source link

!! notation expands if using bash weak quoting (double quotes) #19

Open rogerdubbs opened 4 years ago

rogerdubbs commented 4 years ago

Example:

> p4 submit -d "R!! inline method"

This will expand to

> p4 submit -d "Rmylastcommand inline method"

or something.

I guess I need to learn to use single quotes to use this.

arlobelshee commented 3 years ago

Ugh. Yeah, that's a problem. I never use command-line for messages, so never though of shell escapes when creating it.

Do you have any alternatives you might recommend?

The main thing I like is that it stands out. It is 3 chars wide, with the first indicating what's going on and the next two screaming RISK IS HERE!!

arlobelshee commented 3 years ago

What do people think about **

F B R**

Hm. Looks like I'm cussing. I don't particularly like that.

arlobelshee commented 3 years ago

I'm still open to a proposal that avoids terminal history expansion. I don't have an idea, so can anyone make a good proposal?

JayBazuzi commented 3 years ago

There are so many different shells out there with so many different rules for which characters are special in which contexts. It's hard to design any system that won't trip up any shell.

Here's another example:

> git commit -am "r   rename `t` -> `u`"

In PowerShell backtick is the escape character, so backtick-t becomes a TAB. So in PowerShell I try to always use single quotes unless I know I want special shell expansion things to happen in my string.

Meanwhile, in Python ' and " have the same treatment. Sigh.

JayBazuzi commented 3 years ago

Some more character ideas for unsafe: R++ R@@

Or maybe we change the layout: !R! *R*

Maybe we also switch the safe changes to .r. which would address the multiple-space-collapse issue (#26). . and ! have a nice visual relationship.

jmasonlee commented 2 years ago

I like the layout change. I feel like it makes things more useable.

arlobelshee commented 1 year ago

43 Considers an alternate layout. Addresses this concern and also makes risk more clear.