If the base commit for `arc patch` does not exist locally, try to fetch it

Authored by alexmv on May 18 2017, 4:09 PM.

Description

If the base commit for arc patch does not exist locally, try to fetch it

Summary:
If the commit does not exist locally, aborting still leaves
the user checked out on the branch. In nearly all cases, all that is
necessary is a fetch -- but the branch must also be cleaned up. This
leads to the pattern of:

arc patch D12345
[...base commit does not exist...]
^C
git checkout master
git branch -D arcpatch-D12345
git fetch
arc patch D12345

Solve this common problem by simply trying to fetch once if the commit does not
exist locally.

Test Plan: Ran arc patch on a recent diff.

Reviewers: Blessed Reviewers, epriestley

Reviewed By: Blessed Reviewers, epriestley

Subscribers: epriestley

Differential Revision: https://secure.phabricator.com/D17949

Details

Committed
alexmvMay 18 2017, 5:13 PM
Pushed
alexmvMay 18 2017, 5:13 PM
Reviewer
Blessed Reviewers
Differential Revision
D17949: If the base commit for `arc patch` does not exist locally, try to fetch it
Parents
rARC3c4735795a29: Detect trailing spaces and tabs
Branches
Unknown
Tags
Unknown
Build Status
Buildable 17082
Build 22844: Run Core Tests