Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Submodule support #1

Open
SebastianSemper opened this issue Jan 15, 2019 · 2 comments
Open

Submodule support #1

SebastianSemper opened this issue Jan 15, 2019 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@SebastianSemper
Copy link
Member

It would be nice, if PINGIT would also search for possibly present submodules and list them as well. Then one could work with a repository, which is used in several places as a submodule, and update it everywhere, or syncronize all instances of this repository.

A common use case would be, if one maintains a git repository of bib-files, which are updated at several locations, i.e. several papers, where it is included as a submodule. What then would be nice is a feature to update all submodules at once. So each submodule has to pull and rebase from master, push to master and pull again, to also get all changes from the others. This would save a lot of manual work!

@ChristophWWagner
Copy link
Member

This is a good point, thank you for bringing it forward.

Thinking about it the behaviour you describe should not be the default as it would then undermine all the cases where you link in different (mostly software) repositories as resources and you want to pin a specific revision, which not neccessarily must be the latest. From a software development point of view such automatic update of submodules poses a danger to rigorous test-and-debug efforts and is mostly undesired

I'd propose to implement the feature as an extra switch --submodules or -s. If the switch is present, submodules are considered for the operation as well. (i.e. pinging in the case of pingit ping or fetching in the case of pingit fetch. With pingit status there's more to it: By default status should consider submodules and should report dirty and ahead states as well as untracked files (without the switch being present). However, the behind-remote-state should only be reported if the switch is present because having a submodule that does not point to HEAD by intention is a common usecase.

The same goes for the pull-rebase scheme. Up to now pingit does not have a batch-push and I still am uncertain that it should be implemented. The submodule case is the only reason where this actually makes sense to do automatically. However, doing it automatically for all repositories could interfere with the specific-version usecase. I'd imagine pingit pull --rebase -s to be the right place to put this feature. However I do not think it is a good idea to do it to all repositories automatically for the aforementioned reasons. Maybe requiring the --list option would relief the risk of doing unwanted things with pingit pull -s. Or maybe introducing regex-selectors generally.

What do you think about this? Would some of those thoughts be a sufficient solution?

@JanKirchhofTU
Copy link
Member

To add to this:
You could also include

git submodule init
git submodule update

into the pingit import command to have repositories completely set up including the submodules when moving them to another location.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants