Skip to content

Commit

Permalink
Merge pull request #1438 from luzpaz/typos
Browse files Browse the repository at this point in the history
Fix various typos
  • Loading branch information
Byron authored May 7, 2022
2 parents b3166ec + dde3a8b commit b30720e
Show file tree
Hide file tree
Showing 23 changed files with 33 additions and 33 deletions.
6 changes: 3 additions & 3 deletions doc/source/changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ https://github.com/gitpython-developers/gitpython/milestone/53?closed=1

- Make Protocol classes ABCs at runtime due to new behaviour/bug in 3.9.7 & 3.10.0-rc1

- Remove use of typing.TypeGuard until later release, to allow dependant libs time to update.
- Remove use of typing.TypeGuard until later release, to allow dependent libs time to update.

- Tracking issue: https://github.com/gitpython-developers/GitPython/issues/1095

Expand Down Expand Up @@ -134,7 +134,7 @@ https://github.com/gitpython-developers/gitpython/milestone/48?closed=1
3.1.15 (YANKED)
===============

* add deprectation warning for python 3.5
* add deprecation warning for python 3.5

See the following for details:
https://github.com/gitpython-developers/gitpython/milestone/47?closed=1
Expand Down Expand Up @@ -595,7 +595,7 @@ It follows the `semantic version scheme <http://semver.org>`_, and thus will not
- Renamed `ignore_tree_extension_data` keyword argument in `IndexFile.write(...)` to `ignore_extension_data`
* If the git command executed during `Remote.push(...)|fetch(...)` returns with an non-zero exit code and GitPython didn't
obtain any head-information, the corresponding `GitCommandError` will be raised. This may break previous code which expected
these operations to never raise. However, that behavious is undesirable as it would effectively hide the fact that there
these operations to never raise. However, that behaviour is undesirable as it would effectively hide the fact that there
was an error. See `this issue <https://github.com/gitpython-developers/GitPython/issues/271>`__ for more information.

* If the git executable can't be found in the PATH or at the path provided by `GIT_PYTHON_GIT_EXECUTABLE`, this is made
Expand Down
2 changes: 1 addition & 1 deletion git/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@


class MetaParserBuilder(abc.ABCMeta):
"""Utlity class wrapping base-class methods into decorators that assure read-only properties"""
"""Utility class wrapping base-class methods into decorators that assure read-only properties"""
def __new__(cls, name: str, bases: Tuple, clsdict: Dict[str, Any]) -> 'MetaParserBuilder':
"""
Equip all base-class methods with a needs_values decorator, and all non-const methods
Expand Down
8 changes: 4 additions & 4 deletions git/index/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ def _process_diff_args(self, # type: ignore[override]
def _to_relative_path(self, path: PathLike) -> PathLike:
"""
:return: Version of path relative to our git directory or raise ValueError
if it is not within our git direcotory"""
if it is not within our git directory"""
if not osp.isabs(path):
return path
if self.repo.bare:
Expand Down Expand Up @@ -682,7 +682,7 @@ def add(self, items: Sequence[Union[PathLike, Blob, BaseIndexEntry, 'Submodule']
into the object database.
PathStrings may contain globs, such as 'lib/__init__*' or can be directories
like 'lib', the latter ones will add all the files within the dirctory and
like 'lib', the latter ones will add all the files within the directory and
subdirectories.
This equals a straight git-add.
Expand Down Expand Up @@ -779,7 +779,7 @@ def add(self, items: Sequence[Union[PathLike, Blob, BaseIndexEntry, 'Submodule']
"At least one Entry has a null-mode - please use index.remove to remove files for clarity")
# END null mode should be remove

# HANLDE ENTRY OBJECT CREATION
# HANDLE ENTRY OBJECT CREATION
# create objects if required, otherwise go with the existing shas
null_entries_indices = [i for i, e in enumerate(entries) if e.binsha == Object.NULL_BIN_SHA]
if null_entries_indices:
Expand Down Expand Up @@ -813,7 +813,7 @@ def handle_null_entries(self: 'IndexFile') -> None:
fprogress(entry.path, False, entry)
fprogress(entry.path, True, entry)
# END handle progress
# END for each enty
# END for each entry
entries_added.extend(entries)
# END if there are base entries

Expand Down
2 changes: 1 addition & 1 deletion git/index/fun.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ def write_tree_from_cache(entries: List[IndexEntry], odb: 'GitCmdObjectDB', sl:

# finally create the tree
sio = BytesIO()
tree_to_stream(tree_items, sio.write) # writes to stream as bytes, but doesnt change tree_items
tree_to_stream(tree_items, sio.write) # writes to stream as bytes, but doesn't change tree_items
sio.seek(0)

istream = odb.store(IStream(str_tree_type, len(sio.getvalue()), sio))
Expand Down
2 changes: 1 addition & 1 deletion git/objects/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
# --------------------------------------------------------------------------


_assertion_msg_format = "Created object %r whose python type %r disagrees with the acutual git object type %r"
_assertion_msg_format = "Created object %r whose python type %r disagrees with the actual git object type %r"

__all__ = ("Object", "IndexObject")

Expand Down
4 changes: 2 additions & 2 deletions git/objects/commit.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ def trailers(self) -> Dict:
Git messages can contain trailer information that are similar to RFC 822
e-mail headers (see: https://git-scm.com/docs/git-interpret-trailers).
This funcions calls ``git interpret-trailers --parse`` onto the message
This functions calls ``git interpret-trailers --parse`` onto the message
to extract the trailer information. The key value pairs are stripped of
leading and trailing whitespaces before they get saved into a dictionary.
Expand Down Expand Up @@ -461,7 +461,7 @@ def create_from_tree(cls, repo: 'Repo', tree: Union[Tree, str], message: str,
# * Environment variables override configuration values
# * Sensible defaults are set according to the git documentation

# COMMITER AND AUTHOR INFO
# COMMITTER AND AUTHOR INFO
cr = repo.config_reader()
env = os.environ

Expand Down
2 changes: 1 addition & 1 deletion git/objects/submodule/root.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ def update(self, previous_commit: Union[Commit_ish, None] = None,
sm.update(recursive=False, init=init, to_latest_revision=to_latest_revision,
progress=progress, dry_run=dry_run, force=force_reset, keep_going=keep_going)

# update recursively depth first - question is which inconsitent
# update recursively depth first - question is which inconsistent
# state will be better in case it fails somewhere. Defective branch
# or defective depth. The RootSubmodule type will never process itself,
# which was done in the previous expression
Expand Down
4 changes: 2 additions & 2 deletions git/objects/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
from .submodule.base import Submodule
from git.types import Protocol, runtime_checkable
else:
# Protocol = Generic[_T] # NNeeded for typing bug #572?
# Protocol = Generic[_T] # Needed for typing bug #572?
Protocol = ABC

def runtime_checkable(f):
Expand Down Expand Up @@ -359,7 +359,7 @@ def _list_traverse(self, as_edge: bool = False, *args: Any, **kwargs: Any
out: IterableList[Union['Commit', 'Submodule', 'Tree', 'Blob']] = IterableList(id)
out.extend(self.traverse(as_edge=as_edge, *args, **kwargs))
return out
# overloads in subclasses (mypy does't allow typing self: subclass)
# overloads in subclasses (mypy doesn't allow typing self: subclass)
# Union[IterableList['Commit'], IterableList['Submodule'], IterableList[Union['Submodule', 'Tree', 'Blob']]]
else:
# Raise deprecationwarning, doesn't make sense to use this
Expand Down
2 changes: 1 addition & 1 deletion git/refs/symbolic.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ def set_reference(self, ref: Union[Commit_ish, 'SymbolicReference', str],
logmsg: Union[str, None] = None) -> 'SymbolicReference':
"""Set ourselves to the given ref. It will stay a symbol if the ref is a Reference.
Otherwise an Object, given as Object instance or refspec, is assumed and if valid,
will be set which effectively detaches the refererence if it was a purely
will be set which effectively detaches the reference if it was a purely
symbolic one.
:param ref: SymbolicReference instance, Object instance or refspec string
Expand Down
4 changes: 2 additions & 2 deletions git/refs/tag.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class TagReference(Reference):
_common_path_default = Reference._common_path_default + "/" + _common_default

@property
def commit(self) -> 'Commit': # type: ignore[override] # LazyMixin has unrelated comit method
def commit(self) -> 'Commit': # type: ignore[override] # LazyMixin has unrelated commit method
""":return: Commit object the tag ref points to
:raise ValueError: if the tag points to a tree or blob"""
Expand Down Expand Up @@ -91,7 +91,7 @@ def create(cls: Type['TagReference'], repo: 'Repo', path: PathLike,
:param message:
Synonym for :param logmsg:
Included for backwards compatability. :param logmsg is used in preference if both given.
Included for backwards compatibility. :param logmsg is used in preference if both given.
:param force:
If True, to force creation of a tag even though that tag already exists.
Expand Down
4 changes: 2 additions & 2 deletions git/repo/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,7 @@ def is_dirty(self, index: bool = True, working_tree: bool = True, untracked_file
index or the working copy have changes."""
if self._bare:
# Bare repositories with no associated working directory are
# always consired to be clean.
# always considered to be clean.
return False

# start from the one which is fastest to evaluate
Expand Down Expand Up @@ -760,7 +760,7 @@ def _get_untracked_files(self, *args: Any, **kwargs: Any) -> List[str]:
untracked_files=True,
as_process=True,
**kwargs)
# Untracked files preffix in porcelain mode
# Untracked files prefix in porcelain mode
prefix = "?? "
untracked_files = []
for line in proc.stdout:
Expand Down
2 changes: 1 addition & 1 deletion git/repo/fun.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ def rev_parse(repo: 'Repo', rev: str) -> Union['Commit', 'Tag', 'Tree', 'Blob']:
# END handle tag
elif token == '@':
# try single int
assert ref is not None, "Requre Reference to access reflog"
assert ref is not None, "Require Reference to access reflog"
revlog_index = None
try:
# transform reversed index into the format of our revlog
Expand Down
2 changes: 1 addition & 1 deletion git/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@

def assert_never(inp: NoReturn, raise_error: bool = True, exc: Union[Exception, None] = None) -> None:
"""For use in exhaustive checking of literal or Enum in if/else chain.
Should only be reached if all memebers not handled OR attempt to pass non-members through chain.
Should only be reached if all members not handled OR attempt to pass non-members through chain.
If all members handled, type is Empty. Otherwise, will cause mypy error.
If non-members given, should cause mypy error at variable creation.
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[tool.pytest.ini_options]
python_files = 'test_*.py'
testpaths = 'test' # space seperated list of paths from root e.g test tests doc/testing
testpaths = 'test' # space separated list of paths from root e.g test tests doc/testing
addopts = '--cov=git --cov-report=term --maxfail=10 --force-sugar --disable-warnings'
filterwarnings = 'ignore::DeprecationWarning'
# --cov coverage
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/diff_p
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ index 1d5251d40fb65ac89184ec662a3e1b04d0c24861..98eeddda5ed2b0e215e21128112393bd
self.git_dir = git_dir
end

- # Converstion hash from Ruby style options to git command line
- # Conversion hash from Ruby style options to git command line
- # style options
- TRANSFORM = {:max_count => "--max-count=",
- :skip => "--skip=",
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/git_config
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
[branch "mainline_performance"]
remote = mainline
merge = refs/heads/master
# section with value defined before include to be overriden
# section with value defined before include to be overridden
[sec]
var0 = value0_main
[include]
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/rev_list_bisect_all
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ committer David Aguilar <[email protected]> 1220418344 -0700
commit: handle --bisect-all output in Commit.list_from_string

Rui Abreu Ferrerira pointed out that "git rev-list --bisect-all"
returns a slightly different format which we can easily accomodate
returns a slightly different format which we can easily accommodate
by changing the way we parse rev-list output.

http://groups.google.com/group/git-python/browse_thread/thread/aed1d5c4b31d5027
Expand Down
2 changes: 1 addition & 1 deletion test/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def test_base(self):
assert num_sections and num_options
assert r_config._is_initialized is True

# get value which doesnt exist, with default
# get value which doesn't exist, with default
default = "my default value"
assert r_config.get_value("doesnt", "exist", default) == default

Expand Down
2 changes: 1 addition & 1 deletion test/test_diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ def test_diff_unsafe_paths(self):
self.assertEqual(res[13].b_path, 'b/"with even more quotes"')

def test_diff_patch_format(self):
# test all of the 'old' format diffs for completness - it should at least
# test all of the 'old' format diffs for completeness - it should at least
# be able to deal with it
fixtures = ("diff_2", "diff_2f", "diff_f", "diff_i", "diff_mode_only",
"diff_new_mode", "diff_numstat", "diff_p", "diff_rename",
Expand Down
2 changes: 1 addition & 1 deletion test/test_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def update(self, op_code, cur_count, max_count=None, message=''):
for fetch_info in origin.fetch(progress=MyProgressPrinter()):
print("Updated %s to %s" % (fetch_info.ref, fetch_info.commit))
# create a local branch at the latest fetched master. We specify the name statically, but you have all
# information to do it programatically as well.
# information to do it programmatically as well.
bare_master = bare_repo.create_head('master', origin.refs.master)
bare_repo.head.set_reference(bare_master)
assert not bare_repo.delete_remote(origin).exists()
Expand Down
2 changes: 1 addition & 1 deletion test/test_git.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def test_cmd_override(self):
prev_cmd = self.git.GIT_PYTHON_GIT_EXECUTABLE
exc = GitCommandNotFound
try:
# set it to something that doens't exist, assure it raises
# set it to something that doesn't exist, assure it raises
type(self.git).GIT_PYTHON_GIT_EXECUTABLE = osp.join(
"some", "path", "which", "doesn't", "exist", "gitbinary")
self.assertRaises(exc, self.git.version)
Expand Down
2 changes: 1 addition & 1 deletion test/test_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -936,4 +936,4 @@ def test_commit_msg_hook_fail(self, rw_repo):
self.assertEqual(err.stderr, "\n stderr: 'stderr\n'")
assert str(err)
else:
raise AssertionError("Should have cought a HookExecutionError")
raise AssertionError("Should have caught a HookExecutionError")
4 changes: 2 additions & 2 deletions test/test_submodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ def test_root_module(self, rwrepo):
assert nsm.module().head.commit.hexsha == nsm.hexsha
nsm.module().index.add([nsm])
nsm.module().index.commit("added new file")
rm.update(recursive=False, dry_run=True, progress=prog) # would not change head, and thus doens't fail
rm.update(recursive=False, dry_run=True, progress=prog) # would not change head, and thus doesn't fail
# Everything we can do from now on will trigger the 'future' check, so no is_dirty() check will even run
# This would only run if our local branch is in the past and we have uncommitted changes

Expand Down Expand Up @@ -730,7 +730,7 @@ def test_git_submodules_and_add_sm_with_new_commit(self, rwdir):
assert parent.head.commit.tree[sm.path].binsha == sm.binsha
assert sm_too.binsha == sm.binsha, "cached submodule should point to the same commit as updated one"

added_bies = parent.index.add([sm]) # addded base-index-entries
added_bies = parent.index.add([sm]) # added base-index-entries
assert len(added_bies) == 1
parent.index.commit("add same submodule entry")
commit_sm = parent.head.commit.tree[sm.path]
Expand Down

0 comments on commit b30720e

Please sign in to comment.