[RFC] Removing deleted files after checkout

2005-08-23 Thread Carl Baldwin
Hello, I recently started using git to revision control the source for my web-page. I wrote a post-update hook to checkout the files when I push to the 'live' repository. In this particular context I decided that it was important to me to remove deleted files after checking out the new HEAD. I

Re: [RFC] Removing deleted files after checkout

2005-08-23 Thread Daniel Barkalow
On Tue, 23 Aug 2005, Carl Baldwin wrote: Hello, I recently started using git to revision control the source for my web-page. I wrote a post-update hook to checkout the files when I push to the 'live' repository. In this particular context I decided that it was important to me to remove

Re: [RFC] Removing deleted files after checkout

2005-08-23 Thread Daniel Barkalow
On Tue, 23 Aug 2005, Carl Baldwin wrote: On Tue, Aug 23, 2005 at 03:43:56PM -0400, Daniel Barkalow wrote: On Tue, 23 Aug 2005, Carl Baldwin wrote: Hello, I recently started using git to revision control the source for my web-page. I wrote a post-update hook to checkout the files

Re: [RFC] Removing deleted files after checkout

2005-08-23 Thread Daniel Barkalow
On Tue, 23 Aug 2005, Carl Baldwin wrote: The point is to push and use a post-update hook to do the checkout. So, this won't be possible. You could have the remote repository be something like ~/git/website.git, and have a hook which does: cd ~/www; git pull ~/git/website.git/. That is, have

Re: [RFC] Removing deleted files after checkout

2005-08-23 Thread Junio C Hamano
Daniel Barkalow [EMAIL PROTECTED] writes: If you don't use -f, git-checkout-script removes deleted files. Using -f tells it to ignore the old index, which means that it can't tell the difference between removed files and files that weren't tracked at all. Yes and no. git checkout assumes

Re: [RFC] Removing deleted files after checkout

2005-08-23 Thread Carl Baldwin
Ok, the following is what I came up with based on your response. This is .git/hooks/update. It mostly works in my situation. See below for my discussion on what didn't work. #!/bin/sh export PATH=/usr/local/bin:/usr/bin:/bin # cd to the root of the project directory (assume one dir up from

Re: [RFC] Removing deleted files after checkout

2005-08-23 Thread Daniel Barkalow
On Tue, 23 Aug 2005, Carl Baldwin wrote: The thing that this doesn't do is remove empty directories when the last file is deleted. I once expressed the opinion in a previous thread that directories should be added and removed explicitly in git. (Thus allowing an empty directory to be