gajus / gitinfo Goto Github PK
View Code? Open in Web Editor NEWGets information about a Git repository.
License: Other
Gets information about a Git repository.
License: Other
Remove "jshint" dev dependency from package.json and the gulp task.
sh:
npm install gulp-eslint --save-dev
gulpfile.js:
var eslint = require('gulp-eslint');
gulp.task('lint', function () {
return gulp
.src(['./src/*.js', './src/cinemas/*/*.js', './tests/*.js'])
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failOnError());
});
.eslintrc:
{
"rules": {
"no-console": 0,
"no-extra-parens": 2,
"no-reserved-keys": 2,
"no-eq-null": 2,
"no-extend-native": 2,
"no-process-env": 2,
"no-self-compare": 2,
"no-void": 2,
"no-warning-comments": [1, { "terms": ["todo", "@toto"], "location": "start" }],
"vars-on-top": 2,
"wrap-iife": [2, "inside"],
"global-strict": [2, "always"],
"new-cap": 0,
"no-shadow": 0,
"no-mixed-requires": 0,
"no-new-require": 2,
"brace-style": [2, "1tbs"],
"comma-style": [2, "last"],
"func-style": [2, "expression"],
"no-inline-comments": 2,
"no-lonely-if": 2,
"no-multiple-empty-lines": 2,
"no-nested-ternary": 2,
"one-var": 2,
"operator-assignment": [2, "always"],
"padded-blocks": [2, "never"],
"quote-props": [2, "as-needed"],
"quotes": [2, "single"],
"space-after-keywords": [2, "always"],
"space-before-blocks": [2, "always"],
"space-in-brackets": [2, "never"],
"space-in-parens": [2, "never"],
"space-unary-ops": [2, { "words": true, "nonwords": false }],
"spaced-line-comment": [2, "always"],
},
"env":{
"mocha": true,
"node": true
}
}
@gajus can you publish the latest changes to npm?
It looks like there is no usage of shelljs in the code anymore. It should be removed from the dependencies in package.json
Hi Gajus,
Thanks for the work on this repo, it is becoming quite useful.
I have detected that when we are checked out at a commit hash, the following methods throw an exception:
gitinfo.getBranchName();
gitinfo.getHeadSha();
I thinks that there should be some basic examples in the README
file
.getRemoteUrl() fails if the local branch is not set to track a remote branch.
Which means this fails unless it has an upstream branch
require('gitinfo')()
I assume there maybe other usecases like mine where branch tracking is irrelevant (I'm only after remote repo name and user)
Interesting in we adding something like ?
const gitInfo = require('gitinfo')({
defaultBranch: 'master'
});
Or we could make it automatically fallback to master
.
This way we could fallback to master if no branch is found in the config, get around the 'Branch ("' + branchName + '") definition does not exist in the config.'
error?
Assume no compilation is involved in a project, this is the case for example in .nuproj projets.
When the project references the GitInfo nuget package, the targets (GitInfo
, GetVersion
, etc.) are not executed. However, it would be nice to also access git information properties in .nuproj files that only contain metadata such as targets files and do not produce any assembly.
Git information retrieval currently only occurs only when compilation occurs, as
shown in the lines below extracted from GitInfo.targets
<CoreCompileDependsOn>
GitInfo;
GitVersion;
GitThisAssembly;
GitInfoReport;
$(CoreCompileDependsOn)
</CoreBuildDependsOn>
The property above could be changed into something like CoreBuildDependsOn
.
Or is there any specific reason for using CoreCompileDependsOn
?
As developer I would like to have ability to pass branch
(and some parameters) parameter in addition to gitPath
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.