1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2025-01-07 21:31:01 +01:00
phorge-arcanist/src/workflow
epriestley 4a1160e0c3 When pushing changes to staging, also push the base commit
Summary:
Fixes T10509. Pushing changes to staging can be inefficient. What happens, roughly, is:

  - Master is at commit "W" -- "W" is the most recent published commit in the main repository.
  - The local working copy has one change on top of that, "X", so its history is commits "A, B, C, D, E, F, ..., U, V, W, X".
  - The remote has some other previous changes that I or other users have made, maybe like "A, B, C, ..., S, T, U, Y" and "A, B, C, ..., T, U, V, Z", from previous pushes to staging areas.
  - "X", "Y" and "Z" will never actually make it to master, because they'll be squash-merged/amended by `arc land`.

So the local says "I want to push 'X'", and the remote says "I know about 'Y' and 'Z', are those in the history of 'W'? You only need to send me new stuff if they are".

But they aren't, so the local says "nope, so here's the whole history for you". This is slow and sends a ton of data that the remote already has over the network.

In theory, Git could use a slightly different algorithm to tell the local about more commits, but this is hard, rarely useful, and not the kind of thing I'd be excited about changing if I was the Git upstream.

Instead, when pushing "X", also push "W", to trick Git into telling future clients about it.

Now, the remote should say "I know about 'W', 'Y' and 'Z'", and the local will say "oh, great, 'W' is in history, here's just the changes since then".

Also, fail `arc diff` if the push to staging fails, and tell users to use `--skip-staging`. This code has been in production for a while and doesn't seem to have any issues, and a failed push to staging prevents builds, lands, etc.

Test Plan:
  - Ran `arc diff`, saw two changes push.
  - Ran `arc diff --base arc:empty`, saw only one change push.
  - Ran `arc diff` with an intentionally broken staging area, saw an error.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10509

Differential Revision: https://secure.phabricator.com/D15424
2016-03-07 06:53:49 -08:00
..
exception pht all the things 2015-05-13 21:00:53 +10:00
ArcanistAliasWorkflow.php Tailor CLI feedback about "arc alias" to describe shell command aliases 2015-12-03 18:31:48 -08:00
ArcanistAmendWorkflow.php pht all the things 2015-05-13 21:00:53 +10:00
ArcanistAnoidWorkflow.php Don't explicitly name abstract base classes 2014-07-22 07:49:15 +10:00
ArcanistBackoutWorkflow.php Minor linter fix 2015-08-08 10:18:59 +10:00
ArcanistBookmarkWorkflow.php Minor linter fixes 2015-05-15 07:09:30 +10:00
ArcanistBranchWorkflow.php Minor linter fixes 2015-05-15 07:09:30 +10:00
ArcanistBrowseWorkflow.php Properly URL encode branches in arc browse --branch ... 2016-03-04 15:52:58 -08:00
ArcanistCallConduitWorkflow.php Use phutil_json_decode instead of json_decode 2015-05-04 22:36:14 +10:00
ArcanistCloseRevisionWorkflow.php pht all the things 2015-05-13 21:00:53 +10:00
ArcanistCloseWorkflow.php Use PhutilInvalidStateException 2015-06-18 22:41:30 +10:00
ArcanistCommitWorkflow.php Various translation improvements 2015-11-02 21:31:04 +11:00
ArcanistCoverWorkflow.php Various translation improvements 2015-11-02 21:31:04 +11:00
ArcanistDiffWorkflow.php When pushing changes to staging, also push the base commit 2016-03-07 06:53:49 -08:00
ArcanistDownloadWorkflow.php Fix some format strings 2015-05-25 21:24:40 +10:00
ArcanistExportWorkflow.php Remove call to "arcanist.projectinfo" from arc export 2015-05-25 18:31:09 +10:00
ArcanistFeatureWorkflow.php Improve arc's handling of dirty submodules in Git 2015-09-21 12:40:06 -07:00
ArcanistFlagWorkflow.php Linter fixes 2015-12-07 21:35:34 +11:00
ArcanistGetConfigWorkflow.php pht all the things 2015-05-13 21:00:53 +10:00
ArcanistHelpWorkflow.php phtize a bunch more strings 2015-05-22 17:09:56 +10:00
ArcanistInstallCertificateWorkflow.php Improve error handling in arc install-certificate 2015-11-27 09:05:50 -08:00
ArcanistLandWorkflow.php Clarify that "arc land" means it is merging changes, not branch refences 2015-12-12 10:25:12 -08:00
ArcanistLiberateWorkflow.php Minor linter fixes 2015-05-15 07:09:30 +10:00
ArcanistLintersWorkflow.php Add a table showing all XHPAST linter rules to the output of arc linters xhpast 2015-12-02 06:27:33 +11:00
ArcanistLintWorkflow.php Remove leftover code for "postponed" lint and unit status 2015-08-30 21:56:12 +10:00
ArcanistListWorkflow.php Improve arc's handling of dirty submodules in Git 2015-09-21 12:40:06 -07:00
ArcanistPasteWorkflow.php pht all the things 2015-05-13 21:00:53 +10:00
ArcanistPatchWorkflow.php Use "--whitespace nowarn" in arc patch to respect trailing whitespace 2015-12-17 17:36:26 -08:00
ArcanistPhrequentWorkflow.php Improve arc's handling of dirty submodules in Git 2015-09-21 12:40:06 -07:00
ArcanistRevertWorkflow.php pht all the things 2015-05-13 21:00:53 +10:00
ArcanistSetConfigWorkflow.php pht all the things 2015-05-13 21:00:53 +10:00
ArcanistShellCompleteWorkflow.php Fix arcanist shell completion 2015-06-19 13:15:44 +10:00
ArcanistStartWorkflow.php Minor tidying of ArcanistPhrequentWorkflow classes 2015-02-01 21:49:53 +11:00
ArcanistStopWorkflow.php Minor tidying of ArcanistPhrequentWorkflow classes 2015-02-01 21:49:53 +11:00
ArcanistTasksWorkflow.php Improve arc's handling of dirty submodules in Git 2015-09-21 12:40:06 -07:00
ArcanistTimeWorkflow.php Minor tidying of ArcanistPhrequentWorkflow classes 2015-02-01 21:49:53 +11:00
ArcanistTodoWorkflow.php pht all the things 2015-05-13 21:00:53 +10:00
ArcanistUnitWorkflow.php Remove arguments from unit test engines 2015-11-15 20:04:59 +00:00
ArcanistUpgradeWorkflow.php Improve two error handling behaviors in arc upgrade 2015-10-22 19:55:16 +00:00
ArcanistUploadWorkflow.php Various translation improvements 2015-11-02 21:31:04 +11:00
ArcanistVersionWorkflow.php pht all the things 2015-05-13 21:00:53 +10:00
ArcanistWhichWorkflow.php phtize a bunch more strings 2015-05-22 17:09:56 +10:00
ArcanistWorkflow.php Report unit test details from Arcanist to Harbormaster 2016-03-04 15:49:46 -08:00