git: change styling (whitespace) without changing ownership/blame?

后端 未结 5 988
面向向阳花
面向向阳花 2020-11-29 04:15

We have a massive, ancient codebase that needs a lot of cleanup. We have always had coding standards and everyone has always tried to follow them, but they were not enforced

5条回答
  •  遥遥无期
    2020-11-29 04:34

    I did a pull request to the TextMate git Bundle, to set this "-w" parameter by default for the "Browse Annoted File (Blame)" command. Thanks Mario Zaizar, you made my day.

    diff --git a/Support/lib/git.rb b/Support/lib/git.rb
    index 5e8de13..5192953 100644
    --- a/Support/lib/git.rb
    +++ b/Support/lib/git.rb
    @@ -307,6 +307,9 @@ module SCM
           file = make_local_path(file_path)
           args = [file]
           args << revision unless revision.nil? || revision.empty?
    +      # Ignore whitespace when comparing the parent's version and
    +      # the child's to find where the lines came from.
    +      args << '-w'
           output = command("annotate", *args)
           if output.match(/^fatal:/)
             puts output 
    

提交回复
热议问题