Skip to content

Add "pmbootstrap pull"

Administrator requested to merge pmbootstrap-pull into master

Depends on and contains all commits of !1845 (merged) (so this should be merged first).

New patches:

pmb.helpers.git.rev_parse: don't return "" on err

Remove a legacy code path from back in the day, where pmaports were in
the same repository as pmbootstrap ([1]). Nowadays, pmaports are always in a
git repository, so this is not necessary anymore. If git fails at this
point, crash hard and don't carry on with an empty string.

This is in preparation for using rev_parse in new code paths, so we
don't need to check the return value of rev_parse.

[1] 39548835, https://github.com/postmarketOS/pmbootstrap/pull/439

pmb.helpers.git.rev_parse: add path argument

pmb.helpers.git.rev_parse: add abbrev_ref argument

pmb.helpers.git.get_path: new function

Get the path to the repository, which is either the default one in the
work dir, or a user-specified one in args.

gitlab-ci.yml: set git user/email

Prevent upcoming tests for "pmbootstrap pull" from failing, when trying
to create a git repository.

pmbootstrap pull: new action

Add a shortcut for "git pull --ff-only" in all repositories cloned by
pmbootstrap (currently pmaports and aports_upstream, new pmdevices
repository coming soon).

'pmbootstrap pull' will only update the repositories, if:
* they are on an officially supported branch (e.g. master)
* the history is not conflicting (fast-forward is possible)
* the git workdirs are clean

Otherwise it shows the user a descriptive message about what to do. The
list of supported branches is only "master" right now, and will be
extended in later commits, so we can have a stable branch for pmaports
based on Alpine's releases. More about that in the project direction
2020 issue.

Closes: #1858 (closed)

Edited by Administrator

Merge request reports

Loading