Can't pull from develop branch.

319 views
Skip to first unread message

Emmanuel Charpentier

unread,
Sep 22, 2018, 1:53:50 PM9/22/18
to sage-devel
I wanted to update my (current) sage 8.4-beta4 to beta6

Fetch works okay. Then :

charpent@asus16-ec:/usr/local/sage-8$ git status
Sur la branche develop
Votre branche est en retard sur 'origin/develop' de 652 commits, et peut être mise à jour en avance rapide.
  (utilisez "git pull" pour mettre à jour votre branche locale)

Fichiers non suivis:
  (utilisez "git add <fichier>..." pour inclure dans ce qui sera validé)

    src/sage/libs/cypari2/

(Note : I have had this one for a long time. It seems to be a sequel of a booboo in Sages git history. It is probablu *not* relevant to my current problem)..

aucune modification ajoutée à la validation mais des fichiers non suivis sont présents (utilisez "git add" pour les suivre)
charpent@asus16-ec:/usr/local/sage-8$ git pull
error: cannot lock ref 'refs/remotes/origin/u/embray/python3/sage-rings-polynomial-polydict/misc': 'refs/remotes/origin/u/embray/python3/sage-rings-polynomial-polydict' existe ; impossible de créer 'refs/remotes/origin/u/embray/python3/sage-rings-polynomial-polydict/misc'
Depuis git.sagemath.org:sage
 ! [nouvelle branche]      u/embray/python3/sage-rings-polynomial-polydict/misc -> origin/u/embray/python3/sage-rings-polynomial-polydict/misc  (impossible de mettre à jour la référence locale)


I do not know how to proceed. Suggestions ?

Dima Pasechnik

unread,
Sep 22, 2018, 2:10:14 PM9/22/18
to sage-devel
You are not the one hit by this particular branch of our vast git tree. See
and the following comments.



--
You received this message because you are subscribed to the Google Groups "sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+...@googlegroups.com.
To post to this group, send email to sage-...@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Dima Pasechnik

unread,
Sep 22, 2018, 2:11:17 PM9/22/18
to sage-devel
On Sat, Sep 22, 2018 at 7:10 PM Dima Pasechnik <dim...@gmail.com> wrote:
>
> You are not the one hit by this particular branch of our vast git tree. See

"the one" -> "the only one"

Emmanuel Charpentier

unread,
Sep 22, 2018, 2:27:08 PM9/22/18
to sage-devel
Thanks, Dimitri !

But I'm not out of the woods : I do not know how to delete this branch. Git tells me it doesn't know about it :

charpent@asus16-ec:/usr/local/sage-8$ git branch -d u/embray/python3/sage-rings-polynomial-polydict
error: branche 'u/embray/python3/sage-rings-polynomial-polydict' non trouvée.


And indeed :

charpent@asus16-ec:/usr/local/sage-8$ git branch --list
* develop
  master
  r344_8_2
  r344_8_3b0
  t/24107/inclusion_of_openssl__stage_1


How can I proceed ?

Dima Pasechnik

unread,
Sep 22, 2018, 2:33:23 PM9/22/18
to sage-devel
On Sat, Sep 22, 2018 at 7:27 PM Emmanuel Charpentier
<emanuel.c...@gmail.com> wrote:
>
> Thanks, Dimitri !
>
> But I'm not out of the woods : I do not know how to delete this branch. Git tells me it doesn't know about it :
>
> charpent@asus16-ec:/usr/local/sage-8$ git branch -d u/embray/python3/sage-rings-polynomial-polydict
> error: branche 'u/embray/python3/sage-rings-polynomial-polydict' non trouvée.

and how about u/embray/python3/sage-rings-polynomial-polydict/misc ?
Does it exist? If yes, I'd try removing it and pull again...

Dima Pasechnik

unread,
Sep 22, 2018, 2:35:23 PM9/22/18
to sage-devel
And, by the way, what is the remote you are pulling from?

Emmanuel Charpentier

unread,
Sep 22, 2018, 2:39:48 PM9/22/18
to sage-devel


Le samedi 22 septembre 2018 20:33:23 UTC+2, Dima Pasechnik a écrit :
On Sat, Sep 22, 2018 at 7:27 PM Emmanuel Charpentier
<emanuel.c...@gmail.com> wrote:
>
> Thanks, Dimitri !
>
> But I'm not out of the woods : I do not know how to delete this branch. Git tells me it doesn't know about it :
>
> charpent@asus16-ec:/usr/local/sage-8$ git branch -d u/embray/python3/sage-rings-polynomial-polydict
> error: branche 'u/embray/python3/sage-rings-polynomial-polydict' non trouvée.

and how about u/embray/python3/sage-rings-polynomial-polydict/misc ?
Does it exist? If yes, I'd try removing it and pull again...

Same problem :

charpent@asus16-ec:/usr/local/sage-8$ git branch -d u/embray/python3/sage-rings-polynomial-polydict/misc
error: branche 'u/embray/python3/sage-rings-polynomial-polydict/misc' non trouvée.


[ Bandwidth savings : Snip... ]

Emmanuel Charpentier

unread,
Sep 22, 2018, 2:41:14 PM9/22/18
to sage-devel


Le samedi 22 septembre 2018 20:35:23 UTC+2, Dima Pasechnik a écrit :
And, by the way, what is the remote you are pulling from?

From my .git/config file :

[remote "origin"]
    url = g...@git.sagemath.org:sage.git
    fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
    remote = origin
    merge = refs/heads/master
[branch "develop"]
    remote = origin
    merge = refs/heads/develop
[remote "trac"]
    url = g...@trac.sagemath.org:sage.git
    fetch = +refs/heads/*:refs/remotes/trac/*
    pushurl = g...@trac.sagemath.org:sage.git


HTH,...

Emmanuel Charpentier

unread,
Sep 22, 2018, 2:55:26 PM9/22/18
to sage-devel
Should I try git gc (or possibly git gc aggressive) ?
Wouldn't this make my tree potentially unfit to future pushes ?

Le samedi 22 septembre 2018 20:27:08 UTC+2, Emmanuel Charpentier a écrit :

[ Snip... ]

Dima Pasechnik

unread,
Sep 22, 2018, 3:19:59 PM9/22/18
to sage-devel, sagemath-admins
IMHO it's the main tree that might use some pruning, as we now see the second case of it being uncooperative....

Emmanuel Charpentier

unread,
Sep 22, 2018, 3:24:26 PM9/22/18
to sage-devel
Okay. But this means I have to wait for this pruning...

Unless you tell me it's a bad idea (and why), I'll try to git gc --agressive. At worst, Ill have to retry from a fresh clone...

Dima Pasechnik

unread,
Sep 22, 2018, 3:31:25 PM9/22/18
to sage-devel
I don't see why `git gc` would hurt it. 

Emmanuel Charpentier

unread,
Sep 22, 2018, 3:46:06 PM9/22/18
to sage-devel
It doesn't seem to have hurt.
But it doesn't seem to have helped either : now I have two problematic branches :

charpent@asus16-ec:/usr/local/sage-8$ git pull
remote: Counting objects: 99, done.
remote: Compressing objects: 100% (40/40), done.
remote: Total 40 (delta 29), reused 0 (delta 0)
Dépaquetage des objets: 100% (40/40), fait.
Depuis git.sagemath.org:sage
   3b454e23e9..eb6646e889  public/25097/qnormaliz-algebraic -> origin/public/25097/qnormaliz-algebraic

error: cannot lock ref 'refs/remotes/origin/u/embray/python3/sage-rings-polynomial-polydict/misc': 'refs/remotes/origin/u/embray/python3/sage-rings-polynomial-polydict' existe ; impossible de créer 'refs/remotes/origin/u/embray/python3/sage-rings-polynomial-polydict/misc'
 ! [nouvelle branche]      u/embray/python3/sage-rings-polynomial-polydict/misc -> origin/u/embray/python3/sage-rings-polynomial-polydict/misc  (impossible de mettre à jour la référence locale)
 * [nouvelle branche]      u/mkoeppe/experimental_flint_upgrade_package_tracking_trunk -> origin/u/mkoeppe/experimental_flint_upgrade_package_tracking_trunk

Of course, I could manually rm .git/refs/remotes/origin/u/embray/python3/sage-rings-polynomial-polydict/ (which is empty), thus deleting the locale reference to this branch, but I absolutely ignore what other consequences this would have.

Any suggestion ?

Erik Bray

unread,
Sep 22, 2018, 4:19:32 PM9/22/18
to sage-devel
Try

$ git branch -d origin/u/embray/python3/sage-rings-polynomial-polydict

You wouldn't have the above branch without "origin" unless you created a remote tracking branch. It's only remote branches which you're having a problem with 

(note: this happened because I had an older branch named u/embray/python3/sage-rings-polynomial-polydict, which I deleted, but then I added a new branch called ...polydict/misc, and git gets ornery about cases like that). 

Also, if I were you, I'd update my remote refspec to only fetch your own branches. E.g., I only sync my branches by default like 

[remote "origin"]
    url = g...@git.sagemath.org:sage.git
    fetch = +refs/heads/u/embray/*:refs/remotes/u/embray

In the (typically less common) case where you want to fetch someone else's branch you can still give the branch name manually with the `git fetch` command. 

Emmanuel Charpentier

unread,
Sep 22, 2018, 4:30:16 PM9/22/18
to sage-devel


Le samedi 22 septembre 2018 22:19:32 UTC+2, Erik Bray a écrit :
Try

$ git branch -d origin/u/embray/python3/sage-rings-polynomial-polydict

No such luck :

charpent@asus16-ec:/usr/local/sage-8$ git branch -d origin/u/embray/python3/sage-rings-polynomial-polydict
error: branche 'origin/u/embray/python3/sage-rings-polynomial-polydict' non trouvée.

It seems that I'm still stuck (in the mud above the axles...).

You wouldn't have the above branch without "origin" unless you created a remote tracking branch. It's only remote branches which you're having a problem with 

Being remote, it seems that I can't access them...

(note: this happened because I had an older branch named u/embray/python3/sage-rings-polynomial-polydict, which I deleted, but then I added a new branch called ...polydict/misc, and git gets ornery about cases like that). 

Also, if I were you, I'd update my remote refspec to only fetch your own branches. E.g., I only sync my branches by default like 

[remote "origin"]
    url = g...@git.sagemath.org:sage.git
    fetch = +refs/heads/u/embray/*:refs/remotes/u/embray

In the (typically less common) case where you want to fetch someone else's branch you can still give the branch name manually with the `git fetch` command. 

It's not *that* infrequent I pull other people's branches (if only to review them...). I'd rather keep my config "vanilla".

Volker Braun

unread,
Sep 22, 2018, 6:28:42 PM9/22/18
to sage-devel
Try "git remote prune origin" or "git remote update origin --prune"

Explanation: You only have a stale remote reference reference, this is slightly different from Dima's problem who had the branch locally checked out. The "git branch -d" only deletes local branches. You need to prune the cached view of the remote repository instead. 

Emmanuel Charpentier

unread,
Sep 23, 2018, 2:52:28 AM9/23/18
to sage-devel
Dear Volker,


Le dimanche 23 septembre 2018 00:28:42 UTC+2, Volker Braun a écrit :
Try "git remote prune origin" or "git remote update origin --prune"

Thanks ! this did it.

Explanation: You only have a stale remote reference reference, this is slightly different from Dima's problem who had the branch locally checked out. The "git branch -d" only deletes local branches. You need to prune the cached view of the remote repository instead. 

There still remains a lot I have to learn|understand about git...

Thanks again

Erik Bray

unread,
Sep 24, 2018, 8:40:51 AM9/24/18
to sage-devel
On Sat, Sep 22, 2018 at 10:30 PM Emmanuel Charpentier
<emanuel.c...@gmail.com> wrote:
> Le samedi 22 septembre 2018 22:19:32 UTC+2, Erik Bray a écrit :
>>
>> Try
>>
>> $ git branch -d origin/u/embray/python3/sage-rings-polynomial-polydict
>
>
> No such luck :
>
> charpent@asus16-ec:/usr/local/sage-8$ git branch -d origin/u/embray/python3/sage-rings-polynomial-polydict
> error: branche 'origin/u/embray/python3/sage-rings-polynomial-polydict' non trouvée.
>
> It seems that I'm still stuck (in the mud above the axles...).
>>
>>
>> You wouldn't have the above branch without "origin" unless you created a remote tracking branch. It's only remote branches which you're having a problem with
>
>
> Being remote, it seems that I can't access them...

That's not what "remote" means in this case. When you fetch branches
from a remote repository, you (typically) will have those branches
also in your local repository. It's just that they are synced to a
.git/refs/ subdirectory called remotes/<remote-name>/. This is what I
mean in this case by "remote branch". Not that it's literally
something on a remote machine that you "can't access". Normally "git
branch" hides remote branches, but "git branch -r" shows all remote
branches.

One thing I forgot is that `git branch -d` will normally only delete
"local" branches (that is, branches that you manually created locally
rather than fetching from a remote). But "git branch -d -r
<remote-name>/<branch-name>" will let you delete remote references as
well, so that would have worked.

I still recommend, by default, only fetching your own branches unless
you frequently need to check out other people's branches (and even
then you can still fetch them manually). In your .git/config each
remote has its own section like:

[remote "origin"]
url = g...@git.sagemath.org:sage.git
fetch = +refs/heads/*:refs/remotes/origin/*

the "fetch = " line is called a refspec, and it specifies mapping of
refs to sync from the remote repository when you do a "git fetch
origin", to how it should store those refs locally.

refs/heads/ is where normal "local branches" go ("heads" should
probably be renamed "local" or "branches" or something, but that ship
has sailed), whereas, as I wrote above, "refs/remotes/<remote-name>/"
is where remote branch refs go by default. So the above line is just
a wildcard expression saying "take everything on this remote
repository under refs/heads/*, and map it to the same name locally
under refs/remotes/origin".

You can have more than one refspec like:

[remote "origin"]
url = g...@git.sagemath.org:sage.git
fetch = +refs/heads/develop:refs/remotes/origin/develop
fetch = +refs/heads/master:refs/remotes/origin/master
fetch = +refs/heads/u/embray/*:refs/remotes/origin/u/embray/*

I then also have numerous remote tracking branches, which is another
story. This is all documented in more detail at:
https://git-scm.com/book/en/v2/Git-Internals-The-Refspec

Dima Pasechnik

unread,
Sep 28, 2018, 8:49:10 AM9/28/18
to sage-devel
By the way, I would not be surprised if the mirror
failed to update due to the same problem on git.sagemath.org

Read-only mirror of all the branches that are on trac.sagemath.org

Project ID: 6249490

Mirrored from git://git.sagemath.org/sage.git
 The repository failed to update 
Repository mirroring has been paused due to too many failed attempts, and can be resumed by a project maintainer. 
Last successful update .

Erik Bray

unread,
Sep 28, 2018, 8:53:57 AM9/28/18
to sage-devel
Yes, I think you're right. I deleted the problematic branch from that
repository and restarted the mirroring so we'll see. GitLab even
reported "Invalid reference name" as the relevant error.

Well, hopefully I won't make that mistake again!

Emmanuel Charpentier

unread,
Oct 1, 2018, 1:15:36 PM10/1/18
to sage-devel
Well... on a machine that was stille at 8.4.beta4, I stumble on the same point :

charpent@p-202-021:/usr/local/sage-8$ git pull
error: cannot lock ref 'refs/remotes/origin/u/embray/python3/sage-rings-polynomial-polydict/misc': 'refs/remotes/origin/u/embray/python3/sage-rings-polynomial-polydict' existe ; impossible de créer 'refs/remotes/origin/u/embray/python3/sage-rings-polynomial-polydict/misc'
Depuis git.sagemath.org:sage
 ! [nouvelle branche]      u/embray/python3/sage-rings-polynomial-polydict/misc -> origin/u/embray/python3/sage-rings-polynomial-polydict/misc  (impossible de mettre à jour la référence locale)
 * [nouvelle étiquette]    8.4.beta5  -> 8.4.beta5
 * [nouvelle étiquette]    8.4.beta6  -> 8.4.beta6

More pruning seems needed... I got unwedged by Volker's "git remote update origin --prune". Thanks again, Volker !
Reply all
Reply to author
Forward
0 new messages