Commit Graph

6 Commits (main)

Author SHA1 Message Date
Yiwei Zhang e0038c0721 print slightly better message if git nav-upstream is not called in git repo
Currently, the command will print following message twice when not called
in git repo.

```
fatal: not a git repository (or any parent up to mount point /google)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
```

Bug: 339231299
Change-Id: Iab05e037a81b7e15dcc011d78480cd9ace7c7e36
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5544438
Commit-Queue: Yiwei Zhang <yiwzhang@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
10 months ago
Leszek Swirski e989bb2b45 Make git-nav-upstream use the upstream branch name
The previous git-nav-upstream fix used the current branch name, and
stored the upstream move relative to that branch (in the reflog), e.g
nav-upstream from branch foo to origin/master would should foo@{u}.
This unfortunately breaks if the branch is then deleted, so now we
calculate the upstream branch before checking it out, by passing
"@{u}" rather than HEAD to rev-parse.

Change-Id: I14a2eb8493d63e8386e988fd68b8a3125f19ce2d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1536070
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
6 years ago
Leszek Swirski 33bd582224 Make git-nav-upstream include the current branch name
Using just @{u} to navigate upstream breaks navigating back down when
the upstream reaches a non-local branch, e.g. origin/master. This is
because git branch walks the reflog for detached heads, and sees @{u}
instead of e.g. origin/master, and so tries to calculate HEAD@{u}
which fails. See also the message send to the git mailing list:

https://public-inbox.org/git/CAGRskv__Qe-F-grBtq5v-uhHE+BQAcAcOQtX-GKB+MNOrxs0hQ@mail.gmail.com/

This patch works around this by manually specifying the branch from
which we are calculating upstream, e.g. for branch foo we do
git checkout foo@{u} instead of just git checkout @{u}. This ensures
that the reflog has a valid entry (albeit still a relative one).

Change-Id: I339d4e4288a1e104b9d7d3d568c45b2b156f0689
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1534217
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
6 years ago
agable@chromium.org 4f52c9e114 Remove useless comments from git bash wrappers.
R=iannucci@chromium.org

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@292379 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
r.c.ladan@gmail.com ec238db2ad Invoke the bash shell via /usr/bin/env so that these scripts run on operating systems without /bin/bash too.
TEST=run "git cl owners" on FreeBSD
BUG=

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

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