system git vs MacPorts git for fetching source

Jason Swails jason.swails at gmail.com
Sun Oct 16 10:31:54 PDT 2011


On Sun, Oct 16, 2011 at 12:08 PM, Ryan Schmidt <ryandesign at macports.org>wrote:

> On Oct 16, 2011, at 10:40, Jason Swails wrote:
> > On Sun, Oct 16, 2011 at 11:18 AM, Adam Mercer wrote:
> >> Can't the MacPorts git be used in preference to the one supplied by
> Xcode?
> >
> > Can you simply rearrange PATH (so that `which git` returns
> /opt/local/bin/git rather than /usr/bin/git if it doesn't already), or is
> /usr/bin/git hard-coded into port somewhere? Also, since when has Apple
> started supplying git with Xcode?  Lion?
>
> MacPorts finds git and other utilities at configure time and hardcodes them
> into itself.
>

Into compiled files or scripts?  If it's the latter, sed -i would work to
hack the MacPorts files to force it to use /opt/local/bin/git.  If it's the
former, I've actually managed to use sed -i on compiled binaries to change a
hard-coded path successfully.  It'd be a more permanent fix than changing
"upstream" to "tracked", but still not ideal...


>
> I don't have a /usr/bin/git on my Snow Leopard system with Xcode 3.2.6 so
> I'd believe that Apple started shipping it in Lion. So on Lion, MacPorts
> will use /usr/bin/git (even if /opt/local/bin/git exists), and on Snow
> Leopard and earlier, MacPorts will use any git binary that exists in the
> binpath, installing the git port if necessary.
>

Another option (perhaps not ideal) is to just build new git by hand
specifying --prefix=/usr to overwrite Xcode's version.  Normally I'd be
hesitant to overwrite any system tools, but I think git does a very good job
of maintaining backwards compatibility with later versions (I've never had a
problem with it before across a whole range of versions from 1.5.x to now,
and I use git quite a bit on several different platforms).

All the best,
Jason

-- 
Jason M. Swails
Quantum Theory Project,
University of Florida
Ph.D. Candidate
352-392-4032
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-users/attachments/20111016/fc49c0ca/attachment.html>


More information about the macports-users mailing list