git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthias Lederhofer <matled@gmx.net>
To: Junio C Hamano <junkio@cox.net>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] git-init: set core.workdir when GIT_WORK_DIR is specified
Date: Sun, 18 Mar 2007 12:18:00 +0100	[thread overview]
Message-ID: <20070318111800.GA15147@moooo.ath.cx> (raw)
In-Reply-To: <7vr6rnlyzt.fsf@assigned-by-dhcp.cox.net>

Junio C Hamano <junkio@cox.net> wrote:
> Matthias Lederhofer <matled@gmx.net> writes:
> >  * git init does not show the expansion of GIT_WORK_TREE to an
> >    absolute path, this might confuse the user
> 
> If the feature might confuse the user without extra output, it
> probably is confusing to begin with, with or without it, so one
> option might be to refuse relative path when running git-init.
> 
> However, as long as the expansion to absolute path is done
> correctly, I do not think there is any room for confusion.  Who
> would want a feature that lets you set work-tree to ../.., so
> that no matter where in the working tree you cd around, git
> assumes that the toplevel is two level up?  If you record the
> work tree location in the configuration, you would want it to be
> stable, and I do not think anybody would expect it be stored as
> relative.  So I thought having the printf() would be a good way
> for debugging the absolute expansion, but after that I do not
> think it is needed (but again, I may well be missing some issues
> you've thought about, so please tell me otherwise).

I really don't know what people would expect from git --work-tree=foo
init and therefore I thought it might help to tell them "core.worktree
= /path/to/foo".  For example one could think this would work (without
the message in brackets):

    ~/foo$ export GIT_DIR=`pwd`/repository.git
    ~/foo$ mkdir src
    ~/foo$ git --work-tree=src init
   [core.worktree = /home/user/foo/src]
    Initialized empty Git repository in /home/user/foo/repository.git/
    ~/foo$ cd ..; mv foo bar; cd bar
    ~/bar$ export GIT_DIR=`pwd`/repository.git

With the message in brackets it would be clear what breaks after
renaming the directory.

Note: git config core.worktree ../src fails after moving the working
tree because the value of core.worktree checked for validity.
Either run

    $ git --work-tree=. config [args]

or just do

    $ git --work-tree=src init

again in the new location and git-init will set core.worktree again.

  reply	other threads:[~2007-03-18 11:18 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-17  1:58 [PATCH] git-init: set core.workdir when GIT_WORK_DIR is specified Matthias Lederhofer
2007-03-17  7:29 ` Junio C Hamano
2007-03-17 11:01   ` Matthias Lederhofer
2007-03-17 14:34   ` Matthias Lederhofer
2007-03-17 14:42     ` [PATCH 1/5] rev-parse: --is-bare-repository option Matthias Lederhofer
2007-03-17 14:43     ` [PATCH 2/5] test git-rev-parse Matthias Lederhofer
2007-03-27 22:07       ` [PATCH(amend)] " Matthias Lederhofer
2007-03-17 14:44     ` [PATCH 3/5] introduce GIT_WORK_TREE environment variable Matthias Lederhofer
2007-03-18 19:43       ` Matthias Lederhofer
2007-03-18 20:12       ` Matthias Lederhofer
2007-03-18 20:23         ` Matthias Lederhofer
2007-03-18 20:28           ` Junio C Hamano
2007-03-17 14:44     ` [PATCH 4/5] test GIT_WORK_TREE Matthias Lederhofer
2007-03-17 14:45     ` [PATCH 5/5] git-init: set core.worktree when GIT_WORK_TREE is specified Matthias Lederhofer
2007-03-18  8:47     ` [PATCH] git-init: set core.workdir when GIT_WORK_DIR " Junio C Hamano
2007-03-18 11:18       ` Matthias Lederhofer [this message]
2007-03-18 21:18       ` Matthias Lederhofer
     [not found]         ` <7vk5xensjn.fsf@assigned-by-dhcp.cox.net>
2007-03-19 14:24           ` 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

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

  git send-email \
    --in-reply-to=20070318111800.GA15147@moooo.ath.cx \
    --to=matled@gmx.net \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    /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.
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 NNTP newsgroup(s).