[PATCH] Fix the build for git repositories with multiple remotes.

Daniel Sanders daniel.sanders at imgtec.com
Fri Sep 13 02:43:03 PDT 2013


  Changed the behaviour of multi-remote git repositories to report the first
  remote in the version string instead of all of them.

  I've found the code that chops up the URL and I agree that it's expecting a
  single subversion URL. That said, the problems that would affect multi-remote
  git repositories with the previous version of this patch also affect
  single-remote repositories. For example, the first match (if any) of 'cfe/' is
  removed from the clang URL. This is fine for svn but would result in an
  unusable URL for git.

  It occured to me that we should prefer the 'origin' remote if it exists.
  'origin' usually (it's a convention but its the default) represents the remote
  used in a 'git clone' command. Do you agree?

Hi jordan_rose,

http://llvm-reviews.chandlerc.com/D1659

CHANGE SINCE LAST DIFF
  http://llvm-reviews.chandlerc.com/D1659?vs=4228&id=4272#toc

Files:
  utils/GetRepositoryPath

Index: utils/GetRepositoryPath
===================================================================
--- utils/GetRepositoryPath
+++ utils/GetRepositoryPath
@@ -19,7 +19,7 @@
 elif [ -f .git/svn/.metadata ]; then
   git svn info | grep 'URL:' | cut -d: -f2-
 elif [ -d .git ]; then
-  git remote -v | grep 'fetch' | awk '{ print $2 }'
+  git remote -v | grep 'fetch' | awk '{ print $2 }' | head -n1
 else
   exit 1;
 fi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D1659.2.patch
Type: text/x-patch
Size: 418 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130913/f010e5ff/attachment.bin>


More information about the llvm-commits mailing list