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.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Apr 13, 11:12 PM
Unknown Object (File)
Sat, Apr 13, 4:23 PM
Unknown Object (File)
Sat, Apr 13, 9:26 AM
Unknown Object (File)
Thu, Apr 11, 7:16 AM
Unknown Object (File)
Tue, Apr 9, 7:26 AM
Unknown Object (File)
Wed, Apr 3, 9:01 AM
Unknown Object (File)
Tue, Apr 2, 8:46 PM
Unknown Object (File)
Tue, Apr 2, 3:31 AM
Subscribers
Tokens
"Doubloon" token, awarded by btrahan.

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
Branch
eprompt
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 4591
Build 4605: [Placeholder Plan] Wait for 30 Seconds

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:

Screen_Shot_2015-02-20_at_4.38.41_PM.png (660×1 px, 88 KB)

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
1056

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.