Skip to content

Commit e87d3d7

Browse files
committed
Make comments more consistent and clarify license
This improves the consistency of top-of-module comments as follows: - All names of the current file are removed. Some included these while others didn't. In general, this can be useful information, which can remind readers and developers of what the file is and may even reduce mistakes. However, in GitPython, many modules inside git/ have the same name as other modules in other subdirectories of git/. So the presence of filenames would often be the same for multiple files, a condition that would be intensified if consistency were achieved by adding them everywhere. This instead removes them, which should (albeit slightly) decrease the risk of confusing modules that have the same name as each other. - All modules (.py files) inside git/ and test/, except for .py files that are entirely empty (without even comments) or are inside test/fixtures/, now have comments indicating the license and linking to it on opensource.org. Previously, some modules had this, while others did not. The comment about the license is short, and does not contain an explicit copyright statement. No new explicit copyright statements are added, but some top-of-modules already contained them, and this does not remove (nor update or otherwise modify) them. Although explicit copyright statements are not touched, all the license comments are modified, including where they had previously appeared, to say "the 3-Clause BSD License" instead of "the BSD License", since there is no specific license known as the "BSD License" (and both the 2-clause and 3-clause BSD licenses are very popular). This change should not be confused with #1662, which fixed an originally correct hyperlink that had come to redirect to a page about a different license. The change here does not change the link again. It makes the commented wording more specific, so that it is clear, even without looking at the link, which BSD license is being referred to.
1 parent 340da6d commit e87d3d7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+167
-119
lines changed

Diff for: git/__init__.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
# __init__.py
21
# Copyright (C) 2008, 2009 Michael Trier ([email protected]) and contributors
32
#
4-
# This module is part of GitPython and is released under
5-
# the BSD License: https://opensource.org/license/bsd-3-clause/
3+
# This module is part of GitPython and is released under the
4+
# 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/
65

76
# flake8: noqa
87
# @PydevCodeAnalysisIgnore

Diff for: git/cmd.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
# cmd.py
21
# Copyright (C) 2008, 2009 Michael Trier ([email protected]) and contributors
32
#
4-
# This module is part of GitPython and is released under
5-
# the BSD License: https://opensource.org/license/bsd-3-clause/
3+
# This module is part of GitPython and is released under the
4+
# 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/
65

76
from __future__ import annotations
87

Diff for: git/compat.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
# compat.py
21
# Copyright (C) 2008, 2009 Michael Trier ([email protected]) and contributors
32
#
4-
# This module is part of GitPython and is released under
5-
# the BSD License: https://opensource.org/license/bsd-3-clause/
3+
# This module is part of GitPython and is released under the
4+
# 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/
65

76
"""Utilities to help provide compatibility with Python 3."""
87

Diff for: git/config.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
# config.py
21
# Copyright (C) 2008, 2009 Michael Trier ([email protected]) and contributors
32
#
4-
# This module is part of GitPython and is released under
5-
# the BSD License: https://opensource.org/license/bsd-3-clause/
3+
# This module is part of GitPython and is released under the
4+
# 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/
65

76
"""Module containing module parser implementation able to properly read and write
87
configuration files."""

Diff for: git/db.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# This module is part of GitPython and is released under the
2+
# 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/
3+
14
"""Module with our own gitdb implementation - it uses the git command."""
25

36
from git.util import bin_to_hex, hex_to_bin

Diff for: git/diff.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
# diff.py
21
# Copyright (C) 2008, 2009 Michael Trier ([email protected]) and contributors
32
#
4-
# This module is part of GitPython and is released under
5-
# the BSD License: https://opensource.org/license/bsd-3-clause/
3+
# This module is part of GitPython and is released under the
4+
# 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/
65

76
import re
87
from git.cmd import handle_process_output

Diff for: git/exc.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
# exc.py
21
# Copyright (C) 2008, 2009 Michael Trier ([email protected]) and contributors
32
#
4-
# This module is part of GitPython and is released under
5-
# the BSD License: https://opensource.org/license/bsd-3-clause/
3+
# This module is part of GitPython and is released under the
4+
# 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/
65

76
"""Module containing all exceptions thrown throughout the git package."""
87

Diff for: git/index/__init__.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# This module is part of GitPython and is released under the
2+
# 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/
3+
14
"""Initialize the index package."""
25

36
# flake8: noqa

Diff for: git/index/base.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
# base.py
21
# Copyright (C) 2008, 2009 Michael Trier ([email protected]) and contributors
32
#
4-
# This module is part of GitPython and is released under
5-
# the BSD License: https://opensource.org/license/bsd-3-clause/
3+
# This module is part of GitPython and is released under the
4+
# 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/
65

76
from contextlib import ExitStack
87
import datetime

Diff for: git/index/fun.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# This module is part of GitPython and is released under the
2+
# 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/
3+
14
# Standalone functions to accompany the index implementation and make it more versatile.
25
# NOTE: Autodoc hates it if this is a docstring.
36

Diff for: git/index/typ.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# This module is part of GitPython and is released under the
2+
# 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/
3+
14
"""Module with additional types used by the index."""
25

36
from binascii import b2a_hex

Diff for: git/index/util.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# This module is part of GitPython and is released under the
2+
# 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/
3+
14
"""Module containing index utilities."""
25

36
from functools import wraps

Diff for: git/objects/__init__.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# This module is part of GitPython and is released under the
2+
# 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/
3+
14
"""Import all submodules' main classes into the package space."""
25

36
# flake8: noqa

Diff for: git/objects/base.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
# base.py
21
# Copyright (C) 2008, 2009 Michael Trier ([email protected]) and contributors
32
#
4-
# This module is part of GitPython and is released under
5-
# the BSD License: https://opensource.org/license/bsd-3-clause/
3+
# This module is part of GitPython and is released under the
4+
# 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/
65

76
from git.exc import WorkTreeRepositoryUnsupported
87
from git.util import LazyMixin, join_path_native, stream_copy, bin_to_hex

Diff for: git/objects/blob.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
# blob.py
21
# Copyright (C) 2008, 2009 Michael Trier ([email protected]) and contributors
32
#
4-
# This module is part of GitPython and is released under
5-
# the BSD License: https://opensource.org/license/bsd-3-clause/
3+
# This module is part of GitPython and is released under the
4+
# 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/
65

76
from mimetypes import guess_type
87
from . import base

Diff for: git/objects/commit.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
# commit.py
21
# Copyright (C) 2008, 2009 Michael Trier ([email protected]) and contributors
32
#
4-
# This module is part of GitPython and is released under
5-
# the BSD License: https://opensource.org/license/bsd-3-clause/
3+
# This module is part of GitPython and is released under the
4+
# 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/
65

76
import datetime
87
import re

Diff for: git/objects/fun.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# This module is part of GitPython and is released under the
2+
# 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/
3+
14
"""Module with functions which are supposed to be as fast as possible."""
25

36
from stat import S_ISDIR

Diff for: git/objects/submodule/__init__.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1+
# This module is part of GitPython and is released under the
2+
# 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/
3+
14
# NOTE: Cannot import anything here as the top-level __init__ has to handle
25
# our dependencies.

Diff for: git/objects/submodule/base.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# This module is part of GitPython and is released under the
2+
# 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/
3+
14
from io import BytesIO
25
import logging
36
import os

Diff for: git/objects/submodule/root.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# This module is part of GitPython and is released under the
2+
# 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/
3+
14
from .base import Submodule, UpdateProgress
25
from .util import find_first_remote_branch
36
from git.exc import InvalidGitRepositoryError

Diff for: git/objects/submodule/util.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# This module is part of GitPython and is released under the
2+
# 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/
3+
14
import git
25
from git.exc import InvalidGitRepositoryError
36
from git.config import GitConfigParser

Diff for: git/objects/tag.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
# tag.py
21
# Copyright (C) 2008, 2009 Michael Trier ([email protected]) and contributors
32
#
4-
# This module is part of GitPython and is released under
5-
# the BSD License: https://opensource.org/license/bsd-3-clause/
3+
# This module is part of GitPython and is released under the
4+
# 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/
65

76
"""Module containing all Object-based types."""
87

Diff for: git/objects/tree.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
# tree.py
21
# Copyright (C) 2008, 2009 Michael Trier ([email protected]) and contributors
32
#
4-
# This module is part of GitPython and is released under
5-
# the BSD License: https://opensource.org/license/bsd-3-clause/
3+
# This module is part of GitPython and is released under the
4+
# 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/
65

76
from git.util import IterableList, join_path
87
import git.diff as git_diff

Diff for: git/objects/util.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
# util.py
21
# Copyright (C) 2008, 2009 Michael Trier ([email protected]) and contributors
32
#
4-
# This module is part of GitPython and is released under
5-
# the BSD License: https://opensource.org/license/bsd-3-clause/
3+
# This module is part of GitPython and is released under the
4+
# 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/
65

76
"""Module for general utility functions."""
87

Diff for: git/refs/__init__.py

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1+
# This module is part of GitPython and is released under the
2+
# 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/
3+
14
# flake8: noqa
25
# Import all modules in order, fix the names they require.
6+
37
from .symbolic import *
48
from .reference import *
59
from .head import *

Diff for: git/refs/head.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# This module is part of GitPython and is released under the
2+
# 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/
3+
14
from git.config import GitConfigParser, SectionConstraint
25
from git.util import join_path
36
from git.exc import GitCommandError

Diff for: git/refs/log.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# This module is part of GitPython and is released under the
2+
# 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/
3+
14
from mmap import mmap
25
import re
36
import time as _time

Diff for: git/refs/reference.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# This module is part of GitPython and is released under the
2+
# 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/
3+
14
from git.util import (
25
LazyMixin,
36
IterableObj,

Diff for: git/refs/remote.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# This module is part of GitPython and is released under the
2+
# 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/
3+
14
import os
25

36
from git.util import join_path

Diff for: git/refs/symbolic.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# This module is part of GitPython and is released under the
2+
# 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/
3+
14
from git.types import PathLike
25
import os
36

Diff for: git/refs/tag.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# This module is part of GitPython and is released under the
2+
# 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/
3+
14
from .reference import Reference
25

36
__all__ = ["TagReference", "Tag"]

Diff for: git/remote.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
# remote.py
21
# Copyright (C) 2008, 2009 Michael Trier ([email protected]) and contributors
32
#
4-
# This module is part of GitPython and is released under
5-
# the BSD License: https://opensource.org/license/bsd-3-clause/
3+
# This module is part of GitPython and is released under the
4+
# 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/
65

76
"""Module implementing a remote object allowing easy access to git remotes."""
87

Diff for: git/repo/__init__.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# This module is part of GitPython and is released under the
2+
# 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/
3+
14
"""Initialize the Repo package."""
25

36
# flake8: noqa

Diff for: git/repo/base.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
# base.py
21
# Copyright (C) 2008, 2009 Michael Trier ([email protected]) and contributors
32
#
4-
# This module is part of GitPython and is released under
5-
# the BSD License: https://opensource.org/license/bsd-3-clause/
3+
# This module is part of GitPython and is released under the
4+
# 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/
65

76
from __future__ import annotations
87

Diff for: git/repo/fun.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# This module is part of GitPython and is released under the
2+
# 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/
3+
14
"""Module with general repository-related functions."""
25

36
from __future__ import annotations

Diff for: git/types.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# This module is part of GitPython and is released under
2-
# the BSD License: https://opensource.org/license/bsd-3-clause/
1+
# This module is part of GitPython and is released under the
2+
# 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/
33

44
# flake8: noqa
55

Diff for: git/util.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
# util.py
21
# Copyright (C) 2008, 2009 Michael Trier ([email protected]) and contributors
32
#
4-
# This module is part of GitPython and is released under
5-
# the BSD License: https://opensource.org/license/bsd-3-clause/
3+
# This module is part of GitPython and is released under the
4+
# 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/
65

76
from abc import abstractmethod
87
import contextlib

Diff for: test/__init__.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
# __init__.py
21
# Copyright (C) 2008, 2009 Michael Trier ([email protected]) and contributors
32
#
4-
# This module is part of GitPython and is released under
5-
# the BSD License: https://opensource.org/license/bsd-3-clause/
3+
# This module is part of GitPython and is released under the
4+
# 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/

Diff for: test/lib/__init__.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
# __init__.py
21
# Copyright (C) 2008, 2009 Michael Trier ([email protected]) and contributors
32
#
4-
# This module is part of GitPython and is released under
5-
# the BSD License: https://opensource.org/license/bsd-3-clause/
3+
# This module is part of GitPython and is released under the
4+
# 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/
65

76
# flake8: noqa
87
import inspect

Diff for: test/lib/helper.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
# helper.py
21
# Copyright (C) 2008, 2009 Michael Trier ([email protected]) and contributors
32
#
4-
# This module is part of GitPython and is released under
5-
# the BSD License: https://opensource.org/license/bsd-3-clause/
3+
# This module is part of GitPython and is released under the
4+
# 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/
65

76
import contextlib
87
from functools import wraps

Diff for: test/performance/lib.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# This module is part of GitPython and is released under the
2+
# 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/
3+
14
"""Support library for tests."""
25

36
import logging

Diff for: test/performance/test_commit.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright (C) 2008, 2009 Michael Trier ([email protected]) and contributors
22
#
3-
# This module is part of GitPython and is released under
4-
# the BSD License: https://opensource.org/license/bsd-3-clause/
3+
# This module is part of GitPython and is released under the
4+
# 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/
55

66
"""Performance tests for commits (iteration, traversal, and serialization)."""
77

Diff for: test/performance/test_odb.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# This module is part of GitPython and is released under the
2+
# 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/
3+
14
"""Performance tests for object store."""
25

36
import sys

Diff for: test/performance/test_streams.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# This module is part of GitPython and is released under the
2+
# 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/
3+
14
"""Performance tests for data streaming."""
25

36
import os

Diff for: test/test_actor.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
# test_actor.py
21
# Copyright (C) 2008, 2009 Michael Trier ([email protected]) and contributors
32
#
4-
# This module is part of GitPython and is released under
5-
# the BSD License: https://opensource.org/license/bsd-3-clause/
3+
# This module is part of GitPython and is released under the
4+
# 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/
65

76
from test.lib import TestBase
87
from git import Actor

0 commit comments

Comments
 (0)