Commit Graph

8 Commits (43d72759fed16f6666fa08efb54400ff7887fd9e)

Author SHA1 Message Date
Asanka Herath 53a115e67e Add a '--inject-current' option to 'git new-branch'
This option creates a new branch that sets itself as the upstream for
the current branch and adopts the current branch's upstream as its own.

What does it do?
----------------

Imagine we have the following set of branches (as `git map-branches -vv`
would show it):

  origin/master  00001111  [ ahead 1 ]
    foo          00002222  [ ahead 1 ]
      baz *      00003333  [ ahead 1 ]

'baz' is the current branch. If one were to issue the following command:

  $ git new-branch --inject-current bar

... then the branch layout will now look like this:

  origin/master  00001111  [ ahead 1 ]
    foo          00002222  [ ahead 1 ]
      bar *      00002222
        baz      00003333  [ ahead 1 ]

Why would you need this?
------------------------

When working on a single change or a sequence of changes organized into
dependent branches, this option lets you quickly create a new branch
with the correct upstreams so that you can peel off smaller cleanups and
potentially unrelated changes out of your main feature branch into
separate branches. These can then be uploaded as dependent CLs.

R=petermayo@chromium.org,iannucci@chromium.org

Change-Id: Id912f8e5c17e267fc52d74bdfac7bbcf87a50908
Reviewed-on: https://chromium-review.googlesource.com/987529
Commit-Queue: Asanka Herath <asanka@chromium.org>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
7 years ago
techtonik@gmail.com b14fccd608 Clarify how `new-branch` is different for --help
BUG=

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@300032 0039d316-1c4b-4281-b951-d872f2087c98
9 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
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
agable@chromium.org 9c0f85130e Add newline to git-new-branch output.
R=iannucci@chromium.org, pgervais@chromium.org

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@267616 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
pgervais@chromium.org 022d06ef61 git new-branch displays an explanatory line.
BUG=

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@266905 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