From 2ede182089784488065b93346d301a202df7b329 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Sat, 8 Jun 2024 08:40:03 -0600 Subject: [PATCH 1/3] add optional to status output --- git_fleximod/git_fleximod.py | 10 ++++++---- tests/conftest.py | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/git_fleximod/git_fleximod.py b/git_fleximod/git_fleximod.py index ca5f90622d..e1b8f484a5 100755 --- a/git_fleximod/git_fleximod.py +++ b/git_fleximod/git_fleximod.py @@ -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 @@ -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): diff --git a/tests/conftest.py b/tests/conftest.py index 1cc008eb1d..65ee85d23d 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -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"] From 7ea36dc44c5646bfcf9940ea757c5f8d9f1d9778 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Mon, 10 Jun 2024 15:57:15 -0600 Subject: [PATCH 2/3] remove manage_externals error --- git_fleximod/utils.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/git_fleximod/utils.py b/git_fleximod/utils.py index 7cc1de38cc..1a2d5ccf2f 100644 --- a/git_fleximod/utils.py +++ b/git_fleximod/utils.py @@ -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, From af12c80cade77d299629700f91a0095a5cd6545a Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Tue, 11 Jun 2024 06:28:49 -0600 Subject: [PATCH 3/3] fix spelling --- git_fleximod/cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git_fleximod/cli.py b/git_fleximod/cli.py index bc099fcbc0..9034ac2d09 100644 --- a/git_fleximod/cli.py +++ b/git_fleximod/cli.py @@ -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