Commit Graph

20 Commits (e866182f33a6ffe721e6b5c3232a1df485523733)

Author SHA1 Message Date
anatoly techtonik 222840fb5f Show colored explanation in git map-branches -h
Bug:

Change-Id: Ie624d20ecff2afd274043620fbb2edcbcee857c6
Reviewed-on: https://chromium-review.googlesource.com/476670
Commit-Queue: anatoly techtonik <techtonik@gmail.com>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
8 years ago
techtonik 2e24812dd3 map-branches: Fix crash with --show-subject when branch name matches files
Traceback (most recent call last):
  ...
  File "...\\git_map_branches.py", line 303, in main
    mapper.start()
  File "...\\git_map_branches.py", line 169, in start
    self.__append_branch(root)
  File "...\\git_map_branches.py", line 272, in __append_branch
    self.__append_branch(child, depth=depth + 1)
  File "...\\git_map_branches.py", line 267, in __append_branch
    line.append(run('log', '-n1', '--format=%s', branch))
  File "...\git_common.py", line 599, in run
    return run_with_stderr(*cmd, **kwargs)[0]
  File "...\git_common.py", line 668, in run_with_stderr
    raise subprocess2.CalledProcessError(retcode, cmd, os.getcwd(), ret, err)
subprocess2.CalledProcessError: Command '...\\git.bat -c color.ui=never log -n1 --format=%s readme' returned non-zero exit status 128 in ...
fatal: ambiguous argument 'readme': both revision and filename
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

BUG=

Review-Url: https://codereview.chromium.org/2153803002
9 years ago
asanka 97f3949a4d [git-map-branches] Show CL status verbatim.
git-map-branches -v -v -v currently indicates the status of the CL using
a color. This change adds the status string alongside the CL to match
the output of 'git-cl status'.

  $ git map-branches -v -v -v

Before:
  A        354ccf6 [ ahead 1 ] https://codereview...
    B      e701150 [ ahead 1 ] https://codereview...
      C *  094cedd [ ahead 1 ] https://codereview...

After:
  A        354ccf6 [ ahead 1 ] https://codereview... (commit)
    B      e701150 [ ahead 1 ] https://codereview... (lgtm)
      C *  094cedd [ ahead 1 ] https://codereview... (waiting)

R=dpranke@chromium.org
BUG=none

Review-Url: https://codereview.chromium.org/2138703003
9 years ago
clemensh@chromium.org cbd7dc3ce5 Use CLs more consistently instead of branch names
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=300132

Review-Url: https://codereview.chromium.org/1893563002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@300673 0039d316-1c4b-4281-b951-d872f2087c98
9 years ago
iannucci@chromium.org 596cd5c95d Fix coloring madness in depot_tools.
'setup_color' now contains logic to correctly detect:
  * cmd
  * cmd pipe
  * msys bash
  * msys pipe
  * cmd running inside msys bash (git-command)
  * cmd pipe running inside msys bash (git-command > outfile)

R=brucedawson@chromium.org, dnj@chromium.org
BUG=600049

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@299682 0039d316-1c4b-4281-b951-d872f2087c98
9 years ago
iannucci@chromium.org 0703ea2cc6 Multiple improvements to windows bash integration.
* `git bash` helper now will either:
    * launch an interactive bash prompt in the MinGW Terminal Emulator
    * launch a non-interactive bash shell if arguments are provided
  * `git bash` now includes python, python/Scripts and svn binaries in
    the PATH.
  * depot_tools' colorization now works in MinGW Terminal Emulator
  * batch scripts are now regenerated if any of them is missing.

R=agable@chromium.org, dnj@chromium.org, mmoss@chromium.org
BUG=598956

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@299616 0039d316-1c4b-4281-b951-d872f2087c98
9 years ago
iannucci@chromium.org c0f8642119 Revert "Better tooling"
This reverts commit eed06d620f.

Accidental dcommit

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@299615 0039d316-1c4b-4281-b951-d872f2087c98
9 years ago
iannucci@chromium.org eed06d620f Better tooling
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@299614 0039d316-1c4b-4281-b951-d872f2087c98
9 years ago
jsbell@google.com 4f1fc3531c Don't highlight branches named 'origin-foo'
Logic for highlighting "origin/master" (etc) just looked for "origin"
as a prefix. Add the slash since "origin-foo" is a boring old valid
topic branch name.

R=iannucci@chromium.org, iannucci@google.com

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@299486 0039d316-1c4b-4281-b951-d872f2087c98
9 years ago
sdefresne@chromium.org 32f122f882 Fix "git cl map-branches -vvv"
CL https://codereview.chromium.org/1172223002 changed the meaning of the
third value in the tuple returned by get_cl_statuses from a color to the
status of the branch and broke the formatting of output.

Convert the status to the color using color_for_status helper function.

BUG=499189

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@295618 0039d316-1c4b-4281-b951-d872f2087c98
10 years ago
borenet@google.com 09156ec714 git map-branches: add --show-subject
BUG=

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@294578 0039d316-1c4b-4281-b951-d872f2087c98
10 years ago
calamity@chromium.org ffde55c519 Make git-map-branches -vvv show CL status colors.
This CL makes git-map-branches show CL status colors like git cl status
when -vvv is used. Statuses are fetched in parallel for speed.

BUG=379849

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@294414 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
calamity@chromium.org 4cd0a8b9d6 Fix map-branches issues and add coloring for 'branch-heads',
This CL fixes some issues with map-branches:
* Branches with no upstream were not being shown.
* -vv from a detached HEAD would crash
* GONE upstreams would crash when git cleaned up in a way that caused
  hash_one to fail

This CL also adds a blue coloring to branches that start with
'branch-heads' for Chromium release branches.

BUG=416530

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@292083 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
iannucci@chromium.org 4c82eb519a Fix git-map-branches crashing on HEAD, and other minor quality-of-life
improvements.

  * No longer crash on HEAD
  * Always correctly highlight lines based on hash-matching-ness
  * Only import git_cl if you want it (it can be slow)
  * Print a message when NO branches are found (instead of blank output)

R=calamity@chromium.org, jsbell@chromium.org
BUG=410353

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@291847 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
calamity@chromium.org 745ffa64a0 Skip tracking status in map-branches when -v flag is not supplied.
This CL prevents map-branches from loading the tracking status when
the -v flag is not supplied. This prevents the vanilla map-branches
from taking a potentially long time to retrieve the tracking status.

BUG=410137

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@291846 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
calamity@chromium.org 9d2c880e98 Give git map-branches extra information behind -v and -vv flags.
This CL adds information to the git map-branches command. Invoking 
it map-branches with -v, will show tracking status of branches and
invoking with -vv will additionally show the Rietveld URL and the
branch hash.

BUG=None

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@291776 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
iannucci@chromium.org a112f03fcf Fix git_nav_downstream.py when origin/master is checked out.
Also fix missing copyright notices.

R=agable@chromium.org
BUG=261738

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@256777 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
iannucci@chromium.org 8bc9b5c101 Add git-map and git-map-branches to depot_tools.
git-map: Show your local repo's history in a pseudo-graphical format from the command line.

git-map-branches: Show the topology of all of your branches, and their upstream relationships.

git-nav-upstream: Navigate (checkout) to the upstream branch of the current branch.

git-nav-downstream: Navigate (checkout) to a downstream branch of the current branch. If there's more than one downstream branch, then present a menu to select which one you want.

R=agable@chromium.org, hinoka@chromium.org, stip@chromium.org, szager@chromium.org
BUG=

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@256384 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago