Re: MinGW binary installer available

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Han-Wen Nienhuys wrote:
> Indeed: for now, this is intended for people clueful enough to install
> bash and perl on their own.  Adding bash itself should be easy, but
> I have no idea how to make cmd open the scripts with bash automatically.

I've thought about renaming git-commit to git-commit.cmd and add this
preamble:

@echo off
rem () { :; } ; : \
sh %0 %1 %2 %3 %4 %5 %6 %7 %8 %9
rem ; : \
exit /B %ERRORLEVEL%


in place of the usual "#!/bin/sh". It requires you to have a command
named @echo.exe in the path that is a noop. Also, it is limited to 9
command line arguments.

What a hack! (*)

-- Hannes

(*) Here's how it works:
- cmd.exe will ignore all but the sh and exit lines, effectively
invoking the script under bash and exiting with bash's exit code.
- Bash will execute @echo, define a function named rem, ignore the sh
and exit lines because they are continuations of the : noop on the
previous line. It will also run the second rem, but it is a noop, too.

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]