You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
(marked WIP until I add appropriate tests)
This adds a replace method to git.Commit. The replace method returns a
copy of the Commit object with attributes replaced from keyword
arguments. For example:
>>> old = repo.head.commit
>>> new = old.replace(message='This is a test')
closesgitpython-developers#1123
larsks
added a commit
to larsks/GitPython
that referenced
this issue
Feb 16, 2021
This adds a replace method to git.Commit. The replace method returns a
copy of the Commit object with attributes replaced from keyword
arguments. For example:
>>> old = repo.head.commit
>>> new = old.replace(message='This is a test')
closesgitpython-developers#1123
larsks
added a commit
to larsks/GitPython
that referenced
this issue
Feb 16, 2021
This adds a replace method to git.Commit. The replace method returns a
copy of the Commit object with attributes replaced from keyword
arguments. For example:
>>> old = repo.head.commit
>>> new = old.replace(message='This is a test')
closesgitpython-developers#1123
@feature/replace
This adds a replace method to git.Commit. The replace method returns a
copy of the Commit object with attributes replaced from keyword
arguments. For example:
>>> old = repo.head.commit
>>> new = old.replace(message='This is a test')
closesgitpython-developers#1123
The
datetime
objects produced by Python'sdatetime
module are immutable, much likeCommit
objects. Thedatetime
module provides a convenientreplace
function that returns a new object based on an old with one or more attributes replaced. E.g, I can write:I would like to see the same api on
Commit
objects, so that one could write:The text was updated successfully, but these errors were encountered: