mass-rename.sh 732 B

1234567891011121314151617
  1. #!/bin/bash
  2. # Copyright (c) 2011 The Chromium Authors. All rights reserved.
  3. # Use of this source code is governed by a BSD-style license that can be
  4. # found in the LICENSE file.
  5. # mass-rename: update source files (gyp lists, #includes) to reflect
  6. # a rename. Expects "git diff --cached -M" to list a bunch of renames.
  7. #
  8. # To use:
  9. # 1) git mv foo1 bar1; git mv foo2 bar2; etc.
  10. # 2) *without committing*, ./tools/git/mass-rename.sh
  11. # 3) look at git diff (without --cached) to see what the damage is
  12. # 4) commit, then use tools/sort-headers.py to fix #include ordering:
  13. # for f in $(git diff --name-only origin); do ./tools/sort-headers.py $f; done
  14. DIR="$( cd "$( dirname "$0" )" && pwd )"
  15. python $DIR/mass-rename.py "$*"