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
[nic.pl] Add git initialization support #279
base: master
Are you sure you want to change the base?
Conversation
Allow users to add init_git to their ~/.nirc configuration to have a git repository initialized during setup.
bin/nic.pl
Outdated
my $initializeGit = $CONFIG{'init_git'}; | ||
$initializeGit = 0 if !$initializeGit; | ||
|
||
if($initializeGit == 1 &! $isSubproject) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's this &!
operator?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, right, that's not a perl operator. It worked correctly during my testing so I didn't even think twice.
Good idea. Sorta ties in with #176 which I haven't gotten around to yet. Wondering if we should add this as a prompt ("Initialise a Git repository for the project? [yes]"). |
Prompting the user is a great idea. I've updated the pull request with it as well changing the config key name to 'request_git'. That way it won't prompt if a user has already explicitly marked wanting git. |
Making a commit when packaging is a bit out of scope of the initial proposal. This affects the creation of a project, making changes only to |
@andrewwiik adding to what @uroboro said, I feel that the FINALPACKAGE detection idea may be a bit intrusive, because if you were to repeat the same make command multiple times it would unintentionally result in several commits. |
} else { | ||
# Probably don't want to prompt for git in subproject. Only if user has already requested | ||
# git in the config do we add this commit message otherwise we don't know if git is setup | ||
if($requestsGit) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps you could also run git add
if the main project already has a git repository.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i.e. if $requestsGit
is true or .git/
exists
@andrewwiik, (I guess you deleted your comments…) I'd rather Theos not be super intrusive/opinionated on things like whether you should have CI, which CI provider to use, etc. (Also we're not really well-suited for CI at this point, and Travis's macOS VMs are quite slow to start as compared to their Linux ones Nice to have but I removed it from TypeStatus after a while because it was just another worry for a solo-maintainer project.) Assuming you want a Git repo is still a bit intrusive/opinionated but at least it's common and useful enough that we might as well offer it to save you a few seconds. I'm thinking NIC could do with a |
Allow users to add init_git to their ~/.nirc configuration to have a git repository initialized during setup.
What does this implement/fix? Explain your changes.
This implements initializing a git repository for the created project if the user has enabled 'init_git' in ~/.nirc
Does this close any currently open issues?
Not that I've seen
…
Any relevant logs, error output, etc?
Any other comments?
Where has this been tested?
Operating System: macOS 10.13.2
Toolchain Version: … Xcode 9
SDK Version: … 10.3