Re: [PATCH] git-init: set up GIT_DIR/workdir if GIT_WORK_DIR is set
- From
- Matthias Lederhofer <matled@gmx.net>
- Date
- Mar 12, 2007, 13:12 UTC
- Message-ID
- <20070312131253.GA16452@moooo.ath.cx>
- In-Reply-To
- <20070312121226.GB2268@always.joy.eth.net>
Joshua N Pritikin <jpritikin@pobox.com> wrote:
Show 7 quoted lines
> On Mon, Mar 12, 2007 at 12:53:50PM +0100, Matthias Lederhofer wrote: > > git-init will always put an absolute path in > > GIT_DIR/workdir, relative paths are resolved from the > > directory git-init was called from. > > Does that mean I can't move my GIT trees around without changing a > config entry? What is that an improvement?
And for the decision to put an absolute path there by default:
Putting $GIT_WORK_DIR as is into $GIT_DIR/workdir is probably not what the user expects because the content of $GIT_DIR/workdir is interpreted relative to $GIT_DIR, not the current working directory. Example:
/tmp$ mkdir repository working_directory
/tmp$ git --git-dir=repository --work-dir=working_directory initIf git init puts 'working_directory' into $GIT_DIR/workdir it would make the associated working directory $GIT_DIR/working_directory = /tmp/repository/working_directory and not /tmp/working_directory.
The alternative to use
/tmp$ git --git-dir=repository --work-dir=../working_directory init
seems quite confusing to me.
If you've any other idea to solve this please tell me.