Skip to content

Commit

Permalink
Squashed '.lib/git-fleximod/' changes from 4ff1e98de..25ccc15de
Browse files Browse the repository at this point in the history
25ccc15de Merge tag 'v0.7.8' into tmp-release
8eae7e3 Bump to 0.7.8
34daa06 Merge pull request ESCOMP#46 from ESMCI/add_optional_keyword
af12c80 fix spelling
7ea36dc remove manage_externals error
2ede182 add optional to status output

git-subtree-dir: .lib/git-fleximod
git-subtree-split: 25ccc15de3b2e62554243300e69d44df69a65305
  • Loading branch information
ekluzek committed Jun 13, 2024
1 parent 779c9b5 commit c2f52d1
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 15 deletions.
4 changes: 2 additions & 2 deletions git_fleximod/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import argparse
from git_fleximod import utils

__version__ = "0.7.7"
__version__ = "0.7.8"

def find_root_dir(filename=".gitmodules"):
""" finds the highest directory in tree
Expand All @@ -26,7 +26,7 @@ def find_root_dir(filename=".gitmodules"):

def get_parser():
description = """
%(prog)s manages checking out groups of gitsubmodules with addtional support for Earth System Models
%(prog)s manages checking out groups of gitsubmodules with additional support for Earth System Models
"""
parser = argparse.ArgumentParser(
description=description, formatter_class=argparse.RawDescriptionHelpFormatter
Expand Down
10 changes: 6 additions & 4 deletions git_fleximod/git_fleximod.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,7 @@ def submodules_status(gitmodules, root_dir, toplevel=False):
ahash = result[0][1:]
hhash = None
atag = None

needsupdate += 1
if not toplevel and level:
continue
Expand All @@ -316,22 +317,23 @@ def submodules_status(gitmodules, root_dir, toplevel=False):
hhash = htag.split()[0]
if hhash and atag:
break
optional = " (optional)" if required and "Optional" in required else ""
if tag and (ahash == hhash or atag == tag):
print(f"e {name:>20} not checked out, aligned at tag {tag}")
print(f"e {name:>20} not checked out, aligned at tag {tag}{optional}")
elif tag:
ahash = rootgit.git_operation(
"submodule", "status", "{}".format(path)
).rstrip()
ahash = ahash[1 : len(tag) + 1]
if tag == ahash:
print(f"e {name:>20} not checked out, aligned at hash {ahash}")
print(f"e {name:>20} not checked out, aligned at hash {ahash}{optional}")
else:
print(
f"e {name:>20} not checked out, out of sync at tag {atag}, expected tag is {tag}"
f"e {name:>20} not checked out, out of sync at tag {atag}, expected tag is {tag}{optional}"
)
testfails += 1
else:
print(f"e {name:>20} has no fxtag defined in .gitmodules")
print(f"e {name:>20} has no fxtag defined in .gitmodules{optional}")
testfails += 1
else:
with utils.pushd(newpath):
Expand Down
12 changes: 6 additions & 6 deletions git_fleximod/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,12 +241,12 @@ def _hanging_msg(working_directory, command):
has taken {hanging_sec} seconds. It may be hanging.
The command will continue to run, but you may want to abort
manage_externals with ^C and investigate. A possible cause of hangs is
when svn or git require authentication to access a private
repository. On some systems, svn and git requests for authentication
information will not be displayed to the user. In this case, the program
will appear to hang. Ensure you can run svn and git manually and access
all repositories without entering your authentication information.
git-fleximod with ^C and investigate. A possible cause of hangs is git
requires authentication to access a private repository. On some
systems, git requests for authentication information will not
be displayed to the user. In this case, the program will appear to
hang. Ensure you can run git manually and access all
repositories without entering your authentication information.
""".format(
command=command,
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "git-fleximod"
version = "0.7.7"
version = "0.7.8"
description = "Extended support for git-submodule and git-sparse-checkout"
authors = ["Jim Edwards <jedwards@ucar.edu>"]
maintainers = ["Jim Edwards <jedwards@ucar.edu>"]
Expand Down
2 changes: 1 addition & 1 deletion tbump.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
github_url = "https://github.com/jedwards4b/git-fleximod/"

[version]
current = "0.7.7"
current = "0.7.8"

# Example of a semver regexp.
# Make sure this matches current_version before
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def logger():
"submodule_name": "test_optional",
"status1" : "test_optional MPIserial_2.5.0-3-gd82ce7c is out of sync with .gitmodules MPIserial_2.4.0",
"status2" : "test_optional at tag MPIserial_2.4.0",
"status3" : "test_optional not checked out, out of sync at tag None, expected tag is MPIserial_2.4.0",
"status3" : "test_optional not checked out, out of sync at tag None, expected tag is MPIserial_2.4.0 (optional)",
"status4" : "test_optional at tag MPIserial_2.4.0",
"gitmodules_content": """
[submodule "test_optional"]
Expand Down

0 comments on commit c2f52d1

Please sign in to comment.