15d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#!/bin/bash
25d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)# Copyright (c) 2011 The Chromium Authors. All rights reserved.
35d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)# Use of this source code is governed by a BSD-style license that can be
45d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)# found in the LICENSE file.
55d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
65d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)# mass-rename: update source files (gyp lists, #includes) to reflect
75d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)# a rename.  Expects "git diff --cached -M" to list a bunch of renames.
85d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#
95d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)# To use:
105d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#   1) git mv foo1 bar1; git mv foo2 bar2; etc.
115d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#   2) *without committing*, ./tools/git/mass-rename.sh
125d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#   3) look at git diff (without --cached) to see what the damage is
135d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#   4) commit, then use tools/sort-headers.py to fix #include ordering:
145d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#   for f in $(git diff --name-only origin); do ./tools/sort-headers.py $f; done
155d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
165d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)DIR="$( cd "$( dirname "$0" )" && pwd )"
175d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)python $DIR/mass-rename.py "$*"
185d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)