Re: Hacks for AIX

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Chris Cowan <chris.o.cowan@...>
Cc: <git@...>
Date: Wednesday, July 16, 2008 - 2:26 pm

On Wed, 16 Jul 2008, Chris Cowan wrote:

The grep selection at compile time is purely a choice between "no external 
grep at all" and "whatever external grep is in $PATH".

exec_grep() literally does

	..
	pid = fork();
	if (pid < 0)
		return pid;
	if (!pid) {
		execvp("grep", (char **) argv);
		exit(255);
	}
	..

so you can choose your version of external grep at run-time by just 
setting PATH appropriately.

Or you can just decide that you don't want to use any external grep binary 
at all, which is the compile-time choice of NO_EXTERNAL_GREP. In that 
case, git will do the grep implementation all internally. It can do so, 
but then it relies on the regex() library which is often less optimized 
than the external grep.

Note the "often". It's possible that the external grep is never worth it, 
in which case you should use NO_EXTERNAL_GREP. GNU grep happens to be very 
good.

Even with an external grep configured in, you'll end up using the internal 
one for the case where you ask for the index information ("--cached") or 
when you ask for a particular version of the tree rather than the 
checked-out tree. So regardless, you'll fall back to the internal version 
for some things.

			Linus
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Hacks for AIX, Chris Cowan, (Wed Jul 16, 1:57 pm)
Re: Hacks for AIX, Linus Torvalds, (Wed Jul 16, 2:26 pm)
Re: Hacks for AIX, Junio C Hamano, (Wed Jul 16, 2:25 pm)
Re: Hacks for AIX, Junio C Hamano, (Sun Jul 20, 4:33 am)
Re: Hacks for AIX, Brandon Casey, (Mon Jul 21, 11:39 am)
Re: Hacks for AIX, Brandon Casey, (Tue Jul 22, 5:42 pm)
Re: Hacks for AIX, Brandon Casey, (Fri Jul 18, 7:14 pm)