Commit Graph

16 Commits (29d5e56cd50def56bd97309becdf02c71eba04d5)

Author SHA1 Message Date
sdefresne@chromium.org d421f6a477 Fix "git rebase-update" when multiple branch are stale.
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
9 years ago
stip@chromium.org 74374f985f Add a --keep-going flag for people who run rebase-update infrequently.
Review URL: https://codereview.chromium.org/1331263002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@296639 0039d316-1c4b-4281-b951-d872f2087c98
10 years ago
iannucci@chromium.org 196809e75b Only chdir in rebase-update if there's a directory to go back to.
TBR=agable@chromium.org
BUG=499031

Review URL: https://codereview.chromium.org/1182713002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@295642 0039d316-1c4b-4281-b951-d872f2087c98
10 years ago
iannucci@chromium.org dabb78bfd5 Make git-rebase-update a bit more robust
* 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
10 years ago
sbc@chromium.org 013731e832 Handle KeyboardInterrupt consistently in python scripts
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
10 years ago
sbc@chromium.org 8b4900e77f Handle unusual case in rebase-update where second rebase attempt works.
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
10 years ago
sbc@chromium.org 384039b174 Improve error handling in git-rebase-update
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
11 years ago
asanka@chromium.org 4d2a66eeda Fix regexp used for enumerating remotes.
R=szager@chromium.org
BUG=413391

Review URL: https://codereview.chromium.org/598153003

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@292123 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
szager@chromium.org 937159d61a Fix logic for determing remote name from remote branch.
BUG=413391
R=iannucci@chromium.org,agable@chromium.org

Review URL: https://codereview.chromium.org/567873002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@292117 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
pgervais@chromium.org b9f2751b87 Added hyphen-only options
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
11 years ago
iannucci@chromium.org 43f4ecc65e Make git rebase-update more responsive.
Passes through git-fetch's output instead of buffering it.

R=djacques@chromium.org
TBR=agable@chromium.org
BUG=366375

Review URL: https://codereview.chromium.org/264423002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@269080 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
iannucci@chromium.org bf157b44ec Fix empty section appearing in git config for every rebase-update.
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
11 years ago
iannucci@chromium.org 512d97d412 Remember what branches we delete and do not try to reparent them in cleanup.
R=agable@chromium.org
BUG=357367

Review URL: https://codereview.chromium.org/214133006

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@260704 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
iannucci@chromium.org 56a624ac56 Fix the print of the rebase error message, and make the output prettier too.
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
11 years ago
iannucci@chromium.org 97231b5fb5 Fix bad interpreters.
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
11 years ago
iannucci@chromium.org c050a5b2be Add a family of git-commands to assist with the management of multiple CLs/branches.
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
11 years ago