Giter Club home page Giter Club logo

cake-git-ext-plugin's Introduction

cake-git-ext-plugin

GitHub license

Overview

CakeExt.Git is a set of Cake build script extensions that provide additional functionality for working with Git commands beyond what is included in the Cake.Git extension. These extensions aim to simplify the integration of Git-related tasks, especially for handling of changes between two commits into your Cake build scripts.

Git

Executes a Git command and returns the output as an IEnumerable.

ICakeContext context;

var output = context.Git("your-git-command-here");

GitGetLastCommitMessage

Returns the last commit message as a string.

ICakeContext context;

var lastCommitMessage = context.GitGetLastCommitMessage();

GitGetBranchName

Gets the current branch name.

ICakeContext context;

var branchName = context.GitGetBranchName();

Change Detection

GitMergeBase

Gets the merge base between the current branch and a specified remote branch.

If the current branch is the main branch, the merge base is the latest commit on the remote branch. If the current branch is not the main branch, the merge base is the latest commit on the main branch that is also on the current branch.

ICakeContext context;

var mergeBase = context.GitMergeBase("your-remote", "your-main-branch");

GitRevHead

Gets the revision head commit id.

ICakeContext context;

var revHead = context.GitRevHead();

GitDiff

Gets the filenames of the changes between two commits.

ICakeContext context;

var changes = context.GitDiff("commit-hash-1", "commit-hash-2");

GitGetChanges

Gets the changed files between the current commit and the merge base.

ICakeContext context;

var changes = context.GitGetChanges("your-remote", "your-main-branch");

GitGetChangeMatchPattern

Checks if any of the changed files match a given regex pattern.

ICakeContext context;
var hasMatch = context.GitGetChangeMatchPattern(changes, "your-regex-pattern");

Usage

The package is published to the GitHub Packages NuGet registry. To use the package in your Cake build script project, you must add the GitHub Packages NuGet registry to your Cake build script project's NuGet.config file. For more information, see the following link:

https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-nuget-registry#installing-a-package

Add the CakeExt.Git NuGet package to your Cake build script project.

#addin "nuget:?package=CakeExt.Git"

Import the namespace in your Cake build script.

using CakeExt.Git;

Use the provided aliases in your Cake build script as needed.

License

This project is licensed under the MIT License - see the LICENSE file for details.

cake-git-ext-plugin's People

Contributors

christtian667 avatar hoffmann-joern avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.