git diff with line numbers and proper code alignment/indentation

后端 未结 2 1881
庸人自扰
庸人自扰 2020-12-20 08:32

I obtained this code sample from someone else here:

  git diff --color=always | \\
    gawk \'{bare=$0;gsub(\"\\033[[][0-9]*m\",\"\",bare)};\\
      match(ba         


        
2条回答
  •  天命终不由人
    2020-12-20 09:35

    It should be a minor typo (most likely) because printf() in awk expects a , after the format specifiers

    printf "-%-8s:", left++ line
    #             ^^^
    

提交回复
热议问题