This reverts commit 80cc67cc00.
Reason for revert: Not +1'd by anyone from owning team.
Original change's description:
> Add --no-squash argument to git rebase-update
>
> --no-squash makes it faster to run rebase-update when there are merge
> conflicts and you know that squashing will not help. For example, I
> store all of my branches in one commit each, so I know that squashing
> isn't even possible because they are already squashed.
>
> Change-Id: I2679a855ad79d602a6d1ee09c140f2fd27ae20c5
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2904096
> Reviewed-by: Dirk Pranke <dpranke@google.com>
> Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
> Commit-Queue: Joey Arhar <jarhar@chromium.org>
Change-Id: I0b577b053a3e6c7514e28cde4cb7849f50ecd64f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4411905
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Joanna Wang <jojwang@chromium.org>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
--no-squash makes it faster to run rebase-update when there are merge
conflicts and you know that squashing will not help. For example, I
store all of my branches in one commit each, so I know that squashing
isn't even possible because they are already squashed.
Change-Id: I2679a855ad79d602a6d1ee09c140f2fd27ae20c5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2904096
Reviewed-by: Dirk Pranke <dpranke@google.com>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Joey Arhar <jarhar@chromium.org>
This spares an unnecessary git fetch.
Change-Id: I552148bdfadc3482bda0d71d75aaf9d9ed61d75d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4062088
Auto-Submit: Victor Vianna <victorvianna@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
I regularly run into this error for local branches corresponding to
merged CLs. Before, I had to manually type `git rebase --abort`
before copy-pasting the `git config branch.[...].dormant true` line
into my terminal. With this change, I can just copy-paste once to
execute both steps, then press up+up+enter to retry.
As a side benefit, Git newcomers won't have to look up how to abort
a rebase.
Anyone preferring the previous workflow can still elect to copy
just the `git config` line.
Bug: none
Change-Id: I516d4ed12c5111936cc65460ce119a43e5f86a8b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3570882
Auto-Submit: Chloe Pelling <cpelling@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
This reverts commit eff810e93d.
Reason for revert: breaks workflows for users
Original change's description:
> Error out of rebase-update if there are uncommitted changes
>
> Currently, running rebase-update may lead to missing untracked files.
> This change prints an error instead freezing and thawing local changes.
>
> Bug: 1251047
> Change-Id: Ia5f718ed957dae936d2ead2778760ae0c8d9f9ea
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3171828
> Commit-Queue: Gavin Mak <gavinmak@google.com>
> Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Bug: 1251047
Change-Id: I5b61dc1c7af13ccca6ea80baecff0522291083c9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3191674
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Gavin Mak <gavinmak@google.com>
Currently, running rebase-update may lead to missing untracked files.
This change prints an error instead freezing and thawing local changes.
Bug: 1251047
Change-Id: Ia5f718ed957dae936d2ead2778760ae0c8d9f9ea
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3171828
Commit-Queue: Gavin Mak <gavinmak@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
In theory this should prevent `git rebase-update` from invoking
potentially expensive `git gc` operations after every `git rebase`
(ideally once per branch, but sometimes as many as three per branch (!)).
This has outsized effects as the size of the repo or number of branches
increases, and additionally has penalties on Windows due to git's
POSIXey assumptions around how disk I/O works.
After doing all rebase stuff, we run `git gc --auto` from rebase-update
once (assuming we were successful; if the command failed then we don't
run gc at all).
R=apolito@google.com
Bug: 617218
Change-Id: I37a8f7953779f15b320e4ed7bb85119cb4bb665a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2868766
Auto-Submit: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
This reverts commit 4511b131e6.
Reason for revert: Broke git_rebase_update.py under Python3, which does
not support calling decode() on string objects.
Original change's description:
> Fix printing error on git-rebase failure
>
> R=ehmaldonado@chromium.org
>
> Bug: 1071280
> Change-Id: I8b1f00bb7c454297b10d5e047ae35c2686f69fb1
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2155154
> Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
> Commit-Queue: Josip Sokcevic <sokcevic@google.com>
TBR=ehmaldonado@chromium.org,infra-scoped@luci-project-accounts.iam.gserviceaccount.com,sokcevic@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: 1071280, 1073768
Change-Id: I58c1b24ba2aef255068c81be25475b2abbbf4fcb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2161111
Reviewed-by: Wez <wez@chromium.org>
Commit-Queue: Wez <wez@chromium.org>
1) The current behavior feels contrary to the documentation; which says
"If true, will cause rebase-update to skip all processing on the branch."
2) The new behavior allows a workflow where 'master' is empty and
marked dormant, but kept up to date as the parent for all other
branches.
Change-Id: Ic7440706a69753f796846dd84ecbf8bcf172ba4c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2128675
Auto-Submit: Dale Curtis <dalecurtis@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Ran:
vi $(git grep --name-only iteritems | grep -v third_party)
vi $(git grep --name-only itervalues | grep -v third_party)
vi $(git grep --name-only 'print ' | grep -v third_party)
and edited the files quickly with adhoc macros. Then ran in recipes/:
./recipes.py test train
There was only a small subset of files that had been updated to use
six.iteritems() and six.itervalues(). Since the dataset size that is
being used in gclient is small (pretty much always below 200 items),
it's better to just switch to .items() right away and take the temporary
performance hit, so that we don't need to come back to rewrite the code.
Recipe-Nontrivial-Roll: build
Bug: 984182
Change-Id: I5faf11486b66b0d73c9098ab0f2ce1b15a45c53e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1854900
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Auto-Submit: Marc-Antoine Ruel <maruel@chromium.org>
Ran "2to3 -w -n -f print ./" and manually added imports.
Ran "^\s*print " and "\s+print " to find batch/shell scripts, comments and the like with embedded code, and updated them manually.
Also manually added imports to files, which used print as a function, but were missing the import.
The scripts still work with Python 2.
There are no intended behaviour changes.
Bug: 942522
Change-Id: Id777e4d4df4adcdfdab1b18bde89f235ef491b9f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1595684
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Dirk Pranke <dpranke@chromium.org>
Auto-Submit: Raul Tambre <raul@tambre.ee>
Add a shortcut to extend the branches to be rebased with the current
branch without having to type its name.
Change-Id: If2fa117a6418590cdec5e65430f65dcdc825b611
Reviewed-on: https://chromium-review.googlesource.com/c/1483030
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
When calling `git rebase-update <branches>`, don't emit messages about
skipping branches which are not in the list of branches to be rebased.
R=iannucci@chromium.org
Change-Id: Ia5135d2e794646aaec68bca1aa64f4a73c98c186
Reviewed-on: https://chromium-review.googlesource.com/c/1476394
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
This change inserts a flush after "..." in lines like:
Failed! Attempting to squash mybranch ... Failed!
and:
Failed! Attempting to squash mybranch ... Success!
This way the user can follow the progress better and has an indication
of why the rebase is taking longer than they might expect.
Bug:
Change-Id: Ie04db2879fccd363d7b0f13b7a5217f1c13fd0e2
Reviewed-on: https://chromium-review.googlesource.com/737009
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Andrew Moylan <amoylan@chromium.org>
Through a comedy of wrapper scripts, the ^ is being swallowed, which
causes the `git config` invocation to match all lines which HAVE
"remote" in them, instead of matching lines which BEGIN with remote.
R=maruel@chromium.org, pkasting@chromium.org
BUG=
Review URL: https://codereview.chromium.org/1566343002
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@298185 0039d316-1c4b-4281-b951-d872f2087c98
This changes the 'empty' branch detection to compare the commit trees instead
of the commit hashes. This avoids empty-branch detection when you have multiple
renames on the branch that end up canceling eachother out. Previously you'd
end up with the rename-commits, in order, in your rebased branch, even though
when you run `git upstream-diff` you get nothing.
R=agable@chromium.org, jochen@chromium.org, vadimsh@chromium.org
BUG=438208
Review URL: https://codereview.chromium.org/1497313002
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@297849 0039d316-1c4b-4281-b951-d872f2087c98
Fix a bug that left branches tracking a dead branch if both their parent
and grand-parent were left with no changes after a "rebase-update" step.
Given the following initial state:
$ git map-branches -v
origin/master
a
b
c * [ ahead 1 ]
without this patch, a "git rebase-update" on this tree state would
leave the branch "c" as tracking a non-existing branch "a":
$ git recursive-rebase
a up-to-date
b up-to-date
c up-to-date
Reparented c to track a (was tracking b)
Deleted branch b (was 448d1da).
Deleted branch a (was 448d1da).
$ git map-branches -v
{a:GONE}
c *
with the patch, we record that the branch "c" is tracking must be
updated twice and we end up in a state were "c" is correctly tracking
"origin/master":
$ git recursive-rebase
a up-to-date
b up-to-date
c up-to-date
Reparented c to track origin/master (was tracking b)
Deleted branch b (was 448d1da).
Deleted branch a (was 448d1da).
$ git map-branches -v
origin/master
c * [ ahead 1 ]
BUG=456806
Review URL: https://codereview.chromium.org/1482753002
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@297792 0039d316-1c4b-4281-b951-d872f2087c98
* When aborting a failed rebase, don't cascade errors if the abort itself
fails.
* When starting a rebase-update cycle, cd to the root of the repo. This avoids
an issue when you run rebase-update from inside of a branch which adds a
new folder.
R=agable@chromium.org
BUG=499031
Review URL: https://codereview.chromium.org/1180673003
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@295637 0039d316-1c4b-4281-b951-d872f2087c98
Handle KeyboardInterrupt gracefully rather the printing a
backtrace. Most users of these tools don't expect a
backtrace when then hit Ctrl-C.
Also, fix a few other inconsistencies found in the python
startup code of these different scripts:
- always call main function 'main' (rather than 'Main')
- always return 0 from main function
- if main takes args never include argv[0]
Review URL: https://codereview.chromium.org/955993006
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@294250 0039d316-1c4b-4281-b951-d872f2087c98
Previously we just added an assert here but better
to simply succeed in this case, while outputting
the intial failure message.
BUG=425696
Review URL: https://codereview.chromium.org/667793005
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@292687 0039d316-1c4b-4281-b951-d872f2087c98
Don't discard stderr from failed rebase operations
I had an issue where stdout of the failed rebase was
empty but stderr contained:
First, rewinding head to replay your work on top of it...
Dirty index: cannot apply patches (dirty: internal_gyp
third_party/html_office).
Also, in my case the second rebase was actually succeeding
for some reason, which is clearly no expected, so assert
in this case.
BUG=410339
Review URL: https://codereview.chromium.org/645763002
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@292444 0039d316-1c4b-4281-b951-d872f2087c98
Some options have words separated by underscores. Added options with
same name and underscores replaced by hyphens.
BUG=400953
Review URL: https://codereview.chromium.org/436963005
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@288366 0039d316-1c4b-4281-b951-d872f2087c98
Previously a `[depot-tools "rebase-update"]` section would show up in the
.git/config on every `git rebase-update` cycle.
R=agable@chromium.org
BUG=
Review URL: https://codereview.chromium.org/228353003
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@263423 0039d316-1c4b-4281-b951-d872f2087c98
For some reason .output doesn't throw an AttributeError, but returns None ,
instead. .stdout is the correct attribute.
R=agable@chromium.org
BUG=
Review URL: https://codereview.chromium.org/212493003
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@259695 0039d316-1c4b-4281-b951-d872f2087c98
Somehow some (but not all) git helper scripts got the wrong interpreter. This
fixes them to use /usr/bin/env.
TBR=agable@chromium.org
BUG=
Review URL: https://codereview.chromium.org/212293002
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@259522 0039d316-1c4b-4281-b951-d872f2087c98
git-rebase-update - ensure all branches are up to date
git-new-branch - create branches
git-rename-branch - rename a branch while preserving parentage relationships
git-reparent-branch - change the parent of a branch, including rebasing it correctly onto that new parent.
git-squash-branch - collapse a branch into a single commit
git-upstream-diff - show the diff between the current branch and it's upstream branch
git-mark-merge-base - explicitly set what you want the above tools to consider the merge-base for the current branch.
R=agable@chromium.org, hinoka@chromium.org, stip@chromium.org, szager@chromium.org
BUG=261738
Review URL: https://codereview.chromium.org/184253003
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@259520 0039d316-1c4b-4281-b951-d872f2087c98