HomePhabricator

Make "arc land" great again

Description

Make "arc land" great again

Summary:
Ref T3855. Fixes T9537. Fixes T8620. Fixes T4333.

This declares bankruptcy and replaces the entire arc land workflow under Git. These are the notable changes:

  • (T3855) You can now land from a branch to itself.
  • (T3855) We now try to restore the original state very aggressively after any failure, instead of dumping you into the middle of a mess.
  • (T9537) You can now land without a local branch.
  • ([not actually] T9543) We'll now ignore the local branch if it just happens to be named the same thing as the remote branch but doesn't actually track it.
  • (T8620) You can now land from a detached HEAD.
  • (T4333) We now preserve the author and author date of whatever you land.

This may need some followup work. In particular:

  • The signal handler (that tries to put you in a better place if you ^C in the middle of things) causes ^C to work awkwardly in prompts. This might not be worth it.
  • Errors/instructions on push/merge issues might need work.
  • I dropped support for --delete-remote and --update-with-blah-blah because I think these flags aren't worth their complexity.
  • I've simplified the update/merge algorithm a bit. It may need some complexity added back in.
  • I probably missed a few things because this covers like 200 unique, creative workflows.
  • Users might need more guidance on the workflows that drop them in the middle of nowhere if they manage to reach them more often than I think.

Test Plan:

  • Used arc land to land like at least 15,000 different kinds of changes.
  • Landed normally.
  • Landed from a branch onto itself.
  • Landed from a detached head.
  • Landed nothing.
  • Landed with no local branch.
  • Landed onto made-up branches.
  • Landed with bad targets.
  • ^C'd things in the middle.

Reviewers: chad

Reviewed By: chad

Subscribers: tycho.tatitscheff

Maniphest Tasks: T3855, T4333, T8620, T9537, T9543

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