-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
git-for-windows docs #60
base: master
Are you sure you want to change the base?
Conversation
Thank you! The sed code is very clever! I'm not familiar with Git for Windows. I'm a bit hesitant to massage the |
GfW is really just meant to do one thing: provide Asking users (or downstream package maintainers) to replace the GfW installation with cygwin is analogous to replacing an installation of vi with Microsoft Office: sure, the basic premise of editing a text file is covered, but it adds dozens and dozens of otherwise unnecessary dependencies, complexity, and learning-curve for maintenance. And cygwin requires significantly more maintenance than GfW (which requires just simple upgrades). Asking users (...) to replace GfW with a virtual machine (WSL) is similarly exceedingly asymmetric. I haven't suggested any changes to the If your |
Sorry, I wasn't clear regarding massaging. I meant processing the I like your suggestion for a universal |
That's a very relevant point: GfW has no package management, perhaps that gives you some perspective to understand why it is both "good" (simple) and not extensible. (I apologize if my points came across as pedantic or patronizing. I often forget that not everybody is cursed as I am to use GfW as my best-available shell.) Your suggestion to use $ PREFIX=QUUX make -n install
mkdir -p "QUUX/share/man/man1"
mkdir -p "QUUX/bin"
mkdir -p "QUUX/lib"/git-issue
install git-issue.sh "QUUX/bin"/git-issue
install lib/git-issue/import-export.sh "QUUX/lib"/git-issue/import-export.sh
install -m 644 git-issue.1 "QUUX/share/man/man1"/
mkdir -p QUUX/etc/bash_completion.d
install -m 644 gi-completion.sh QUUX/etc/bash_completion.d/git-issue to generate an install script that regains the ability to set a prefix dir, though we do lose the ability to control separate bin, lib, sysconfdir directories. (I don't see that as a huge problem.) This needs to be run on the dev system, though, not the user's system. I think the assumptions for I can see adding some logic to determine a reasonable I can't work on it now, I'll look at it tomorrow. I have some thoughts. |
Excellent, thank you for the clarifications! Given the simplicity goal of GfW, bundling a
|
@dspinellis, the guidance is clear, and ... GfW is messing with things a little. Using the simple Unfortunately, windows is thwarting things a little. If you ignore the r2@d2sb2 MINGW64 ~/Projects/git-issue/_57_gfw_install (fix/57_gfw_install)
$ /c/Rtools/bin/make gfw-install.sh
c:/Rtools/bin/make -s -n PREFIX=DOLLARHOME/AppData/Roaming/git-issue > gfw-install.sh
echo "git config --global alias.issue '!'\"DOLLARHOME/AppData/Roaming/git-issue/bin/git-issue\"" >> gfw-install.sh
sed -i -e 's/DOLLARHOME/\$HOME/g' gfw-install.sh
r2@d2sb2 MINGW64 ~/Projects/git-issue/_57_gfw_install (fix/57_gfw_install)
$ sh gfw-install.sh
r2@d2sb2 MINGW64 ~/Projects/git-issue/_57_gfw_install (fix/57_gfw_install)
$ git issue
No git-issue directory in path .
/Users/r2/AppData/Roaming/git-issue/bin/../lib::/usr/lib:/usr/local/lib In a non-windows system, the So while the |
The error comes from
|
See my comments in #64, as I believe fixing that makes the rest of this PR easy. If you'd like, I can include the fix from that issue in this PR. Or a separate PR. Up to you :-) |
Documentation and script to create an installation script for git-bash (within git-for-windows), as a suggestion for #57.
This leverages on the variables and
install:
section of the existingMakefile
, so it should update if/when the package itself changes.I've not included the
install_gfw.sh
file for now, since I'm assuming you'd prefer it to not be the default for all users. However, it's rather small and can otherwise be ignored (or used for that matter). The script it creates is currently:This script has a few caveats/disclaimers:
even though it does not start with the hash-bang header line, git-bash will still work, so the following (on GfW) both work:
in GfW, the default prefix of
/usr/local
will not work, due to directory virtual mounts; I mention this in the docs, but it might be a commonly (perhaps frequently) asked question to the maintainer(s); we can easily define an alternate location to override the current default just in this installation filein GfW,
SYSCONFDIR
is already defined (or at least it is on mine) to/etc
; as long as the user installs with./install_gfw.sh
orsh install_gfw.sh
, then this envvar is not inherited and the bash-completion script will be installed in${PREFIX}/etc
; if, however, they decide to go with. install_gfw.sh
(using.
forsource
, not suggested in the docs), then they will receive an errorThe fix to this error is to define
SYSCONFDIR
(and/orDESTDIR
). Or to not usesource
or.
.this script can be run repeatedly, it does not fail or behave differently if the target directories and/or files already exist
General notes:
I think the logic for converting make's conditional variable assignment (
?=
) is applied generally-enough to bash's (:-
), but I'm sure it's possible to engineer incompatible make recipes. If you complicate yourMakefile
preamble, this script might no longer work.Similarly, it finds all installation-related code by finding the literal
install:
block and stops parsing when it finds the next line with a non-space in the first character. This means an inadvertent comment will be problematic:This would cause the second
mkdir
to be missed. (I don't know that this is legal for make, to be honest, just thought I'd state the parsing assumption.) This current method appears to handle blank lines and indented comments.On my system, this passes all tests except test 1, which fails due to CRLF issues. Also, tests 1 and 77 warn about the same line-ending problem, which I believe is safe to ignore:
(I believe that the preferable config in windows is
core.autocrlf = true
, I might be wrong.)