Skip to content
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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

CPDigitalDarkroom
Copy link

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

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) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's this &! operator?

Copy link
Author

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.

@kirb
Copy link
Member

kirb commented Jan 24, 2018

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]").

@CPDigitalDarkroom
Copy link
Author

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.

@uroboro
Copy link
Member

uroboro commented Jan 24, 2018

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 nic.pl.

@kabiroberai
Copy link
Member

kabiroberai commented Jan 24, 2018

@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) {
Copy link
Member

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.

Copy link
Member

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

@kirb
Copy link
Member

kirb commented Jan 25, 2018

@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 base.nic.tar that gets processed first so you can add your own personal boilerplate stuff like .travis.yml to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants