From 678efa44c62afad9353cf3a432773dd5927d961f Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 8 Aug 2012 12:58:27 -0700 Subject: [PATCH] Fix an issue where 'arc alias' reverses parameters Summary: We shove alias parameters onto the front of the arg list so if you make an alias like "qdiff" = "diff x y z" and then run "qdiff a b c", we end up with "diff x y z a b c". However, currently we reverse alias parameters, so you actually get "diff z y x a b c". This is a problem for `arc alias bdiff -- diff --background 1`, which evaluates to `arc diff 1 --background` and fails. Test Plan: Created a `bdiff` alias and ran it successfully. Reviewers: vrana, btrahan Reviewed By: btrahan CC: aran Differential Revision: https://secure.phabricator.com/D3196 --- src/workflow/ArcanistAliasWorkflow.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/workflow/ArcanistAliasWorkflow.php b/src/workflow/ArcanistAliasWorkflow.php index cc717339..8c2c5726 100644 --- a/src/workflow/ArcanistAliasWorkflow.php +++ b/src/workflow/ArcanistAliasWorkflow.php @@ -171,7 +171,7 @@ EOTEXT } $alias_argv = array_slice($aliases[$command], 1); - foreach ($alias_argv as $alias_arg) { + foreach (array_reverse($alias_argv) as $alias_arg) { if (!in_array($alias_arg, $argv)) { array_unshift($argv, $alias_arg); }