boyter/scc

Support ignoring submodules

Closed this issue ยท 11 comments

Typically, git submodules are external dependencies and aren't desirable to be considered when sizing a repository. cloc --vcs git for example excludes submodule paths by default.

Any reason you would not consider a .ignore file for this sort of situation?

Convention, mostly - scc already automatically picks up on gitignore, so I would expect it to behave "as expected" by default (though I recognize there could be disagreement on expected behavior here). cloc doing this also seems to lend credence to it being expected behavior.

Also IMO worth considering that this information is already available in a well-defined manner

Ill need to add this over on https://github.com/boyter/gocodewalker since thats what does this sort of work now. However I am keeping track here.

Btw this is my workaround for now:

https://github.com/ultrasoundlabs/untron/blob/7e835c112dec7028884e36c1024d299cdff812a5/scc.sh

This bash script reads the paths of submodules from .gitmodules, writes them to .ignore, runs scc, and deletes .ignore.

Thanks. Having a reference to investigate helps a lot for this.

@alexhooketh Oddly I tried that after a checkout and I didn't notice any different in the count? Is there some other ignore file going on?

@alexhooketh Oddly I tried that after a checkout and I didn't notice any different in the count? Is there some other ignore file going on?

If you're running my repo, you should do git submodule update first. Just git clone doesn't download all submodules and the respective paths are empty.

Doh... you would think I would have done that... my bad. I blame the lack of sleep/coffee for that blunder.

OK support added to boyter/gocodewalker#7 for this.

I want to fix a performance item in it though before I craft the new release and push it. At that point I will update scc to reflect it and then can craft a new release here. This is expected to provide a 10-20% time reduction when running scc, so worth it.

Latest release should have this in for you.