The step I'm stuck on is, finding the right way to get at an unzip method
from within a git script. (see
http://stackoverflow.com/questions/7535311/is-there-an-opposite-command-to-git-archive-for-importing-zip-files)
I'm trying this on an XP netbook.
I have the full msysgit, with source code, which includes 7-zip, and I have
7-zip and Filzip on the XP side of the platform.
I can't seem to either get a $ cmd dos_script.bat command line to execute
a dos batch file, (I can't locate a manual page for the passing of
parameters from the bash to the cmd command, so I'm not sure it even sees
the batch file name I've given it)
Also I'm not sure how, or if, I can get the C:\msysgit\share\7-Zip code to
be usable from the bash - I'm pretty sure that this directory is the Windows
version used for packaging the MSysGit, rather than being an available
utility for the bash - but I thought I'd better mention it.
Can anyone suggest how I can do the unzip (of a directory) step in the git
script from the available MSysGit installation code, without jumping into
some 'dependency hell' ;-)
Philip
There is a copy of unzip in the msysgit bin/ directory of the msysGit
build tree. So:
#!/bin/sh
unzip $1
would be a trivial unzip script. The 7za.exe will unzip files too.
Just call it: 7za x zipfile. Both of these will recreate the tree
structure from the archive.
----
I now see my mistake. I had been starting up an old bash (from a right click
menu option) which was for a plain 'git for windows' bash (version
1.7.3.1-preview20101002 !).
I have now started the MsysGit (Welcome to msysGit; git version 1.7.6.GIT)
via my Start>programmes menu. I had added that menu when I installed the
full msysgit.
This now gave me access to the unzip, which the old bash didn't. (learning
point ;-)
A bit of a 'Doh' moment, but we have to go through these occasionally to see
the woods for the trees.
Philip
However, for a 'Git for Windows' basic user, how would they get the script
to run, given that it doesn't appear to have the unzip available to them. Or
is that a limitaion of the Git for Windows basic installation?
Philip
>> I now see my mistake. I had been starting up an old bash (from a right
>> click menu option) which was for a plain 'git for windows' bash
>> (version 1.7.3.1-preview20101002 !).
>>
>> I have now started the MsysGit (Welcome to msysGit; git version
>> 1.7.6.GIT) via my Start>programmes menu. I had added that menu when I
>> installed the full msysgit.
>>
>> This now gave me access to the unzip, which the old bash didn't.
>> (learning point ;-)
>>
>> A bit of a 'Doh' moment, but we have to go through these occasionally
>> to see the woods for the trees.
>>
>> Philip
>
> However, for a 'Git for Windows' basic user, how would they get the
> script to run, given that it doesn't appear to have the unzip available
> to them. Or is that a limitaion of the Git for Windows basic installation?
I'm not sure what you call "basic installation" installation here. No
matter what features you (de-)select in the installer, you always get
all the files in your installation directory. Only some configuration
stuff changes.
So here's what I think happened to you: At some point you installed
version 1.7.3.1 and chose to install the Windows Explorer "Git Bash"
context menu entries.
Later, you installed version 1.7.6 in parallel (not updating the
existing version 1.7.3.1) but chose *not* to install the context menu
entries. This means these entries still launch version 1.7.3.1, while
the Start Menu entries were updated and launch version 1.7.6.
My guess is that version 1.7.3.1 did not come with the unzip script yet,
but version 1.7.6 does. So the easiest way to fix this would be to
uninstall version 1.7.3.1 and reinstall 1.7.6 with the option to install
the Windows Explorer context menus checked.
--
Sebastian Schuberth
I don't think that's it. I believe the difference is Git for Windows
vs msysGit. msysGit includes unzip, while Git for Windows does not.
Basicly, Git for Windows is a Git (including a minimal runtime
environment), while msysGit is a fully blown msys-based development
environment.
Stuffing all kinds of sometimes-useful-but-not-really-essential tools
into the Git for Windows distribution will end up bloating it, which
is the reason why non-essential tools aren't included.
So the answer to the question would be that you had to download a
unzip tool from somewhere before the script can run. Just the same way
you'd have to for another git-unrelated tool.
Alternatively, you could install msysGit rather than Git for Windows,
but it isn't quite as nicely packaged.
> I don't think that's it. I believe the difference is Git for Windows
> vs msysGit. msysGit includes unzip, while Git for Windows does not.
You're right, Erik, this sounds more likely.
--
Sebastian Schuberth
Looking a bit more at the distribution, I'm not sure I completely
agree with myself on this point: We already distribute gzip, gunzip,
bzip and bunzip. Perhaps it would make sense to also include unzip in
the distribution?
Thoughts?
---
diff --git a/share/WinGit/copy-files.sh b/share/WinGit/copy-files.sh
index 9b7f0fa..3e9f12b 100755
--- a/share/WinGit/copy-files.sh
+++ b/share/WinGit/copy-files.sh
@@ -48,7 +48,8 @@
ls.exe,m4.exe,md5sum.exe,mkdir.exe,msys-1.0.dll,msysltdl-3.dll,mv.exe,patch.exe,
patch.exe.manifest,perl.exe,printf,ps.exe,pwd,rm.exe,rmdir.exe,rxvt.exe,\
scp.exe,sed.exe,sh.exe,sleep.exe,sort.exe,split.exe,\
ssh-agent.exe,ssh.exe,ssh-add.exe,ssh-keygen.exe,ssh-keyscan.exe,\
-tail.exe,tar.exe,tee.exe,touch.exe,tr.exe,true.exe,uname.exe,uniq.exe,vi,\
+tail.exe,tar.exe,tee.exe,touch.exe,tr.exe,true.exe,uname.exe,uniq.exe,\
+unzip.exe,vi,\
msys-perl5_8.dll,lib{apr,aprutil,expat,neon,z,svn}*.dll,pthreadGC2.dll,\
msys-crypto-0.9.8.dll,msys-regex-1.dll,msys-ssl-0.9.8.dll,msys-minires.dll,msys-z.dll,\
openssl.exe,vim,wc.exe,which,xargs.exe,start} lib/engines/ \
> Looking a bit more at the distribution, I'm not sure I completely
> agree with myself on this point: We already distribute gzip, gunzip,
> bzip and bunzip. Perhaps it would make sense to also include unzip in
> the distribution?
>
> Thoughts?
Looks good to me. As we're a Windows distribution of Git, we should
include an (un)zip tool for the zip format that is most common on
Windows.
Please commit to devel.
--
Sebastian Schuberth
On Wed, 28 Sep 2011, Erik Faye-Lund wrote:
> On Wed, Sep 28, 2011 at 12:20 PM, Erik Faye-Lund <kusm...@gmail.com> wrote:
> > Stuffing all kinds of sometimes-useful-but-not-really-essential tools
> > into the Git for Windows distribution will end up bloating it, which
> > is the reason why non-essential tools aren't included.
>
> Looking a bit more at the distribution, I'm not sure I completely
> agree with myself on this point: We already distribute gzip, gunzip,
> bzip and bunzip. Perhaps it would make sense to also include unzip in
> the distribution?
>
> Thoughts?
No objections from my side!
Ciao,
Dscho
For the other compression mechanisms, both the compressor and
uncompressor are shipped (gzip/gunzip and bzip2/bunzip2), so why ship
only an uncompressor for ZIP? Shipping both zip and unzip, rather than
only unzip, seems like a good idea.
-- ES
Sure. Where is the patch?
Ciao,
Dscho
That'd be a brilliant idea if we only had a zip-binary. We don't, so
I'll leave that part to someone else... ;)
For the particular workflow I had in mind, the zip side is done on the
Windows side of the fence, e.g. by compressing a project folder.
This way (being able to unzip such project zip files and commit them into
git) allows the easy 'capture' of such zip storage based workflows that
happen at a low level (It's a method my project uses for day to day
storage).
That's not to say that having the matching pair wouldn't be the expected
capability. Having the zip/unzip capablity directly available on the
'linux/bash' side of the fence makes it a complete solution, and allows
simple scripts.
Philip
Correct - That's my situation / misunderstanding
>
> Stuffing all kinds of sometimes-useful-but-not-really-essential tools
> into the Git for Windows distribution will end up bloating it, which
> is the reason why non-essential tools aren't included.
>
> So the answer to the question would be that you had to download a
> unzip tool from somewhere before the script can run. Just the same way
> you'd have to for another git-unrelated tool.
One of my 'lack of understandings' is about whether Msysgit could even run
regular windows programmes, such as WinZip (for example) from the bash
prompt -- that is, I had assumed that Windows programes were separate from
the Linux programmes, on the basis that the two sorts of programmes hooked
into the OS by different routes. Is this the case? or had I misled myself
and I can run say the 7-zip.exe directly from the bash prompt, even though I
have the windows version installed?
>> Basicly, Git for Windows is a Git (including a minimal runtime
>> environment), while msysGit is a fully blown msys-based development
>> environment.
>
> Correct - That's my situation / misunderstanding
I'd like to amend that: msysGit is a fully blown msys-based
development environment primarily targeted at developing "Git for
Windows" itself.
> One of my 'lack of understandings' is about whether Msysgit could even run
> regular windows programmes, such as WinZip (for example) from the bash
It can. Think of Msysgit as Windows programs that emulate Linux
behavior. Msysgit executables are regular Windows executables, just
like 7-zip.exe. Msysgit is *not* something like colinux, or Wine the
other way around, or even a virtual machine. It's just a Cygwin fork.
> and I can run say the 7-zip.exe directly from the bash prompt, even though I
> have the windows version installed?
You can. In fact, the files in C:\msysgit\share\7-Zip are the regular
Windows versions, not a special Mingw-compiled version of 7-Zip.
But as the Mingw executables emulate Linux, you have to take care with
the path mangling when passing files to Windows executables from the
Mingw Bash. That is, basically use forward instead of backward
slashes.
--
Sebastian Schuberth
>> For the other compression mechanisms, both the compressor and uncompressor
>> are shipped (gzip/gunzip and bzip2/bunzip2), so why ship only an
>> uncompressor for ZIP? Shipping both zip and unzip, rather than only unzip,
>> seems like a good idea.
>
> That'd be a brilliant idea if we only had a zip-binary. We don't, so
> I'll leave that part to someone else... ;)
I was about to answer the exact same thing :-)
--
Sebastian Schuberth
---
Karsten,
The script presumes, I think, that we are using a compressed zip file that
Windows Explorer can interogate automatically. I'm thinking that if someone
used WinZip that we'd have to invoke winzip as the executable (googling
"csript" came up with some useful info - I'd not used/seen 'cscript/wscript'
before).
Also on first reading I didn't notice (I wasn't looking very hard) that you
actually create the CopyFolder.vbs file and populate it with the commands
via the cat command, rather than it simply being a pre-prepared file!
I've included this note for other readers of the list.
-----
No virus found in this message.
Checked by AVG - www.avg.com
Version: 10.0.1410 / Virus Database: 1520/3925 - Release Date: 09/28/11