Skip to content

Feature Request: Status API #19

Description

@stevenxxiu

Support for the status API would be great.

In Vifm, git status -z . is used to show the state of files in the repo.

Activity

  1. Freed-Wu commented on May 1, 2026

    @Freed-Wu
    Contributor

    I am working for it on my fork because I am not a collaborator

    local git2 = require'git2'
    local repo = git2.Repository.open('/dev/shm/demo')
    local opts = git2.StatusOptions.init()
    opts:set_flags(opts.INCLUDE_UNTRACKED + opts.INCLUDE_UNMODIFIED + opts.RECURSE_UNTRACKED_DIRS + opts.DISABLE_PATHSPEC_MATCH)
    local list = git2.StatusList.new(repo, opts)
    -- C index from 0
    for i = 0, list:entry_count() - 1 do
      local entry = git2.StatusEntry.byindex(list, i)
      print(entry:status())
      -- e.g.,
      -- 768 == entry.WT_DELETED + entry.WT_MODIFIED
      -- means MD
    end

    @ethomson Can you make membership changes to the repo? #14 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions