DEV Community

loading...

Discussion on: Enhancing your git commit messages

Collapse
zejnilovic profile image
Saša Zejnilović

Hello,

as much as I like your post, the sed did not work for me. Now is because my machine is compromised in some way or is there a typo? I am not a sed master so can't tell.

$> echo "feature/444-ala-bala-dala" | sed -E -e 's:^(\w+)\/([^-]*-[^-]*)-.*:\2:' -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'
FEATURE/444-ALA-BALA-DALA

Otherwise, it made me think about a lot of interesting things. Thank you.

Collapse
rafaelcpalmeida profile image
Rafael Almeida Author

Hey Saša,

It appears to be something wrong with your Terminal. Take a look at mine:

~/projects/git-hooks-templates  master ✔                                                                                                                                                                     11m  
▶ echo "feature/444-ala-bala-dala" | sed -E -e 's:^(\w+)\/([^-]*-[^-]*)-.*:\2:' -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'
444-ALA