Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/ref/cli.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ Performs a ``git pull`` in each of the repositories registered with `homely
add`_, runs all of their ``HOMELY.py`` scripts, and then performs
:any:`automatic cleanup <automatic_cleanup>` as necessary.

If `HOMELY_PULL_WHEN_DIRTY=1` is present in the environment, then homely will attempt to use `git
pull` in the registered repositories even if they have uncommitted changes. This behaviour will
eventually become the default. You can avoid merge conflicts from pulls in your repositories by
running `git config pull.ff only` in each of your repositories, of using `git config --global
pull.ff only` to set this option globally.

``homely update [OPTIONS] [REPO ...]``

``REPO``
Expand Down
5 changes: 4 additions & 1 deletion homely/_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ def run_update(infos, pullfirst, only=None, cancleanup=None, quick=None):
if os.path.exists(FAILFILE):
os.unlink(FAILFILE)

must_abort_when_dirty = os.getenv("HOMELY_PULL_WHEN_DIRTY", "0") != "1"

try:
# write the section file with the current section name
_write(SECTIONFILE, "<preparing>")
Expand All @@ -157,8 +159,9 @@ def run_update(infos, pullfirst, only=None, cancleanup=None, quick=None):
if pullfirst:
with note("Pulling changes for {}".format(
localrepo.repo_path)):
if localrepo.isdirty():
if must_abort_when_dirty and localrepo.isdirty():
dirty("Aborting - uncommitted changes")
dirty("(use HOMELY_PULL_WHEN_DIRTY=1 to override)")
else:
try:
localrepo.pullchanges()
Expand Down
Loading