Socket
Socket
Sign inDemoInstall

@lerna/describe-ref

Package Overview
Dependencies
Maintainers
2
Versions
61
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lerna/describe-ref - npm Package Compare versions

Comparing version 3.1.0 to 3.3.0

12

CHANGELOG.md

@@ -6,2 +6,14 @@ # Change Log

<a name="3.3.0"></a>
# [3.3.0](https://github.com/lerna/lerna/compare/v3.2.1...v3.3.0) (2018-09-06)
### Bug Fixes
* **describe-ref:** Fallback refCount is the number of commits since beginning of repository ([6dfea52](https://github.com/lerna/lerna/commit/6dfea52))
<a name="3.1.0"></a>

@@ -8,0 +20,0 @@ # [3.1.0](https://github.com/lerna/lerna/compare/v3.0.6...v3.1.0) (2018-08-17)

24

lib/describe-ref.js

@@ -10,3 +10,3 @@ "use strict";

function getArgs(options = {}) {
function getArgs(options) {
const args = [

@@ -31,7 +31,7 @@ "describe",

function describeRef(options) {
function describeRef(options = {}) {
const promise = childProcess.exec("git", getArgs(options), options);
return promise.then(({ stdout }) => {
const result = parse(stdout);
const result = parse(stdout, options);

@@ -45,5 +45,5 @@ log.verbose("git-describe", "%j => %j", options && options.match, stdout);

function sync(options) {
function sync(options = {}) {
const stdout = childProcess.execSync("git", getArgs(options), options);
const result = parse(stdout);
const result = parse(stdout, options);

@@ -56,6 +56,12 @@ // only called by collect-updates with no matcher

function parse(stdout) {
if (/^[0-9a-f]{7,40}$/.test(stdout)) {
// fallback received, can't provide full metadata
return { sha: stdout };
function parse(stdout, options = {}) {
// when git describe fails to locate tags, it returns only the minimal sha
if (/^[0-9a-f]{7,40}/.test(stdout)) {
// repo might still be dirty
const [, sha, isDirty] = /^([0-9a-f]{7,40})(-dirty)?/.exec(stdout);
// count number of commits since beginning of time
const refCount = childProcess.execSync("git", ["rev-list", "--count", sha], options);
return { refCount, sha, isDirty: Boolean(isDirty) };
}

@@ -62,0 +68,0 @@

{
"name": "@lerna/describe-ref",
"version": "3.1.0",
"version": "3.3.0",
"description": "Parse git describe output for lerna-related tags",

@@ -32,6 +32,6 @@ "keywords": [

"dependencies": {
"@lerna/child-process": "^3.0.0",
"@lerna/child-process": "^3.3.0",
"npmlog": "^4.1.2"
},
"gitHead": "7f97c7bca038c690e2dd5d897e222fb5bca0a5e8"
"gitHead": "901e6d54a47151dfed3d6ed2912804b97d05c6b5"
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc