Browse Source
This makes aur-fetch more _like_ git-pull, without using git-pull. In particular,
* Local changes without `git-commit` (a dirty worktree) can be undone
with `git-reset` before running `git-merge` or `git-rebase`, if and
only if new upstream commits are available. Unlike `git-pull`, this
does not run `git-fetch` (~1s runtime) twice per package.
* The above is not done by default as with --sync=auto, but only if
`--discard` is specified (e.g. when fetching packages with a `pkgver()`
function, where running `makepkg` results in a dirty worktree.) Otherwise,
local file conflicts are left to `git-merge` or `git-rebase`.
* Similarly to `git-pull`, `git merge --ff-only` is run by default unless
`--no-commit` or `--ff` are specified. With `--rebase`, `git-rebase` is
run instead.
* To only run `git-fetch` (previous default operation), add `--fetch-only`.
This approach is more compatible to previous (<=9.6) aur-fetch versions,
with less deprecated options. However, support for the `git-config`
option `aurutils.rebase` is not preserved.
The `aurutils.rebase` option was only functional for the first package
argument, after which `sync=auto` is set to a different value. Add a
regression test and base the check on the original implementation in
commit 1a36716e4c
.
pull/1007/head

23 changed files with 230 additions and 103 deletions
@ -0,0 +1,31 @@
|
||||
#!/bin/bash |
||||
set -ex |
||||
tmp=$(mktemp -d) |
||||
trap 'rm -rf "$tmp"' EXIT |
||||
|
||||
cd "$tmp" |
||||
aur fetch aurutils aurutils-git yuzu |
||||
|
||||
cd aurutils |
||||
git config --add aurutils.rebase true |
||||
echo '# test for issue/1007' >>PKGBUILD |
||||
git commit -m 'test for issue/1007' PKGBUILD |
||||
head1=$(git rev-parse --verify HEAD) |
||||
|
||||
cd ../aurutils-git |
||||
git reset --hard HEAD^1 |
||||
head2=$(git rev-parse --verify HEAD) |
||||
|
||||
cd ../yuzu |
||||
git reset --hard HEAD^1 |
||||
head3=$(git rev-parse --verify HEAD) |
||||
|
||||
cd .. |
||||
aur fetch --sync=auto aurutils aurutils-git yuzu |
||||
|
||||
cd aurutils |
||||
[[ $(git rev-parse --verify HEAD) == $head1 ]] |
||||
cd ../aurutils-git |
||||
[[ $(git rev-parse --verify HEAD) != $head2 ]] |
||||
cd ../yuzu |
||||
[[ $(git rev-parse --verify HEAD) != $head3 ]] |
Loading…
Reference in new issue