Skip to content
  • Denton Liu's avatar
    *.[ch]: remove extern from function declarations using sed · b199d714
    Denton Liu authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    There has been a push to remove extern from function declarations.
    Finish the job by removing all instances of "extern" for function
    declarations in headers using sed.
    
    This was done by running the following on my system with sed 4.2.2:
    
        $ git ls-files \*.{c,h} |
            grep -v ^compat/ |
            xargs sed -i'' -e 's/^\(\s*\)extern \([^(]*([^*]\)/\1\2/'
    
    Files under `compat/` are intentionally excluded as some are directly
    copied from external sources and we should avoid churning them as much
    as possible.
    
    Then, leftover instances of extern were found by running
    
        $ git grep -w -C3 extern \*.{c,h}
    
    and manually checking the output. No other instances were found.
    
    Note that the regex used specifically excludes function variables which
    _should_ be left as extern.
    
    Not the most elegant way to do it but it gets the job done.
    
    Signed-off-by: default avatarDenton Liu <liu.denton@gmail.com>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    b199d714