Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
git-common-ancestor
Advanced tools
Find the branching point between two points in a git repo. Knowing the branching point is often useful when writing tools that need to look at the changes made on a branch.
For example, if you want to run a linter on all the files that were changed on your branch, you would use this tool to find the point that your branch was created from your main branch and then use git diff
to find the files changed between those revisions.
$ npm install git-common-ancestor --save-dev
var gitCommonAncestor = require('git-common-ancestor');
var sha = '70d708aacad0dcc40346cb15fd05ddb14e8e5f29';
gitCommonAncestor.ofShaAndBranch(sha, 'master')
.then(function(branchPoint) {
assert.strictEqual(branchPoint, '0b256cbf19f306e4fc4090b0b4bec096d1bfd5eb')
});
Calls ofShaAndBranch
passing in the current sha and diffing against the given branch.
var gitCommonAncestor = require('git-common-ancestor');
gitCommonAncestor.fromBranch('master')
.then(function(branchPoint) {
// Where the current sha branched from master
})
> git-common-ancestor --branch master
a061416bb6307cd69f155e6a2ebffe75a5be2624
> git-common-ancestor --sha 92ce1d5 --branch master
f7d7655f237486d52e8b71a8bb701e63121bec9b
FAQs
Get the common ancestor of a sha and a branch
We found that git-common-ancestor demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.