Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(756)

Issue 8390055: Lets you run sort-headers.py on all files changed since some git branch. (Closed)

Created:
9 years, 1 month ago by Jói
Modified:
9 years, 1 month ago
CC:
chromium-reviews, pam+watch_chromium.org
Base URL:
http://git.chromium.org/chromium/src.git@master
Visibility:
Public.

Description

Adds a tool that lets you run a command for each modified file on your git branch or in your workspace. Also, add a flag to sort-headers.py to make it more useful when used in conjunction with that tool, that suppresses the y/N prompt after each diff (as vetting a bulk change may be easier once it's in your working directory, using your favorite diff tool). Refactor the script slightly while I'm in there. BUG=none TEST=none Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=108097

Patch Set 1 #

Total comments: 2

Patch Set 2 : Change -q / --quiet to -f / --force #

Patch Set 3 : Make two files per Nico's suggestion. #

Patch Set 4 : Remove unneeded import. #

Total comments: 11

Patch Set 5 : Address final review comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+151 lines, -24 lines) Patch
A tools/git/for-all-touched-files.py View 1 2 3 4 1 chunk +114 lines, -0 lines 0 comments Download
M tools/sort-headers.py View 1 2 3 4 2 chunks +37 lines, -24 lines 0 comments Download

Messages

Total messages: 10 (0 generated)
Jói
9 years, 1 month ago (2011-10-26 17:38:13 UTC) #1
Nico
The -f/-q change is fine. Can't the rest be done much simpler with tools/sort-headers.py $(git ...
9 years, 1 month ago (2011-10-26 17:53:38 UTC) #2
Jói
That's clever, and you could probably make something like that work. (I guess --name-only would ...
9 years, 1 month ago (2011-10-26 19:27:43 UTC) #3
Jói
New version updated, PTAL. 2011/10/26 Jói Sigurðsson <joi@chromium.org>: > That's clever, and you could probably ...
9 years, 1 month ago (2011-10-26 20:05:48 UTC) #4
Jói
ping 2011/10/26 Jói Sigurðsson <joi@chromium.org>: > New version updated, PTAL. > > 2011/10/26 Jói Sigurðsson ...
9 years, 1 month ago (2011-10-27 17:20:09 UTC) #5
Nico
On 2011/10/26 19:27:43, Jói wrote: > That's clever, and you could probably make something like ...
9 years, 1 month ago (2011-10-27 17:55:07 UTC) #6
Jói
> How about putting the git-walking code into > tools/git/for-all-touched-files.py? I like that idea, will ...
9 years, 1 month ago (2011-10-28 10:35:08 UTC) #7
Jói
Please take another look, I've split things up as discussed. Cheers, Jói On 2011/10/28 10:35:08, ...
9 years, 1 month ago (2011-10-31 18:13:03 UTC) #8
(unused - use chromium)
lgtm with comments addressed http://codereview.chromium.org/8390055/diff/13001/tools/git/for-all-touched-files.py File tools/git/for-all-touched-files.py (right): http://codereview.chromium.org/8390055/diff/13001/tools/git/for-all-touched-files.py#newcode50 tools/git/for-all-touched-files.py:50: def FilenamesFromGit(branch_name, extensions): needs docstring ...
9 years, 1 month ago (2011-10-31 18:19:56 UTC) #9
Jói
9 years, 1 month ago (2011-10-31 18:32:08 UTC) #10
http://codereview.chromium.org/8390055/diff/13001/tools/git/for-all-touched-f...
File tools/git/for-all-touched-files.py (right):

http://codereview.chromium.org/8390055/diff/13001/tools/git/for-all-touched-f...
tools/git/for-all-touched-files.py:50: def FilenamesFromGit(branch_name,
extensions):
On 2011/10/31 18:19:56, thakis wrote:
> needs docstring

Done.

http://codereview.chromium.org/8390055/diff/13001/tools/git/for-all-touched-f...
tools/git/for-all-touched-files.py:79: parser.add_option(
On 2011/10/31 18:19:56, thakis wrote:
> Format this like the other add_option() calls below?

Done.

http://codereview.chromium.org/8390055/diff/13001/tools/git/for-all-touched-f...
tools/git/for-all-touched-files.py:91: help=('Sets what to diff to (default
origin/master). Set '
On 2011/10/31 18:19:56, thakis wrote:
> nit: Since this is already in a function call, you don't need the parens
around
> the help string

Done.

http://codereview.chromium.org/8390055/diff/13001/tools/sort-headers.py
File tools/sort-headers.py (right):

http://codereview.chromium.org/8390055/diff/13001/tools/sort-headers.py#newcode8
tools/sort-headers.py:8: Shows a diff and prompts for confirmation before doing
the deed.
On 2011/10/31 18:19:56, thakis wrote:
> Maybe add "Works great with tools/git/for-all-touched-files.py" here?

Done.

http://codereview.chromium.org/8390055/diff/13001/tools/sort-headers.py#newco...
tools/sort-headers.py:74: def DiffAndConfirm(filename, should_confirm):
On 2011/10/31 18:19:56, thakis wrote:
> needs docstring

Done.

Powered by Google App Engine
This is Rietveld 408576698