From 9e52bdc097c180f84def5bc425c2d859b1d9a8bb Mon Sep 17 00:00:00 2001 From: PXgamer Date: Tue, 7 Mar 2017 13:39:38 +0000 Subject: [PATCH] Updated to fix various spelling mistakes and changed log directory --- README | 21 --------------------- README.md | 21 +++++++++++++++++++++ index.php | 5 ++--- 3 files changed, 23 insertions(+), 24 deletions(-) delete mode 100644 README create mode 100644 README.md diff --git a/README b/README deleted file mode 100644 index 5c197ca..0000000 --- a/README +++ /dev/null @@ -1,21 +0,0 @@ -cgit. git CGI interface - -cgit lets you control a git reository using URLs - -PREREQUISITE -- git - -INSTALLATION -1- make a directory for your project -2- set chmod 777 for the empty directory -3- make a subdirectory and call it cgit -4- make sure the cgit directory is in your http server DocumenRoot -5- "git init" the cgit directory -6- "git pull git://github.com/slim/cgit.git" in the cgit directory -7- init your project tree using cgit : go to http://yourServer/cgit/?init - -USAGE -command format is : http://yourServer/cgit/?=&=&... - -where is push, pull, commit, checkout,... -and are arguments to the command diff --git a/README.md b/README.md new file mode 100644 index 0000000..6626166 --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# cgit. git CGI interface + +`cgit` lets you control a git repository using HTTP get calls. + +## Prerequisites +- git +- a web server + +## Installation +1. Make a directory for your project (DocumentRoot) +2. Set chmod 777 for the empty directory +3. `git clone git://github.com/slim/cgit.git` in the root directory +4. Init your project tree using cgit by browsing to `server-url/cgit/?init` + +## Usage +Command format is : +```PLAIN +server-url/cgit/?=&=&... +``` + +Where the `` parameter is any one of `push`, `pull`, `commit`, `checkout`, etc. and `` are the arguments for the specified command. diff --git a/index.php b/index.php index 9c55557..4768218 100644 --- a/index.php +++ b/index.php @@ -3,8 +3,7 @@ foreach ($_GET as $command => $arguments) { passthru("cd .. && git $command $arguments 2>&1"); } - $timeStamp = date('c'); - $logEntry = "". json_encode($_GET) . json_encode($_POST) .""; - file_put_contents('../cgit.log', $logEntry, FILE_APPEND); + $logEntry = date('c') . " | " . json_encode($_GET) . json_encode($_POST) ."\n"; + file_put_contents('cgit.log', $logEntry, FILE_APPEND); ?>