git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] cleans up builtin-mv

From
JWJosef Weidendorfer <josef.weidendorfer@gmx.de>
Date
Aug 18, 2006, 18:35 UTC
Message-ID
<200608182035.47208.Josef.Weidendorfer@gmx.de>
In-Reply-To
<Pine.LNX.4.63.0608180956100.29405@chino.corp.google.com>
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.
Show 10 quoted lines
> > 	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
Previous: David RientjesNext: David Rientjes
Message 5 of 8 in “cleans up builtin-mv”
  1. cleans up builtin-mvDavid Rientjes, Aug 18, 2006
  2. David RientjesAug 18, 2006
  3. Johannes SchindelinAug 18, 2006
  4. David RientjesAug 18, 2006
  5. Josef WeidendorferAug 18, 2006
  6. David RientjesAug 18, 2006
  7. Junio C HamanoAug 18, 2006
  8. Johannes SchindelinAug 19, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.