Skip to content

Add functions for working with git repository #3149

@VxDxK

Description

@VxDxK

It can be easily added via libgit to avoid boilerplate scripts like:

# Instead of
@cur-branch:
    echo Current branch is $(git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/')

# Will possible write
@cur-branch:
    echo Current branch is {{git_branch()}}

I suggest next functions:

  1. git_repo - (path to root of current repo)
  2. git_branch - (current branch)
  3. git_revision - (hash of latest commit)
  4. git_tag - (latest tag)
  5. git_is_dirty - (is current branch dirty)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions