#3004 docs: switch ordering of PR remote configuration
Merged by pingou. Opened by kparal.
kparal/pagure prdocs  into  master

Download 3004.patch

If the PR fetch line is not stated as the second one in git config, then
the branch is configured with a standard merge remote, and the PR branch
can't be pulled. The specific PR fetch line has to be stated as the
first one.


WARNING: I have no idea what I'm doing. Somebody with proper git knowledge needs to check this is sane!

Today I found out that if I configure my pagure checkout according to the documentation, I can check out pr/NN branch, but I can't pull changes. Example:

$ git checkout pr/16 
Branch pr/16 set up to track remote branch pr/16 from origin.
Switched to a new branch 'pr/16'
$ git reset --hard HEAD^
HEAD is now at 6ec4848 docs, fixes, debug prints
$ git pull
Your configuration specifies to merge with the ref 'refs/heads/pr/16'
from the remote, but no such ref was fetched.

This is how .git/config looks like:

...
[remote "origin"]
    url = ssh://git@pagure.io/taskotron/task-rpmlint.git
    fetch = +refs/heads/*:refs/remotes/origin/*
    fetch = +refs/pull/*/head:refs/remotes/origin/pr/*
[branch "pr/16"]
    remote = origin
    merge = refs/heads/pr/16

And if I switch the order of those fetch lines:

$ git checkout pr/16 
Branch pr/16 set up to track remote ref refs/pull/16/head.
Switched to a new branch 'pr/16'
$ git reset --hard HEAD^
HEAD is now at 6ec4848 docs, fixes, debug prints
$ git pull
Updating 6ec4848..bb4f667
Fast-forward
 tests.yml | 1 +
 1 file changed, 1 insertion(+)

And .git/config:

...
[remote "origin"]
    url = ssh://git@pagure.io/taskotron/task-rpmlint.git
    fetch = +refs/pull/*/head:refs/remotes/origin/pr/*
    fetch = +refs/heads/*:refs/remotes/origin/*
[branch "pr/16"]
    remote = origin
    merge = refs/pull/16/head

Could you rebase it? That'll allow me to test it :)

rebased onto 456808e7db48170958b0743d0a1adfba9fabb5d9

Rebased.

It's working :)

Thanks!

Pull-Request has been merged by pingou

It would be nice if the docs got re-generated from time to time. A fix I pushed some months back is still not visible. Not even mentioning this one.

I normally do this at release time :)

Metadata