Re: [PATCH] cleans up builtin-mv

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Friday 18 August 2006 19:07, David Rientjes wrote:
> It shouldn't have ever been a perl script, it should have been /bin/sh.  
> Any shell implementation of this would be significantly faster than the 
> current implementation.

Can you explain your reasoning in more detail?
C compiles to native code. Bash itself first has to
parse the script. How on earth can this be faster than native code?

I simply do not understand this discussion about implementation language,
especially in this case where most of the work is probably done changing
git's index (the add's and rm's of tree entries). Of course it could have
been done in /bin/sh, but it wasn't (it started as git-rename.perl).

The portability argument speaks for C, thus I agree with Dscho.

> > 	if (!bad &&
> > 		(length = strlen(source[i])) >= 0 &&
> > 		!strncmp(destination[i], source[i], length) &&
> > 		(destination[i][length] == 0 || destination[i][length] == '/'))
> > 
> > construct. So, we assign the "length" variable only if we have to. And the 
> > ">= 0" trick is a common one. I could have done
> > 		
> 
> This is not a plausible justification _at all_.

Hmm... I suppose Dscho's argument was that this "... >=0" is a standard way
to code an assignment inside of an expression.

Josef
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]