mirror of
https://codeberg.org/privacy1st/arch
synced 2024-12-23 01:16:04 +01:00
fix notes on updating submodules
This commit is contained in:
parent
372f94d2bb
commit
2858795bc0
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -247,3 +247,6 @@
|
||||
[submodule "pkg/forklift-git"]
|
||||
path = pkg/forklift-git
|
||||
url = https://aur.archlinux.org/forklift-git.git
|
||||
[submodule "pkg/dotfiles"]
|
||||
path = pkg/dotfiles
|
||||
url = https://git.privacy1st.de/langfingaz/dotfiles.git
|
||||
|
22
README.md
22
README.md
@ -21,27 +21,11 @@ To initialize the submodules, run
|
||||
git submodule init
|
||||
```
|
||||
|
||||
To update all submodules and print a list of those who received an update, run
|
||||
To update all submodules and add those who received an update to
|
||||
[build-pkg/pkglist.tmp](build-pkg/pkglist.tmp), run
|
||||
|
||||
```shell
|
||||
if output="$(git submodule update --remote 2>&1)"; then
|
||||
# We capture only the part after "pkg" until the next "'" using sed
|
||||
# Source: https://unix.stackexchange.com/a/165590/315162
|
||||
sed 's|^Submodule path '\''pkg/\([^'\'']*\).*|\1|' <<< "$output"
|
||||
else
|
||||
echo "$output"
|
||||
fi
|
||||
```
|
||||
|
||||
It may happen that some submodules have a detached HEAD (due to local changes, etc.)
|
||||
and do not get updated with the above command. One can list those submodules as follows:
|
||||
|
||||
```shell
|
||||
git submodule status | grep --invert-match '(heads/master)$'
|
||||
|
||||
# One could then reset them to master with e.g.
|
||||
# git reset --hard
|
||||
# git checkout master
|
||||
git submodule foreach 'if git pull | grep '\''^Updating'\''; then printf " %s" "$(basename $sm_path)" >> $toplevel/build-pkg/pkglist.tmp; fi'
|
||||
```
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user