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
F18677839: D13983.diff
Thu, Sep 25, 9:31 PM
F18630976: D13983.id33751.diff
Tue, Sep 16, 1:50 PM
F18506360: D13983.id.diff
Sep 5 2025, 1:24 AM
F18498966: D13983.diff
Sep 4 2025, 7:13 PM
F18475917: D13983.id33737.diff
Sep 3 2025, 12:01 AM
F18266031: D13983.id33751.diff
Aug 22 2025, 12:30 PM
F18266029: D13983.id33737.diff
Aug 22 2025, 12:30 PM
F18085118: D13983.id.diff
Aug 5 2025, 7:01 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