Skip to content
Prev Previous commit
Next Next commit
Fix parse_date docstring spacing; use RFC role
There are only a three cases where a specific RFC is mentioned.
Only one is in parse_date and the others are elsewhere.
  • Loading branch information
EliahKagan committed Mar 16, 2024
commit 6626117259b93d0a3085dd17ed71ef1acd08c7a5
8 changes: 4 additions & 4 deletions git/objects/commit.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,8 +404,8 @@ def trailers(self) -> Dict[str, str]:
def trailers_list(self) -> List[Tuple[str, str]]:
"""Get the trailers of the message as a list.

Git messages can contain trailer information that are similar to RFC 822 e-mail
headers. See :manpage:`git-interpret-trailers(1)`.
Git messages can contain trailer information that are similar to :rfc:`822`
e-mail headers. See :manpage:`git-interpret-trailers(1)`.

This function calls ``git interpret-trailers --parse`` onto the message to
extract the trailer information, returns the raw trailer data as a list.
Expand Down Expand Up @@ -456,8 +456,8 @@ def trailers_list(self) -> List[Tuple[str, str]]:
def trailers_dict(self) -> Dict[str, List[str]]:
"""Get the trailers of the message as a dictionary.

Git messages can contain trailer information that are similar to RFC 822 e-mail
headers. See :manpage:`git-interpret-trailers(1)`.
Git messages can contain trailer information that are similar to :rfc:`822`
e-mail headers. See :manpage:`git-interpret-trailers(1)`.

This function calls ``git interpret-trailers --parse`` onto the message to
extract the trailer information. The key value pairs are stripped of leading and
Expand Down
5 changes: 2 additions & 3 deletions git/objects/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,8 @@ def parse_date(string_date: Union[str, datetime]) -> Tuple[int, int]:

* Aware datetime instance
* Git internal format: timestamp offset
* RFC 2822: ``Thu, 07 Apr 2005 22:13:13 +0200``
* ISO 8601: ``2005-04-07T22:13:13``
The T can be a space as well.
* :rfc:`2822`: ``Thu, 07 Apr 2005 22:13:13 +0200``
* ISO 8601: ``2005-04-07T22:13:13`` - The ``T`` can be a space as well.

:return:
Tuple(int(timestamp_UTC), int(offset)), both in seconds since epoch
Expand Down