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

file modified
+2 -2
@@ -118,12 +118,12 @@ 

  

      fetch = +refs/pull/*/head:refs/remotes/origin/pr/*

  

- to that section, like this::

+ to that section as **the first fetch line**, like this::

  

      [remote "origin"]

          url = ssh://git@pagure.io/pagure.git

-         fetch = +refs/heads/*:refs/remotes/origin/*

          fetch = +refs/pull/*/head:refs/remotes/origin/pr/*

+         fetch = +refs/heads/*:refs/remotes/origin/*

  

  Obviously, the remote url should be matching the url of your project (pagure project in

  this example).

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 456808e

6 years ago

It's working :)

Thanks!

Pull-Request has been merged by pingou

6 years ago

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