minimal required files to just use git-clone

692 views
Skip to first unread message

tomdesinto

unread,
Feb 4, 2009, 4:09:26 PM2/4/09
to msysGit
Hi,

I'm in the process of writting an installer that needs to clone a git
repo.

I don't want that installer to install the full msysgit on the user
system.
Ideally I'd like the installer to unpack a minimal set of files from
msysgit to a tmp dir,
run the git-clone.exe command from here.

Is there a solution with msysGit to acheive this ?

Regards

Johannes Schindelin

unread,
Feb 4, 2009, 4:28:54 PM2/4/09
to tomdesinto, msysGit
Hi,

Sure. The easiest would be to

- create a directory
- make sure that no git binary is in the PATH (e.g. by running "git" and
expecting it not to be found)
- copy git-clone.exe to that directory
- set GIT_EXEC_PATH to that directory
- run git-clone and see what programs are missing

(I guess git-fetch-pack.exe is needed, or maybe libcurl-4.dll if you clone
via http://)

Ciao,
Dscho

tomdesinto

unread,
Feb 5, 2009, 4:58:25 PM2/5/09
to msysGit
Thx Dscho for your quick reply

Here is my progress so far :

* created a dir that contains :
* git-clone.exe
* libcurl-4.dll
* libiconv2.dll
* git-fetch-pack.exe

* set GIT_EXEC_PATH=%CD%
* git-clone.exe git://github.com/BigBrotherBot/big-brother-bot.git
test

I get the following output :

RUNTIME_PREFIX requested, but prefix computation failed. Using
static fallback ''.
warning: templates not found /share/git-core/templates
Initialized empty Git repository in C:/Documents and Settings/
Thomas/Bureau/git-clone/test/.git/
fatal: fetch-pack: unable to fork off index-pack
remote: Counting objects: 467, done.
fatal: read error (Bad file descriptor)

So I'm blocked by the 'fatal: fetch-pack' error...
I've tried after copying git-index-pack.exe to the folder with the
same result.
When running, I can briefly see a test directory being created and
deleted.

Also, apparently setting the GIT_EXEC_PATH env variable is only needed
if git-clone is runned from another directory.

Thomas

Johannes Schindelin

unread,
Feb 5, 2009, 5:44:00 PM2/5/09
to tomdesinto, msysGit
Hi,

On Thu, 5 Feb 2009, tomdesinto wrote:

> Thx Dscho for your quick reply
>
> Here is my progress so far :
>
> * created a dir that contains :
> * git-clone.exe
> * libcurl-4.dll
> * libiconv2.dll
> * git-fetch-pack.exe
>
> * set GIT_EXEC_PATH=%CD%
> * git-clone.exe git://github.com/BigBrotherBot/big-brother-bot.git
> test
>
> I get the following output :
>
> RUNTIME_PREFIX requested, but prefix computation failed. Using
> static fallback ''.
> warning: templates not found /share/git-core/templates
> Initialized empty Git repository in C:/Documents and Settings/
> Thomas/Bureau/git-clone/test/.git/
> fatal: fetch-pack: unable to fork off index-pack

git-index-pack.exe is missing.

> remote: Counting objects: 467, done.
> fatal: read error (Bad file descriptor)
> So I'm blocked by the 'fatal: fetch-pack' error...
> I've tried after copying git-index-pack.exe to the folder with the
> same result.
> When running, I can briefly see a test directory being created and
> deleted.
>
> Also, apparently setting the GIT_EXEC_PATH env variable is only needed
> if git-clone is runned from another directory.

I strongly suspect that GIT_EXEC_PATH would be required to make it work.

For further debugging, you might be interested in setting GIT_TRACE=1.

Ciao,
Dscho

tomdesinto

unread,
Feb 5, 2009, 6:15:28 PM2/5/09
to msysGit
It now works. I had to had git.exe to my directory and user "git.exe
clone" instead of "git-clone.exe"

So here are the minimum requirements for cloning a git repo :

git-clone.exe
git-fetch-pack.exe
git-index-pack.exe
git.exe
libcurl-4.dll
libiconv2.dll

and run git.exe clone http://xxxxx/xx.git some-dest-dir
GIT_EXEC_PATH was not needed.

Thanks again Dscho

Thomas

Johannes Schindelin

unread,
Feb 5, 2009, 6:32:24 PM2/5/09
to tomdesinto, msysGit
Hi,

Just for the record: I still do not like top-posters.

On Thu, 5 Feb 2009, tomdesinto wrote:

>
> It now works. I had to had git.exe to my directory and user "git.exe
> clone" instead of "git-clone.exe"
>
> So here are the minimum requirements for cloning a git repo :
>
> git-clone.exe
> git-fetch-pack.exe
> git-index-pack.exe
> git.exe

git.exe, git-fetch-pack.exe and git-clone.exe are actually the same file.

Ciao,
Dscho

Reply all
Reply to author
Forward
0 new messages