How to define SHA-1 submodule with gitweb?

I want to define an associated SHA-1 submodule without cloning anything, i.e. remotely. git -ls-remote does not show this information, so my initial approach was to clear XHTML from gitweb and pull out SHA-1.

Unfortunately, gitweb seems to support submodules pretty poorly, displaying 404 and 500 "unknown objects" errors when trying to view history for the path associated with it. Therefore, it is not possible for me to determine the associated SHA-1 submodule if I cannot determine the exact commit that modified git-link and then parsed diff for something like:

-Subproject commit 706187649544cb029b617548771fe96c1693be39 +Subproject commit f05b9854fca9a2e1f47449e563a33156c1085646 

Unfortunately, gitweb is so broken with submodules that I canโ€™t find a way to determine which commit this diff contains, so unless I do an exhaustive search through each commit, it is not-go.

I tried with gitweb bundled with git 1.6.4.2 and 1.6.6.1 (last stable).

Someone might think of a solution, or perhaps an alternative way to do this without cloning each repository. You see, I want to do this for all repositories in our organization and for each branch in each repository and for many branches. I do this to get a list of all the submodule commits and determine if they are deprecated.

If the only solution is to individually clone each repository and execute queries internally, then that should be it. Unfortunately, some of our repositories are quite large, so this will make the whole operation very slow.

+4
source share
1 answer

I'm not sure if the answer you want will give you:

Take a look at the "tree" view in gitweb 1 for the directory that contains the submodule (this may be the top directory of your repository). You can recognize a submodule by the fact that it has m--------- as a mode line. For each submodule, you should have a "history" link, where you will have a list of all the commits that changed this submodule. (This requires gitweb at least from git version 1.5.3).

The lack of better support for submodules in gitweb, in my opinion, is due to the fact that it is difficult to determine where the repository (git_dir) is for the submodule.

NTN

Footnotes:
1. This will help if you provided a link to the gitweb installation, if it could be made public.

+1
source

Source: https://habr.com/ru/post/1300358/


All Articles