From mboxrd@z Thu Jan 1 00:00:00 1970 From: Johannes Schindelin Subject: Re: builtin command's prefix question Date: Thu, 6 Dec 2007 15:48:02 +0000 (GMT) Message-ID: References: <7vlk88n648.fsf@gitster.siamese.dyndns.org> Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: Junio C Hamano , Git Mailing List To: Nguyen Thai Ngoc Duy X-From: git-owner@vger.kernel.org Thu Dec 06 16:49:12 2007 Return-path: Envelope-to: gcvg-git-2@gmane.org Received: from vger.kernel.org ([209.132.176.167]) by lo.gmane.org with esmtp (Exim 4.50) id 1J0IyC-00072j-S6 for gcvg-git-2@gmane.org; Thu, 06 Dec 2007 16:49:01 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752034AbXLFPsd (ORCPT ); Thu, 6 Dec 2007 10:48:33 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751733AbXLFPsd (ORCPT ); Thu, 6 Dec 2007 10:48:33 -0500 Received: from mail.gmx.net ([213.165.64.20]:53171 "HELO mail.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1751392AbXLFPsc (ORCPT ); Thu, 6 Dec 2007 10:48:32 -0500 Received: (qmail invoked by alias); 06 Dec 2007 15:48:30 -0000 Received: from unknown (EHLO [138.251.11.74]) [138.251.11.74] by mail.gmx.net (mp048) with SMTP; 06 Dec 2007 16:48:30 +0100 X-Authenticated: #1490710 X-Provags-ID: V01U2FsdGVkX1/XgDs7ha7XZK9+RkcqHKFLZdsa/E2/WgdcOKqMUX nrW0Melu8/9Y1/ X-X-Sender: gene099@racer.site In-Reply-To: X-Y-GMX-Trusted: 0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: Hi, On Thu, 6 Dec 2007, Nguyen Thai Ngoc Duy wrote: > On Dec 6, 2007 6:22 AM, Junio C Hamano wrote: > > However, if we define setup() to behave this way when GIT_DIR is not > > defined and GIT_WORK_TREE is: > > > > (1) internally pretend as if GIT_DIR was specified to be the > > directory where the command was started from (iow, do getcwd() > > once upon startup); > > > > (2) chdir to GIT_WORK_TREE (which means "callers of setup() always > > run from the top of the work tree"); > > > > (3) set prefix to NULL; > > (1) is fine by me, even if it goes up to find a gitdir. But (3), no, > prefix should be set as relative path from worktree top directory to > user current directory, not NULL. If you expect "git " to work correctly from GIT_DIR, you will _have_ to set the prefix to NULL. Ciao, Dscho