progrium / gitreceive

Easily accept and handle arbitrary git pushes
1.14k stars 108 forks source link

Piping code to directory adds low-level git files/folders #25

Open audleman opened 10 years ago

audleman commented 10 years ago

When I use the mkdir -p /some/path && cat | tar -x -C /some/path command specified in the documentation I get an unexpected result. My code is in place, but at the root of my project I also get

drwxr-xr-x  2 git git  4096 2014-05-31 20:44 branches
-rw-r--r--  1 git git    66 2014-05-31 20:44 config
-rw-r--r--  1 git git    73 2014-05-31 20:44 description
-rw-r--r--  1 git git    23 2014-05-31 20:44 HEAD
drwxr-xr-x  2 git git  4096 2014-05-31 20:44 hooks
drwxr-xr-x  2 git git  4096 2014-05-31 20:44 info

...and a few more. i.e. some low-level git info that I'm not used to seeing in my repo.

Is this expected behavior or did I do something wrong? I don't see that it'll do any harm, but I'm always a bit spooked by the unexpected while coding.

Thanks, and great project!

progrium commented 10 years ago

Is that command the only content of your receiver script?

audleman commented 10 years ago

Nope, full script below:

#!/bin/bash
mkdir -p /home/git/dice && cat | tar -x -C /home/git/dice
cd /home/git/dice
echo "----> Setting up virtualenv ..."
virtualenv venv
source venv/bin/activate
echo "----> Installing requirements.txt ..."
pip install -r requirements.txt

URL=http://requestb.in/1idyodf1
echo "----> Posting to $URL ..."
curl \
  -X 'POST' \
  -F "repository=$1" \
  -F "revision=$2" \
  -F "username=$3" \
  -F "fingerprint=$4" \
  -F contents=@- \
  --silent $URL