New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 662584 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Dec 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Rebaseline-cl adds untracked files under LayoutTests directory

Project Member Reported by wangxianzhu@chromium.org, Nov 4 2016

Issue description

If there are some untracked files under LayoutTests directory (for local testing/debugging), webkit-patch rebaseline-cl will add them into the git index. The developer should manually remove them from git index to avoid them from being unexpectedly landed together with the CL.
 
Cc: dpranke@chromium.org wkorman@chromium.org
This was a trade-off made in http://crrev.com/2397573002 --

Previously, rebaseline would track all individual file changes made by separate rebaseline command processes, then aggregate them, then add them to the index individually.

In http://crrev.com//2397573002 I changed it so that none of this is tracked, and all changes in LayoutTests/ are added to the index after all rebaselining is done.

The advantage of that change was to reduce the complexity of the code, but the disadvantage was that other changes in LayoutTests would also be added to the index (probably unexpectedly).

wangxianzhu@, do you think this is OK? What do you think about only adding changes to the index that match a certain pattern (e.g. TestExpectations or -expected.{txt,png,wav})? This would still be simpler than tracking all changes across all rebaselining commands, but would be less likely to unexpectedly add files?
I like the simplicity too. I think an error message and quitting for untracked files under LayoutTests/ would suffice and additionally checking file name patterns would be perfect.
I agree, I think that sounds good too.
I also agree.
Seems good to me, too.
Status: Started (was: Assigned)
Project Member

Comment 7 by bugdroid1@chromium.org, Dec 28 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/99b0e4f3108df37cae3ed6664ca6f14b8a1fd056

commit 99b0e4f3108df37cae3ed6664ca6f14b8a1fd056
Author: qyearsley <qyearsley@chromium.org>
Date: Wed Dec 28 03:48:20 2016

Only add unstaged baseline changes to the git index when rebaselining.

Reason: Currently rebaseline-cl will add all files in LayoutTests/ to the index even if they are files unrelated to rebaseline-cl.

In this CL:
 - In git.py, add a method unstaged_changes() which just lists currently unstaged changes. There were already methods for listing files that are different from HEAD; that includes staged changes, but I believe we don't want to abort if there are already staged changes to baselines, right? If that's not the case, then this CL could potentially be made simpler.
 - In rebaseline.py, add a method unstaged_baselines(), which just lists unstaged changes to baselines. Additionally, when adding files after rebaselining, only add staged baselines to the git index, not other files.
 - In rebaseline_cl.py, add a check for unstaged baselines at the start and abort with an error message if there are any.

BUG= 662584 

Review-Url: https://codereview.chromium.org/2590693002
Cr-Commit-Position: refs/heads/master@{#440830}

[modify] https://crrev.com/99b0e4f3108df37cae3ed6664ca6f14b8a1fd056/third_party/WebKit/Tools/Scripts/webkitpy/common/checkout/scm/git.py
[modify] https://crrev.com/99b0e4f3108df37cae3ed6664ca6f14b8a1fd056/third_party/WebKit/Tools/Scripts/webkitpy/common/checkout/scm/scm.py
[modify] https://crrev.com/99b0e4f3108df37cae3ed6664ca6f14b8a1fd056/third_party/WebKit/Tools/Scripts/webkitpy/common/checkout/scm/scm_mock.py
[modify] https://crrev.com/99b0e4f3108df37cae3ed6664ca6f14b8a1fd056/third_party/WebKit/Tools/Scripts/webkitpy/common/checkout/scm/scm_unittest.py
[modify] https://crrev.com/99b0e4f3108df37cae3ed6664ca6f14b8a1fd056/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline.py
[modify] https://crrev.com/99b0e4f3108df37cae3ed6664ca6f14b8a1fd056/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_cl.py
[modify] https://crrev.com/99b0e4f3108df37cae3ed6664ca6f14b8a1fd056/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_cl_unittest.py
[modify] https://crrev.com/99b0e4f3108df37cae3ed6664ca6f14b8a1fd056/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py

Just committed the fix CL above, and then discovered that I never tried it on a branch with no changes :-/ Fix CL: https://codereview.chromium.org/2605933002
Status: Fixed (was: Started)
Just confirmed, this now appears to be fixed.

Sign in to add a comment