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)
Fri, Nov 8, 12:02 AM
Unknown Object (File)
Thu, Oct 31, 3:15 PM
Unknown Object (File)
Thu, Oct 31, 1:30 AM
Unknown Object (File)
Thu, Oct 31, 12:24 AM
Unknown Object (File)
Oct 22 2024, 9:41 PM
Unknown Object (File)
Oct 19 2024, 9:24 PM
Unknown Object (File)
Oct 18 2024, 7:12 PM
Unknown Object (File)
Oct 16 2024, 4:02 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
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.