ESMCI / git-fleximod

MIT License
2 stars 2 forks source link

Have a way to allow untracked files in a sub module to be ignored, but left in place #39

Closed ekluzek closed 1 month ago

ekluzek commented 1 month ago

I often have untracked files in sub modules, that I want to be left alone (such as cases under cime/scripts).

For example in ctsm5.2.007:

cd ccs_config
touch thing
cd ..
./bin/git-fleximod status
./bin/git-fleximod status ccs_config
            ccs_config at tag ccs_config_cesm0.0.106
M                      HEAD detached at ccs_config_cesm0.0.106
                      Untracked files:
                        (use "git add <file>..." to include in what will be committed)
                        thing

                      nothing added to commit but untracked files present (use "git add" to track)

    testfails = 0, local mods = 1, needs updates 0

    The submodules labeled with 'M' above are not in a clean state.
    The following are options for how to proceed:
    (1) Go into each submodule which is not in a clean state and issue a 'git status'
        Either revert or commit your changes so that the submodule is in a clean state.
    (2) use the --force option to git-fleximod
    (3) you can name the particular submodules to update using the git-fleximod command line
    (4) As a last resort you can remove the submodule (via 'rm -fr [directory]')
        then rerun git-fleximod update.

NOTE: An update gives a similar message and doesn't run. This is true even if I use the "--force" option as listed in option (2).

Files within a submodule that are modified I DO always want to be aware of and handle as in option (1). But, sometimes I want those untracked files around for a variety of reasons.

jedwards4b commented 1 month ago

Is there an issue here or are you just complaining that I tell you that you have untracked files? You can add a .gitignore to your repo to ignore those files. You can use the --force option as documented above. I don't see anything broken here.

jedwards4b commented 1 month ago

Fixed by #40

ekluzek commented 1 month ago

@jedwards4b the fix you brought in, fixes the behavior that I wanted. Thank you.

I've fine with the warning about untracked files. I just wanted it to still do updates even with untracked files in place. And now it's working how I wanted it to. And similar to the behavior I relied on in manage_externals.

Closing now.