ledatelescope / bifrost

A stream processing framework for high-throughput applications.
BSD 3-Clause "New" or "Revised" License
64 stars 29 forks source link

Global copyright update #168

Closed league closed 2 years ago

league commented 2 years ago

Yay or nay? Figured out a sed one-liner:

sed -i 's/\(Copyright (c) 20[0-9]\{2\}\)\(-2020\)\?\(, .*Bifrost Authors.*\)/\1-2022\3/' **/*(.)

Though maybe **/*(.) is zsh-specific to match all regular files recursively. Could be converted to a find command. Or could just continue doing this whenever a file is touched, I guess.

jaycedowell commented 2 years ago

The approach that I was trying to use was to update the copyright line when I made a change. My thinking was that it would give me a quick way to see when a file was last updated. I'm not sure how well that actually works since it requires someone to remember to actually change it as part of an update. Plus, there is always the git history which is slightly more descriptive than a year.

league commented 2 years ago

Yeah that's sensible, I'd reach for git log FILENAME or git blame/annotate. Some time back, my emacs would find and update copyright dates on save, which would provide some automation for your approach, but I don't have that set up anymore.

I thought of this because some big project I was navigating recently would sometimes do commits labeled "tree-wide" where they'd run a sed or other filter across everything. Keep or close, it doesn't matter to me!