#!/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

Check in a script to auto-update copyright headers.
git: Check in a script to auto-update copyright headers.

Review URL: http://codereview.chromium.org/6878018

git-svn-id: http://src.chromium.org/svn/trunk/src@81964 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

Former-commit-id: 6eedc7c3fe0d47aaf2c2c6b46d78905b77ef0a58