Re: I don't want the .git directory next to my code.

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Daniel Barkalow <barkalow@...>
Cc: Mike <fromlists@...>, <git@...>
Date: Wednesday, January 16, 2008 - 6:33 pm

On Tue, Jan 15, 2008 at 11:13:58PM -0500, Daniel Barkalow wrote:

If you use zsh as your shell, put this chpwd function in .zprofile or
.zshrc:

chpwd() {
    local gitbasedir=/var/local/git
    local subdir=$gitbasedir$PWD
    while [[ ! -d $subdir ]]; do
	subdir=${subdir:h}
    done
    if [[ -d $subdir/.git ]]; then
	export GIT_DIR=$subdir/.git
	export GIT_WORK_TREE=${subdir/$gitbasedir/}
    else
	unset GIT_DIR GIT_WORK_TREE
    fi
}

Then, for each /path/.git dir, move it to /var/local/git/path/.git
(creating any needed parent dirs).  On every change of directory in
the shell, the variables GIT_DIR and GIT_WORK_TREE will be either
updated or cleared.  If you ever move a work-tree dir, you'll need
to remember to move the .git dir in the /var/local/git hierarchy.

..wayne..
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: I don't want the .git directory next to my code., Jakub Narebski, (Wed Jan 16, 9:13 am)
Re: I don't want the .git directory next to my code., Brian Downing, (Wed Jan 16, 8:59 pm)
Re: I don't want the .git directory next to my code., Randal L. Schwartz, (Wed Jan 16, 9:35 pm)
Re: I don't want the .git directory next to my code., Martin Langhoff, (Wed Jan 16, 10:59 pm)
Re: I don't want the .git directory next to my code., Randal L. Schwartz, (Thu Jan 17, 1:44 am)
Re: I don't want the .git directory next to my code., Matthieu Moy, (Wed Jan 16, 5:59 am)
Re: I don't want the .git directory next to my code., Johannes Schindelin, (Wed Jan 16, 6:36 am)
Re: I don't want the .git directory next to my code., Matthieu Moy, (Wed Jan 16, 7:59 am)
Re: I don't want the .git directory next to my code., Johannes Schindelin, (Wed Jan 16, 8:12 am)
Re: I don't want the .git directory next to my code., Matthieu Moy, (Wed Jan 16, 8:25 am)
Re: I don't want the .git directory next to my code., Johannes Schindelin, (Wed Jan 16, 8:45 am)
Re: I don't want the .git directory next to my code., Junio C Hamano, (Wed Jan 16, 1:40 pm)
Re: I don't want the .git directory next to my code., Johannes Schindelin, (Wed Jan 16, 1:52 pm)
Re: I don't want the .git directory next to my code., Nguyen Thai Ngoc Duy, (Wed Jan 16, 12:03 am)
Re: I don't want the .git directory next to my code., David Symonds, (Wed Jan 16, 12:06 am)
Re: I don't want the .git directory next to my code., Sam Vilain, (Wed Jan 16, 9:42 pm)
Re: I don't want the .git directory next to my code., Daniel Barkalow, (Wed Jan 16, 12:44 am)
Re: I don't want the .git directory next to my code., Daniel Barkalow, (Wed Jan 16, 12:13 am)
Re: I don't want the .git directory next to my code., Wayne Davison, (Wed Jan 16, 6:33 pm)
Re: I don't want the .git directory next to my code., Bert Wesarg, (Wed Jan 16, 9:21 am)
Re: I don't want the .git directory next to my code., Johannes Schindelin, (Wed Jan 16, 6:37 am)
Re: I don't want the .git directory next to my code., Randal L. Schwartz, (Tue Jan 15, 11:50 pm)
Re: I don't want the .git directory next to my code., Neil Macneale, (Wed Jan 16, 1:27 am)
Re: I don't want the .git directory next to my code., Linus Torvalds, (Wed Jan 16, 2:15 pm)
Re: I don't want the .git directory next to my code., Linus Torvalds, (Wed Jan 16, 10:38 pm)
Re: I don't want the .git directory next to my code., Junio C Hamano, (Wed Jan 16, 3:23 pm)
Re: I don't want the .git directory next to my code., Linus Torvalds, (Wed Jan 16, 2:25 pm)
Re: I don't want the .git directory next to my code., Andreas Ericsson, (Fri Jan 18, 4:41 am)
Re: I don't want the .git directory next to my code., Martin Langhoff, (Thu Jan 17, 5:05 pm)
Re: I don't want the .git directory next to my code., Jeff King, (Thu Jan 17, 11:17 am)
Re: I don't want the .git directory next to my code., David Symonds, (Fri Jan 18, 3:52 am)
Re: I don't want the .git directory next to my code., Johannes Schindelin, (Thu Jan 17, 3:20 pm)
Re: I don't want the .git directory next to my code., Johannes Schindelin, (Thu Jan 17, 4:08 pm)
Re: I don't want the .git directory next to my code., Johannes Schindelin, (Thu Jan 17, 4:57 pm)
Re: I don't want the .git directory next to my code., Johannes Schindelin, (Thu Jan 17, 5:05 pm)
Re: I don't want the .git directory next to my code., Linus Torvalds, (Thu Jan 17, 1:36 pm)
Re: I don't want the .git directory next to my code., Johannes Schindelin, (Thu Jan 17, 1:49 pm)
Re: I don't want the .git directory next to my code., Linus Torvalds, (Thu Jan 17, 2:02 pm)
Re: I don't want the .git directory next to my code., Johannes Schindelin, (Thu Jan 17, 2:10 pm)
Re: I don't want the .git directory next to my code., Wincent Colaiuta, (Thu Jan 17, 6:34 am)
Re: I don't want the .git directory next to my code., Kris Shannon, (Thu Jan 17, 2:38 am)
Re: I don't want the .git directory next to my code., Johannes Schindelin, (Wed Jan 16, 1:51 pm)
Re: I don't want the .git directory next to my code., David Symonds, (Wed Jan 16, 12:24 am)
Re: I don't want the .git directory next to my code., Dan McGee, (Tue Jan 15, 11:56 pm)
Re: I don't want the .git directory next to my code., Mike Krier, (Wed Jan 16, 2:07 am)