Skip to content

Commit

Permalink
update README and improve me2flexi
Browse files Browse the repository at this point in the history
  • Loading branch information
jedwards4b committed Feb 28, 2024
1 parent 8d0ed18 commit 91df5a0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ Git-fleximod is a Python-based tool that extends Git's submodule and sparse chec
Basic Usage:
git fleximod <command> [options]
Available Commands:
checkout: Checkout submodules according to git submodule hash configuration.
status: Display the status of submodules.
update: Update submodules to the tag indicated in .gitmodules variable fxtag.
test: Make sure that fxtags and submodule hashes are consistant,
Expand Down Expand Up @@ -55,9 +54,9 @@ Git-fleximod is a Python-based tool that extends Git's submodule and sparse chec

Here are some common usage examples:

Checkout submodules, including optional ones:
Update all submodules, including optional ones:
```bash
git fleximod checkout --optional
git fleximod update --optional
```

Updating a specific submodule to the fxtag indicated in .gitmodules:
Expand Down
5 changes: 3 additions & 2 deletions git_fleximod/git_fleximod.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,9 @@ def submodule_sparse_checkout(
shutil.copy(sparsefile, gitsparse)

# Finally checkout the repo
sprepo_git.git_operation("fetch", "--depth=1", "origin", "--tags")
sprepo_git.git_operation("fetch", "origin", "--tags")
sprepo_git.git_operation("checkout", tag)

print(f"Successfully checked out {name:>20} at {tag}")
rgit.config_set_value(f'submodule "{name}"',"active","true")
rgit.config_set_value(f'submodule "{name}"',"url",url)
Expand Down Expand Up @@ -242,7 +243,7 @@ def submodules_status(gitmodules, root_dir):
ahash = git.git_operation("status").partition("\n")[0].split()[-1]
if tag and atag == tag:
print(f" {name:>20} at tag {tag}")
elif tag and ahash == tag:
elif tag and ahash[:len(tag)] == tag:
print(f" {name:>20} at hash {ahash}")
elif tag:
print(f"s {name:>20} {atag} {ahash} is out of sync with .gitmodules {tag}")
Expand Down
6 changes: 3 additions & 3 deletions git_fleximod/metoflexi.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,9 @@ def translate_single_repo(self, section, tag, url, path, efile, hash_, sparse, p
ngit = GitInterface(newpath, logger)
ngit.git_operation("checkout", tag)

if (newpath / ".gitignore").exists():
logger.info("Moving .gitignore file in {}".format(newpath))
(newpath / ".gitignore").rename((newpath / "save.gitignore"))
# if (newpath / ".gitignore").exists():
# logger.info("Moving .gitignore file in {}".format(newpath))
# (newpath / ".gitignore").rename((newpath / "save.gitignore"))

if hash_:
self.git.git_operation("clone", url, path)
Expand Down

0 comments on commit 91df5a0

Please sign in to comment.