Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: Alan Chandler <alan@chandlerfamily.org.uk>
Cc: git@vger.kernel.org
Subject: Re: What is the working directory for post-update hook?
Date: Sun, 05 Feb 2006 01:41:57 -0800	[thread overview]
Message-ID: <7vd5i2kuqi.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <200602050906.52016.alan@chandlerfamily.org.uk> (Alan Chandler's message of "Sun, 5 Feb 2006 09:06:51 +0000")

Alan Chandler <alan@chandlerfamily.org.uk> writes:

> The document root of my website has a git repository under it (in the 
> standard .git subdirectory) and want a post update hook to checkout the 
> contents (so the web server sees it!) 
>
> I will be pushing to it via ssh.
>
> Does this mean that the post-update hook with be run with a working directory 
> of the web site's document root? or something relative (such as GIT_DIR) so 
> that I don't have to do a specific cd to an absolute path.

The current implementation happens to chdir to GIT_DIR and sets
GIT_DIR=. in the environment, so if you have something like
this:

	/var/www/myproject/
	/var/www/myproject/.git/
	/var/www/myproject/.git/HEAD
	/var/www/myproject/.git/...
        /var/www/myproject/README

Then $(pwd) would be /var/www/myproject/.git/.  Your hook would
probably be able to do "cd .."  to get to the project top.

However, there is no guarantee for future implementations.

  parent reply	other threads:[~2006-02-05  9:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-05  9:06 What is the working directory for post-update hook? Alan Chandler
2006-02-05  9:37 ` Alan Chandler
2006-02-05  9:41 ` Junio C Hamano [this message]
2006-02-05 10:58   ` Alan Chandler

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=7vd5i2kuqi.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --cc=alan@chandlerfamily.org.uk \
    --cc=git@vger.kernel.org \
    /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