From: Junio C Hamano Date: Thu, 06 Mar 2008 23:08:47 GMT Subject: Re: [PATCH v3] git-clean: correct printing relative path Message-ID: <7vr6en8n7k.fsf@gitster.siamese.dyndns.org> In-Reply-To: <20080306174342.GA32364@dpotapov.dyndns.org> Dmitry Potapov writes: > When the given path contains '..' then git-clean incorrectly printed names > of files. This patch changes cmd_clean to use quote_path() from wt-status. I think making quote_path() available from outside is fine, but as a public function, quote_path() is grossly misnamed. It was an Ok name in the context of wt-status, where the sole kind of path quoting necessary was to show themrelative to the current working directory. As a general library, it needs much better name, perhaps quote_path_relative(), and it should move to quote.c, not staying in wt-status.c. The implementation of quote_path() also needs to be fixed. For one thing, it does not seem to honor core.quotepath configuration, and it also passes "\t" unquoted. I think rewriting the handcrafted loop to treat \n and \r specially should be yanked out and replaced with c_style_quote family of functions in quote.c