I'm trying to add an alias command to my gitconfig file and it reports "bad config file" on the line I've added. I suspect it's something to do with the sed command and some escaping issues, but I don't know exactly what it's supposed to be. Here's the command, with linebreaks added for legibility:
impact = !git ls-files -z
       | xargs -0n1 git blame -w -C
       | sed -r 's/^[^(]+\((.*) [0-9]{4}-.*/\1/'
       | sed -r 's/ +$//'
       | sort -f
       | uniq -c
       | sort -nr
                I suspect it is more about the '\', which needs to be doubled.
I tried your alias with '\\' without any error message.
impact = !git ls-files -z
       | xargs -0n1 git blame -w -C
       | sed -r 's/^[^(]+\\((.*) [0-9]{4}-.*/\\1/'
       | sed -r 's/ +$//'
       | sort -f
       | uniq -c
       | sort -nr
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With