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
F18286376: D11843.diff
Sat, Aug 23, 6:27 AM
F18102204: D11843.id28547.diff
Sat, Aug 9, 7:07 PM
F18097290: D11843.id28541.diff
Fri, Aug 8, 12:43 PM
F18089703: D11843.diff
Wed, Aug 6, 12:03 PM
F18048426: D11843.diff
Sun, Aug 3, 1:34 PM
F17853166: D11843.id.diff
Jul 27 2025, 1:32 PM
F17837994: D11843.diff
Jul 26 2025, 6:03 PM
F17708089: D11843.id28541.diff
Jul 16 2025, 4:09 PM
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
Lint
Lint Not Applicable
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:

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
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.