3

In git command line, we can use git commit -a.

How can I do that using dulwich?

Determinant
  • 3,886
  • 7
  • 31
  • 47

1 Answers1

1

When considering the various tests for a commit, like those in test_repository.py, it doesn't seem to be possible in one line:

    r.stage(['a'])
    commit_sha = r.do_commit('modified a',
                             committer='Test Committer <test@nodomain.com>',
                             author='Test Author <test@nodomain.com>',
                             commit_timestamp=12395, commit_timezone=0,
                             author_timestamp=12395, author_timezone=0)

You need to find modified or deleted files first, and stage them, before calling the commit.

The other alternative would be to use git-python, which is a wrapper to git, but it doesn't offer either that feature out of the box.

AndyG
  • 39,700
  • 8
  • 109
  • 143
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250