git-extras
git-extras copied to clipboard
Revamp makefile
Work-in-progress. Please don't merge yet.
This PR revamps the build process and Makefile as suggested in #463. It gives the user more configuration options for customizing the installation. This will also be useful for packagers like Homebrew, which currently needs to patch the distribution. And it sets things up for local execution and testing of the commands.
This is a good-sized change, so no reason to merge it right away. We can review/discuss/test first.
Closes #463 Closes #442 Closes #228
- Adds an intermediate
make build
target that generates working commands in a localbuild/
dir, so you can test it without installing it-
make install
continues to work as before, automatically callingmake build
if needed. (You will need to manuallymake clean
if you change the source code between repeated installs from the same source directory.)
-
- Adds an option to disable the self-update feature, which is needed by external package managers like Homebrew
- Adds an option to disable selected commands (as requested in #442, #228)
- Adds an option to have it skip all or install all commands that conflict with aliases, without prompting. With this you can do a fully noninteractive installation
- Revises manpage generation code to be consistent between the Makefile and
man/manning-up.sh
. - Generates HTML for the non-man-page documentation, too, and installs it to
$PREFIX/share/doc
- Folds the windows-specific stuff into
install.sh
and removes theupdateForWindows()
special case
The separate Makefile.msys
still exists; I don't have a setup for testing that.
:+1:
Thanks hemanth!
Okay, hold on: I figured out an easy way to do per-file builds for the commands and fix the updated-dependency problem, so they get properly rebuilt on subsequent make install
s even without intervening make clean|build
. Let me roll that in before you form firm opinions...
Okay, I've added per-file builds and fixed the dependency problem.
This new mechanism does away with the hardcoded logic for including libraries that was in the Makefile or main command building script and replaces it with #@@ include: @@
directives, so you can see a command's dependencies when looking at the command's source code itself. It then adds a conditional-inclusion directive to support doing the "disable self-update" with this mechanism.
@spacewander Got some time for this?
I am reading the diff now. It may take me some time to make a feedback.
@apjanke
I suggest rewriting tools/build_command
from perl to bash. IMHO, we should make git-extras
only depend on bash and other coreutils. Perl is out of scope.
I've rebased the branch on master and addressed most of the line notes.
I suggest rewriting
tools/build_command
from perl to bash. IMHO, we should make git-extras only depend on bash and other coreutils. Perl is out of scope.
Hmm. Sorry; I wasn't really thinking about dependencies when I wrote this.
You could probably re-write build_command
as a sed
command with a bash
wrapper around it, especially if you removed the conditional-inclusion feature. I'll see if that's doable.
Hey, just wanted to check in on the status of this.
We're planning on having a release tomorrow (it's been 1 month since the last release), but we can push this to the next monthly release if it's not ready.
Not ready, or close to it. Let's wait until next monthly release.
Sure, moved it to the next milestone. Thank you so much for this contribution!