Re: [PATCH] git-init: set up GIT_DIR/workdir if GIT_WORK_DIR is set

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Matthias Lederhofer <matled@xxxxxxx> writes:

> ... because
> $GIT_WORK_DIR is normally interpreted as relative path to the current
> working directory and not relative to $GIT_DIR.

Well, it could be that _that_ handling of the environment
variable is what needs to be fixed.

If you are using $GIT_DIR, you are working in a subdirectory,
say, Documentation/, and you are using a relative path to
specify GIT_WORK_DIR, then you would need to do this, right?

	$ GIT_DIR=/src/git/git.git ;# top of repository
        $ export GIT_DIR
        $ cd /work/git/git.git ;# go to top of working tree
	$ cd Documentation ;# I want to work in here...

        $ GIT_WORK_DIR=.. ;# toplevel is .. relative to here
        $ export GIT_WORK_DIR
        $ hack hack ; git commit

        $ cd .. ;# Now I want to update the toplevel
        $ GIT_WORK_DIR=. ;# oops I need to update this env
	$ hack hack ; git commit

        $ cd t ;# Now to testcase
        $ GIT_WORK_DIR=.. ;# oops again

If $GIT_WORK_DIR is given absolute you do not have to worry
about this problem, but if you allow giving relative path, it
seems to me that it would be more useful to make it relative to
GIT_DIR.  Then you would need to set it just once, at the same
time when you set and export GIT_DIR, and keep working in that
working tree.

The same goes for $GIT_DIR/workdir.

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]