Page MenuHomePhabricator

Avoid parsing git "remote show" using "ls-remote"
ClosedPublic

Authored by jbeta on Aug 24 2015, 12:19 AM.
Tags
None
Referenced Files
F15530339: D13983.id33751.diff
Wed, Apr 23, 3:22 AM
F15530338: D13983.id33737.diff
Wed, Apr 23, 3:22 AM
F15530337: D13983.id.diff
Wed, Apr 23, 3:22 AM
F15530336: D13983.diff
Wed, Apr 23, 3:22 AM
F15519747: D13983.id33767.diff
Sat, Apr 19, 11:43 PM
F15519746: D13983.id33751.diff
Sat, Apr 19, 11:43 PM
F15519745: D13983.id33737.diff
Sat, Apr 19, 11:43 PM
F15519744: D13983.id.diff
Sat, Apr 19, 11:43 PM
Tokens
"Like" token, awarded by johnny-bit.

Details

Summary

Ref T5554. This makes git remote URL detection locale-agnostic.

The previously suggested git config remote.origin.url command does
almost the same, but does not support the URL rewriting features in
git-config (url.<base>.insteadOf).

This one does, although it has the unintuitive behavior of just printing
the passed remote name when the remote does not exist, or even when
called outside a git repo.

Test Plan
  • Switched to non-english locale in which git has a translation.
  • Ran arc which on the Arcanist repo. It could not determine the remote URI.
  • Applied patch, arc which found the URI.

Diff Detail

Repository
rARC Arcanist
Branch
dont-parse-git-remote
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 7747
Build 8526: [Placeholder Plan] Wait for 30 Seconds
Build 8525: arc lint + arc unit

Event Timeline

jbeta retitled this revision from to Avoid parsing git "remote show" using "ls-remote".
jbeta updated this object.
jbeta edited the test plan for this revision. (Show Details)
jbeta added a reviewer: epriestley.
jbeta updated this object.
jbeta edited edge metadata.
  • Keep previous behavior in the case where origin does not exist.
This revision is now accepted and ready to land.Aug 24 2015, 11:50 AM
This revision was automatically updated to reflect the committed changes.

This breaks on users running in RHEL6 as git version there is 1.7.1 and that does not support --get-url option for ls-remote