New issue
Advanced search Search tips

Issue 767672 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Apr 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Feature

Blocked on:
issue 711127

Blocking:
issue 622551
issue 768828



Sign in to add a comment

Make a rebase tool for Blink source code move

Project Member Reported by tkent@chromium.org, Sep 22 2017

Issue description

We need a tool to rebase local branches of Chromium developers.

 

Comment 1 by dcheng@chromium.org, Sep 23 2017

Owner: dcheng@chromium.org
Status: Asss (was: Available)

Comment 2 by dcheng@chromium.org, Sep 23 2017

Blockedon: 711127
Status: Assigned (was: Asss)
I think it shouldn't be too hard to update the old script to do this.

Comment 3 by tkent@chromium.org, Sep 24 2017

How did the old script work?


Though I have no idea about what's the best way to rebase local branches, one idea is:

1. Produce a diff of a target branch
2. Adjust filename parts of the diff content

  diff --get a/foo/bar/... b/foo/bar/....
  index ...
  --- a/foo/bar/...
  +++ b/foo/bar/...

  Updates the "diff" line, "---" line, and "+++" line.

3. Re-patch the updated diff


If the branch touches #includes, it's likely that step3 causes patch rejection. Asking developers to fix such rejection manually would be acceptable?

Comment 4 by tkent@chromium.org, Sep 26 2017

Blocking: 768828
...and https://codereview.chromium.org/2356933002/ which for some reason isn't mentioned on that bug
Components: Blink
Components: -Blink Tools
Same comment as before regarding correct component. Could be Blink with a note to not add specific component if the Tools team objects to owning this.

Comment 10 by tkent@chromium.org, Jan 16 2018

It takes 94 minutes to complete move_blink_source.py with SSD Mac Pro. If we apply the same way as blink_rename_merge_helper, rebasing a single local branch would take 94 minutes, right?

Comment 11 by tkent@chromium.org, Jan 18 2018

> rebasing a single local branch would take 94 minutes

It seems we don't need to apply move_blink_source.py to the whole repository in a local branch.

Suppose that move_blink_source.py ran against 'master', and we want to rebase a 'local-branch' on 'master'.

1. Checkout 'local-branch'
2. Apply move_blink_source.py ONLY to files which 'local-branch' modified
3. Squash 'local-branch' to a single commit
4. git rebase master local-branch

In my manual testing, this worked well though #include blocks always had conflict.
This way reduces the number of 'git mv' significantly.
Project Member

Comment 12 by bugdroid1@chromium.org, Jan 21 2018

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

commit 43b614c6861c15648daec69d626ae1750c46d696
Author: Kent Tamura <tkent@chromium.org>
Date: Sun Jan 21 23:57:50 2018

move_blink_source.py: Introduce "fixbranch" command

The command helps developers to rebase their local branches on
the Great Blink mv.

- Adds "fixbranch" command
- Retrieve local change status

Bug:  767672 
Change-Id: Ie973837756449e285910e62c5a189d83e84105d4
Reviewed-on: https://chromium-review.googlesource.com/875526
Commit-Queue: Kent Tamura <tkent@chromium.org>
Reviewed-by: Quinten Yearsley <qyearsley@chromium.org>
Cr-Commit-Position: refs/heads/master@{#530792}
[modify] https://crrev.com/43b614c6861c15648daec69d626ae1750c46d696/third_party/blink/tools/move_blink_source.py

Project Member

Comment 13 by bugdroid1@chromium.org, Jan 23 2018

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

commit ee35784f1bed41ca073b26c65fa296fd838388a3
Author: Kent Tamura <tkent@chromium.org>
Date: Tue Jan 23 04:12:18 2018

move_blink_source.py fixbranch: Apply move_blink_source's "update" and "move" steps to files with local modification.

Bug:  767672 
Change-Id: I567598efedaac22c184b5619d24af20bd27b7cce
Reviewed-on: https://chromium-review.googlesource.com/877986
Commit-Queue: Kent Tamura <tkent@chromium.org>
Reviewed-by: Quinten Yearsley <qyearsley@chromium.org>
Cr-Commit-Position: refs/heads/master@{#531153}
[modify] https://crrev.com/ee35784f1bed41ca073b26c65fa296fd838388a3/third_party/blink/tools/move_blink_source.py

Comment 14 by tkent@chromium.org, Jan 24 2018

I implemented something in move_blink_source.py.

Manual instruction would be:

% git rebase <commit-before-great-mv> <your-local-branch>
% ./third_party/blink/tools/move_blink_source.py fixbranch
% git rebase -i master <your-local-branch>
  Change 'pick' to 'squash' at lines other than the first line.
% git rm <new paths of files deleted in <your-local-branch> and moved by the Great mv>
Project Member

Comment 15 by bugdroid1@chromium.org, Apr 4 2018

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

commit bad7da0d9234e4aeb8ca9680215cc59eded1b4a6
Author: Kent Tamura <tkent@chromium.org>
Date: Wed Apr 04 01:32:59 2018

move_blink_source.py: Make it less verbose.

* Change the default log level from DEBUG to INFO
* Change some logs from info() to debug()
* Show "Update ..." log only if a file is actually updated.
* Remove a raw |print| statement.

Bug:  578345 ,  767672 
Change-Id: I6fa6e5f548cd48bf7bad38795db7f3828f045d61
Reviewed-on: https://chromium-review.googlesource.com/991340
Reviewed-by: Quinten Yearsley <qyearsley@chromium.org>
Commit-Queue: Kent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/master@{#547927}
[modify] https://crrev.com/bad7da0d9234e4aeb8ca9680215cc59eded1b4a6/third_party/blink/tools/move_blink_source.py

Cc: dcheng@chromium.org
Owner: tkent@chromium.org
Status: Fixed (was: Assigned)
Project Member

Comment 17 by bugdroid1@chromium.org, Apr 6 2018

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

commit 78f2e6831060fc853b401d10c3be1a47ee4812e4
Author: Kent Tamura <tkent@chromium.org>
Date: Fri Apr 06 02:01:13 2018

move_blink_source.py: Make Git workable on Windows

Git constructor needs platform= argument in order that git.bat works
well on Windows.

Bug:  767672 

Change-Id: I1be316cca2211f99a2113c4ef576b30132da8ae0
Reviewed-on: https://chromium-review.googlesource.com/997320
Commit-Queue: Kent Tamura <tkent@chromium.org>
Reviewed-by: Quinten Yearsley <qyearsley@chromium.org>
Cr-Commit-Position: refs/heads/master@{#548639}
[modify] https://crrev.com/78f2e6831060fc853b401d10c3be1a47ee4812e4/third_party/blink/tools/move_blink_source.py

Project Member

Comment 18 by bugdroid1@chromium.org, Apr 6 2018

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

commit 2050d71b0b5731fa3d0cc645845d889cbbe600dd
Author: Kent Tamura <tkent@chromium.org>
Date: Fri Apr 06 02:02:36 2018

move_blink_source.py: Avoid "Regular expression code size limit exceeded" on Windows

_basename_re and _checked_in_header_re were too large to work on Windows
Python. Split them into small chunks.

Bug:  767672 
Change-Id: Ic283face324253a6d3104067237e1f41244375cf
Reviewed-on: https://chromium-review.googlesource.com/997198
Reviewed-by: Quinten Yearsley <qyearsley@chromium.org>
Commit-Queue: Kent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/master@{#548640}
[modify] https://crrev.com/2050d71b0b5731fa3d0cc645845d889cbbe600dd/third_party/blink/tools/move_blink_source.py

Sign in to add a comment