Page MenuHomePhabricator

Use $EDITOR to prompt users when creating a new commit out of dirty working copy changes
ClosedPublic

Authored by epriestley on Feb 21 2015, 12:38 AM.

Details

Summary

Fixes T7344.
Currently, we use phutil_console_prompt(), which isn't a very good editor. Use the real $EDITOR instead.

100% of the logic here was also a gigantic mess. Clean it up.

Test Plan

Will update in a second with console output from this run.

Diff Detail

Repository
rARC Arcanist
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

epriestley retitled this revision from to Use $EDITOR to prompt users when creating a new commit out of dirty working copy changes.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added a reviewer: btrahan.

Here's an example run of the new logic:

When I answered "y" to the first prompt on a previous run (with no local commit), it popped $EDITOR properly.

This might be a little hard to follow, but the old logic was like:

do stuff for untracked files;
do weird magic;
do stuff for unstaged files;
more weird magic;
do stuff for uncommitted files;
all weird magic conspires;

New logic is more like:

tell the user about all the problems;
do weird magic
src/workflow/ArcanistWorkflow.php
1055

This fixes a small bug introduced in D11667, see note there.

btrahan edited edge metadata.
This revision is now accepted and ready to land.Feb 21 2015, 4:26 AM
This revision was automatically updated to reflect the committed changes.