1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-14 02:42:40 +01:00
phorge-phorge/scripts
epriestley ff8b48979e Simplify Repository remote and local command construction
Summary:
This cleans up some garbage:

  - We were specifying environmental variables with `X=y git ...`, but now have `setEnv()` on both `ExecFuture` and `PhutilExecPassthru`. Use `setEnv()`.
  - We were specifying the working directory with `(cd %s && git ...)`, but now have `setCWD()` on both `ExecFuture` and `PhutilExecPassthru`. Use `setCWD()`.
  - We were specifying the Git credentials with `ssh-agent -c (ssh-add ... && git ...)`. We can do this more cleanly with `GIT_SSH`. Use `GIT_SSH`.
  - Since we have to write a script for `GIT_SSH` anyway, use the same script for Subversion and Mercurial.

This fixes two specific issues:

  - Previously, we were not able to set `-o StrictHostKeyChecking=no` on Git commands, so the first time you cloned a git repo the daemons would generally prompt you to add `github.com` or whatever to `known_hosts`. Since this was non-interactive, things would mysteriously hang, in effect. With `GIT_SSH`, we can specify the flag, reducing the number of ways things can go wrong.
  - This adds `LANG=C`, which probably (?) forces the language to English for all commands. Apparently you need to install special language packs or something, so I don't know that this actually works, but at least two users with non-English languages have claimed it does (see <https://github.com/facebook/arcanist/pull/114> for a similar issue in Arcanist).

At some point in the future I might want to combine the Arcanist code for command execution with the Phabricator code for command execution (they share some stuff like LANG and HGPLAIN). However, credential management is kind of messy, so I'm adopting a "wait and see" approach for now. I expect to split this at least somewhat in the future, for Drydock/Automerge if nothing else.

Also I'm not sure if we use the passthru stuff at all anymore, I may just be able to delete that. I'll check in a future diff.

Test Plan: Browsed and pulled Git, Subversion and Mercurial repositories.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2230

Differential Revision: https://secure.phabricator.com/D7600
2013-11-20 10:41:35 -08:00
..
aphront Delete license headers from files 2012-11-05 11:16:51 -08:00
cache Provide 'bin/cache', for managing caches 2013-05-20 10:16:35 -07:00
calendar Increment year. 2013-01-03 05:45:08 -08:00
celerity Projects Icons Series 1 2013-10-12 19:15:38 -07:00
daemon Add bin/phd log <id> to dump all logs to the CLI 2013-07-23 16:58:19 -07:00
differential Add DifferentialDiffQuery and change most callsites 2013-07-01 12:38:42 -07:00
diviner Port Diviner Core to Phabricator 2013-01-07 14:04:23 -08:00
drydock Allow leases to be explicitly released via web or CLI 2012-12-14 15:42:58 -08:00
fact Delete license headers from files 2012-11-05 11:16:51 -08:00
files Add a bin/files purge workflow 2013-05-29 06:28:57 -07:00
fpm Delete license headers from files 2012-11-05 11:16:51 -08:00
install Simplify the "update_phabricator.sh" script 2013-02-14 07:22:43 -08:00
lipsum First Diff of Test Data Generator 2013-04-12 14:07:16 -07:00
mail Move outbound mail lists to CLI and enhance details 2013-07-10 18:52:22 -07:00
profile Delete license headers from files 2012-11-05 11:16:51 -08:00
repository Add bin/repository edit for CLI repository editing 2013-11-13 11:26:05 -08:00
search Provide 'bin/cache', for managing caches 2013-05-20 10:16:35 -07:00
setup Add bin/policy unlock 2013-10-01 16:01:15 -07:00
sql Add explicit mysql.port configuration 2013-07-14 16:06:23 -07:00
ssh Simplify Repository remote and local command construction 2013-11-20 10:41:35 -08:00
symbols Bugfix for D7596 2013-11-17 20:19:49 -08:00
user Implement an approval queue 2013-11-13 11:24:56 -08:00
util Provide 'bin/cache', for managing caches 2013-05-20 10:16:35 -07:00
__init_script__.php Consolidate environmental initialization 2012-12-25 06:15:28 -08:00
celerity_mapper.php PHUIPropertyListView 2013-10-11 07:53:56 -07:00