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
Unknown Object (File)
Fri, Dec 20, 5:28 PM
Unknown Object (File)
Tue, Dec 17, 3:12 AM
Unknown Object (File)
Tue, Dec 17, 1:39 AM
Unknown Object (File)
Thu, Dec 12, 8:33 PM
Unknown Object (File)
Sat, Dec 7, 4:11 AM
Unknown Object (File)
Fri, Dec 6, 4:06 AM
Unknown Object (File)
Nov 21 2024, 3:45 PM
Unknown Object (File)
Nov 16 2024, 6:36 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
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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