Skip to content

Commit

Permalink
[ADD] git_trunk: submodule support
Browse files Browse the repository at this point in the history
Introducing git trunk commands support on submodules. It is now possible
to run all commands from submodules just like on main repo.

This makes it easier to work with submodules directly from superproject.

Meaning that user won't need to switch context/projects, separately
develop dependency repository, finish it and then pull changes via
superproject submodule.

[FIX] git_trunk_commands: active_ref_name

Using it be able to always get reference, when needed (when repo might
not be on active branch, but on detached head like tag or raw commit).

[REF] .travis: use unittest over nose

nose package is obsolete now.

[REF] git_trunk: somewhat better typing coverage

[REF] git_trunk: split git_trunk.py

Splitting git_trunk.py for better readability, separating concerns,
reusability.
  • Loading branch information
oerp-odoo committed Nov 3, 2020
1 parent e3788aa commit 364ed4b
Show file tree
Hide file tree
Showing 16 changed files with 952 additions and 668 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@
build/
dist/
MANIFEST
# mypy
.mypy_cache/
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ install:
- "pip install ."

# command to run tests
script: nosetests
script:
- python -m unittest discover -v
5 changes: 5 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ To know what arguments are available and what they do for each command, use :cod

Remote used is identified by your current branch tracking branch remote. If your current branch does not have tracking branch, then trunk branch tracking branch is checked. If trunk branch does not have tracking branch set, then it is assumed no remote is used for :code:`git-trunk` workflow.

Submodules
==========

All possible commands can be used same way as on main superproject repository. Note configuration is still saved on main superproject repository config (submodules do not have git config file), but it is separated by including submodule relative path on sections. E.g. main repository section is named :code:`[trunk]`, where in submodule case, it is named :code:`[trunk "relpath/to/submodule"]`.

init
----

Expand Down
7 changes: 4 additions & 3 deletions bin/git-trunk
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@
import abc
import argparse
from distutils.util import strtobool
from git_trunk.git_trunk import (
GitTrunkConfig,

from git_trunk.git_trunk_config import GitTrunkConfig
from git_trunk.git_trunk_base import DEFAULT_LOG_LEVEL
from git_trunk.git_trunk_commands import (
GitTrunkInit,
GitTrunkStart,
GitTrunkFinish,
GitTrunkRelease,
GitTrunkRefresh,
GitTrunkSquash,
DEFAULT_LOG_LEVEL
)
from git_trunk import __version__

Expand Down
2 changes: 1 addition & 1 deletion git_trunk/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.3.0'
__version__ = '0.4.0'
Loading

0 comments on commit 364ed4b

Please sign in to comment.