Hi all,
some time ago I announced that I'm prepare draft for update scripts for work with Git. Now is attached both diff and tarball. I expect comments, objections, other suggestions :)
Adjustments are as follows: + added support for branches - the current branch is detected automatically + added automatic detection gituser (from .git/config) + optimized some operations - if is not a mess, reset + clean is not called - if there is nothing to commit, commit is not called - if there is nothing to send server, push is not called - because git submodule init + update in one call update all submodules, for each git tree is called only once
I was thinking about add into script commit_all_submodules check for untracked files. In order to avoid omission of renamed and new files. What is your opinion?
Slavek --
On Sunday 02 of September 2012 16:01:06 Slávek Banko wrote:
Hi all,
some time ago I announced that I'm prepare draft for update scripts for work with Git. Now is attached both diff and tarball. I expect comments, objections, other suggestions :)
I'm sorry, in the previous post was in update_all_submodules undesirable "-x" on the first line of the script. :(
Slavek --
some time ago I announced that I'm prepare draft for update scripts for work with Git. Now is attached both diff and tarball. I expect comments, objections, other suggestions :)
Adjustments are as follows:
- added support for branches
- the current branch is detected automatically
- added automatic detection gituser (from .git/config)
- optimized some operations
- if is not a mess, reset + clean is not called
- if there is nothing to commit, commit is not called
- if there is nothing to send server, push is not called
- because git submodule init + update in one call update all submodules, for each git tree is called only once
I was thinking about add into script commit_all_submodules check for untracked files. In order to avoid omission of renamed and new files. What is your opinion?
* Do these changes improve the speed of updating a local repository? Updating my local repository takes a long time.
* Do these changes improve anonymous connections? Some time ago this was discussed because many people were havng problems connecting anonymously to maintain a local repository.
* In light of my recent post about supporting a point release schedule, how do these changes support several branches, such as a development branch, a stable branch, and past release branches? I have not tried building 3.5.13.1 packages from GIT and am naive about how multiple branches works.
Darrell
On Sunday 02 of September 2012 18:51:14 Darrell Anderson wrote:
- Do these changes improve the speed of updating a local repository?
Updating my local repository takes a long time.
I expect performance benefit in script update_all_submodules, through reduced calls submodule init and update. But that is not for normal users. In all scripts some performance benefits can bring a reduction of calls reset, clean, commit, and push. But I did not carry out any measurements.
- Do these changes improve anonymous connections? Some time ago this was
discussed because many people were havng problems connecting anonymously to maintain a local repository.
switch_all_submodules_to_head_and_clean script would probably not have a problem with access as anonymous user. If the proposed automatic detection gituser will suit everyone, it could be a question to gituser from scripts abolished entirely.
- In light of my recent post about supporting a point release schedule, how
do these changes support several branches, such as a development branch, a stable branch, and past release branches? I have not tried building 3.5.13.1 packages from GIT and am naive about how multiple branches works.
Support for branches and easily switch between them was the main reason for me to modify the scripts. I have made modifications general - scripts are independent on the branch. Once the preparatory v3.5.13-sru branch on the meta-project 'tde' will suffice:
git checkout v3.5.13-sru && switch_all_submodules_to_head_and_clean
Instead of v3.5.13-sru will then be possible to enter the name of any branch - for example master ;)
Darrell
Slavek --
Fixed typo in commit_all_submodules.
Slavek --
Hi all,
I made a few measurements on commit_all_submodules. First of all, I realized that in this script is undesirable use "--ignore-submodules" in git status calls. In this case, it is git status call unnecessary - will not accelerate, only makes cleaner output - removed.
Similarly undesirable is --ignore-submodules in testing to commit in script update_all_submodules - parameter removed.
I noticed one problem in the script switch_all_submodules_to_head_and_clean. If the git folder for module is cloned into $top/.git/modules/, such a module is not updated to HEAD and submodules are not initialized and updated. Darrell, may be this was the problem that you mentioned earlier? Fixed.
Slavek --
Dne pá 7. září 2012 Slávek Banko napsal(a):
I noticed one problem in the script switch_all_submodules_to_head_and_clean. If the git folder for module is cloned into $top/.git/modules/, such a module is not updated to HEAD and submodules are not initialized and updated. Darrell, may be this was the problem that you mentioned earlier? Fixed.
In further testing, I found that the last mentioned (and in a updated script solved) bug even led to the premature end of the original script. I suppose this could be the problem that was encountered by those who wanted to use the script. The updated script is on my (not very fast) machine faster - about 33% saving.
I noticed that for true remove folders of submodules that are not part of the branch, it is necessary to use in clean the 'f' twice. Updated scripts attached.
I do not know if the updated scripts are tested also by someone else, but I suggest the following: I will put updated scripts into v3.5.13-sru branch on meta-project 'tde'. For this branch are necessary because support the branches. And if there will be tested and verified, then would be included also into the main branch. What is your opinion?
Slavek --
On Friday 07 of September 2012 15:52:51 Slávek Banko wrote:
I do not know if the updated scripts are tested also by someone else, but I suggest the following: I will put updated scripts into v3.5.13-sru branch on meta-project 'tde'. For this branch are necessary because support the branches. And if there will be tested and verified, then would be included also into the main branch. What is your opinion?
Ok, no response yet, therefore I add another update. :)
This update addresses the fact that ".git" can be either a folder or a file with information about the location ".git" folder. Now scripts fully support both ways.
I would say that in the diff are all modifications clearly visible. As I suggested I'll post the updated scripts first into v3.5.13-sru branch.
Slavek --