add tag / push tags to remote in Python Dulwich
Asked Answered
C

1

1

I like the Dulwich project as it provides pure Python interface to interacting with git.

It looks pretty low-level though... While I couldn't find reference on how to perform simple tasks.
My need's are pretty simple, provide the same as below git CLI commands:

  1. git push --tags --force
  2. git tag --force
  3. git show-ref --tags (provides mapping between tag and the commit it points on)


Update: looks like item #3 is answered here: How to get a list of tags and create new tags with python and dulwich in git? (by Jelmer the creator of Dulwich)

Christychristye answered 9/2, 2020 at 18:10 Comment(0)
D
1

The dulwich.porcelain (https://www.dulwich.io/docs/api/dulwich.porcelain.html#module-dulwich.porcelain) module is somewhat more high level, and should do what you need.

Specifically, the push and tag_create functions. Note that there is currently no force argument since all tag editing is currently done without safety checking.

Dickenson answered 9/2, 2020 at 21:47 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.