FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

RFE: Give Commit objects a replace method that returns new Commit with modified attributes · Issue #1123 · gitpython-developers/GitPython · GitHub

Repository navigation

RFE: Give Commit objects a replace method that returns new Commit with modified attributes #1123

Closed

Description

The datetime objects produced by Python's datetime module are immutable, much like Commit objects. The datetime module provides a convenient replace function that returns a new object based on an old with one or more attributes replaced. E.g, I can write:

>>> d = datetime.datetime.now()
>>> d.replace(hour=0, minute=0, second=0)
datetime.datetime(2021, 2, 15, 0, 0, 0, 318021)

I would like to see the same api on Commit objects, so that one could write:

>>> newcommit = oldcommit.replace(message='This is a test', author='Cookie Monster')

Activity

  1. added 4 commits that reference this issue on Feb 15, 2021
    2a20f74
    826cf16
    e661b1b
    36811a2
  2. added this to the v3.1.14 - Bugfixes milestone on Feb 17, 2021
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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL