Skip to content

Commit

Permalink
git: Check in a script to auto-update copyright headers.
Browse files Browse the repository at this point in the history
Review URL: http://codereview.chromium.org/6878018

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81964 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
evan@chromium.org committed Apr 18, 2011
1 parent f9740e8 commit 30a5831
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tools/git/update-copyrights.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

tmp=$(mktemp)
trap "rm -f $tmp" EXIT
git diff --name-only $(git cl upstream)... | while read file; do
cp "$file" "$tmp"
# Rather than editing the temporary file, edit the original file in-place
# so that we preserve file modes.
sed -i -e '1,4s/Copyright .c. .* The Chromium Authors/Copyright (c) 2011 The Chromium Authors/' "$file"
if ! diff -q "$file" "$tmp" > /dev/null; then
echo "updated $file"
fi
done

0 comments on commit 30a5831

Please sign in to comment.