Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@apexdevtools/git-ops

Package Overview
Dependencies
Maintainers
0
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@apexdevtools/git-ops

Library to do git operations to find changed files in a given git repository

  • 1.4.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

git-ops

Library to do git operations to find changed files in a given git repository.

Prerequisite

Minimum git version of 2.20.0 must already be installed on the host machine.

Getting Started

To build run

pnpm install
pnpm build

Jest unit tests can be run with

pnpm test

 Usage

Prerequisite: The head mus tbe set on the repo otherwise any functions using default branch will fail

Installation

npm i @apexdevtools/git-ops

Finding changed files

Getting changed files using the default branch in that repo given a ref. This finds the default branch in the repo using git symbolic-ref 'refs/remotes/origin/HEAD' so the HEAD must be set. The output of the command is same as running git diff branchName...ref combined with git status.

Note: files with the status of deleted (D) and ignored (!) will not be included in the change set.

getDefaultBranchDiffByRef

Works out changed files using the default branch in that repo given a ref. This find the default branch in the repo using git symbolic-ref 'refs/remotes/origin/HEAD' so the HEAD must be set. The output of the command is same as running git diff branchName...ref combined with git status.

Files with the status of deleted (D) and ignored (!) will not be included in the change set.

getDefaultBranchDiffByRef(repoDir: string, ref: string): Promise<Set<string>>

getDefaultBranchDiff

This command is same as calling getDefaultBranchDiffByRef(repoRootDir, 'HEAD').

getDefaultBranchDiff(repoDir: string): Promise<Set<string>>

getDiffRange

Works out the diff between a given range. Equivalent to git diff ref1...ref2

getDiffRange(dir: string, fromRef: string, toRef: string): Promise<Set<string>>

getLocalChanges

Get the local changes that not have been committed. Equivalent to git status

Files with the status of deleted (D) and ignored (!) will not be included in the change set

getLocalChanges(dir: string): Promise<Set<string>>

Keywords

FAQs

Package last updated on 22 Nov 2024

Did you know?

Socket

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.

Install

Related posts

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