git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: David Rientjes <rientjes@google.com>
To: git@vger.kernel.org
Subject: Re: [PATCH] cleans up builtin-mv
Date: Thu, 17 Aug 2006 23:12:02 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.63.0608172301520.25827@chino.corp.google.com> (raw)
In-Reply-To: <Pine.LNX.4.63.0608172230470.25827@chino.corp.google.com>

On Thu, 17 Aug 2006, David Rientjes wrote:

> Cleans up builtin-mv by removing a needless check of source's length, 
> redefinition of source's length, and misuse of strlen call that was 
> already assigned.
> 

I'm not sure when this command had been added to the tree because it 
definitely was not included six months ago in a git tree I use everyday.  
It seems to me like this would more appropriately be handled by a simple 
shell script that would be much simpler to implement and could not 
possibly be slower than this implementation.

This patch is a small fraction of what could be changed in this 
implementation and I don't doubt it will undergo a complete rewrite in the 
future.  I think the problems with it have compounded on top of itself 
over time which doesn't make a lot of sense since it appears to be a 
relatively new addition.

For example:
	(length = strlen(source[i])) >= 0

was _completely_ unnecessary since the previous instruction was a call to 
lstat(source[i], ...) which would return ENOENT if source[i] was empty.  
strlen(source[i]) was assigned to a variable later in the function, this 
time called "len" instead.  There was also an additional call to 
strlen(source[i]) on its own even though the len variable was within 
scope.

This code is _utterly_ unsatisfactory.

		David

  reply	other threads:[~2006-08-18  6:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-18  5:59 [PATCH] cleans up builtin-mv David Rientjes
2006-08-18  6:12 ` David Rientjes [this message]
2006-08-18  9:51   ` Johannes Schindelin
2006-08-18 17:07     ` David Rientjes
2006-08-18 18:35       ` Josef Weidendorfer
2006-08-18 19:01         ` David Rientjes
2006-08-18 19:33     ` Junio C Hamano
2006-08-19  1:26       ` Johannes Schindelin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.63.0608172301520.25827@chino.corp.google.com \
    --to=rientjes@google.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).