Skip to contentSkip to conversation

cg-update (cogito-0.13) bug: changed heads

DISCUSSION H. Peter Anvin 3 participants 5 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

I just found a bug in cogito-0.13, at least to the best of my understanding of the situation.

Simplified, the problem looks like this: two sides, A and B, pull from repository C. The head of this pull we call 0.

Now commit 1 is added to A. B pulls commit 1 from A, not though C. Later, A pushes commit 1 to C.

Next time B tries to pull from C, cg-update will not advance refs/heads/origin, even though C now has a new head. Thus, B will think that C is in a different state than it actually is.

This has, for me, broken safeguards of the form "make sure you're merged before you pull."

-hpa

#1 lore raw

Dear diary, on Tue, Sep 06, 2005 at 11:01:25PM CEST, I got a letter where "H. Peter Anvin" <[email protected]> told me that...

Quoted 6 lines

I just found a bug in cogito-0.13, at least to the best of my understanding of the situation.

Simplified, the problem looks like this: two sides, A and B, pull from repository C. The head of this pull we call 0.

Quoted 6 lines

Now commit 1 is added to A. B pulls commit 1 from A, not though C. Later, A pushes commit 1 to C.

Next time B tries to pull from C, cg-update will not advance refs/heads/origin, even though C now has a new head. Thus, B will think that C is in a different state than it actually is.

So, C surely has its head updated? Does cg-update "fail" silently, or does it utter anything?

Signature · 4 lines
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
If you want the holes in your knowledge showing up try teaching
someone.  -- Alan Cox
#2 lore raw
Quoted 7 lines · Petr Baudis

Dear diary, on Tue, Sep 06, 2005 at 11:01:25PM CEST, I got a letter where "H. Peter Anvin" <[email protected]> told me that...

Quoted 4 lines

I just found a bug in cogito-0.13, at least to the best of my understanding of the situation.

Simplified, the problem looks like this: two sides, A and B, pull from repository C. The head of this pull we call 0.

Quoted 8 lines
Quoted 3 lines

Now commit 1 is added to A. B pulls commit 1 from A, not though C. Later, A pushes commit 1 to C.

Next time B tries to pull from C, cg-update will not advance refs/heads/origin, even though C now has a new head. Thus, B will think that C is in a different state than it actually is.

So, C surely has its head updated? Does cg-update "fail" silently, or does it utter anything?

C has its head updated, yes. cg-update says "Branches already fully merged."

-hpa

#3 lore raw
Quoted 6 lines · H. Peter Anvin
Quoted 3 lines

So, C surely has its head updated? Does cg-update "fail" silently, or does it utter anything?

C has its head updated, yes. cg-update says "Branches already fully merged."

OK, now later in the day I could not reproduce this on another box. Either the situation was different enough, or I did something else wrong.

-hpa

#4 lore raw
Quoted 4 lines · H. Peter Anvin
Quoted 1 line · H. Peter Anvin
Quoted 1 line

OK, now later in the day I could not reproduce this on another box. Either the situation was different enough, or I did something else wrong.

One thing that comes to mind, which may or may not be relevant to your situation, is which branch you were on when you ran cg-update. I cannot speak for Pasky and I do not use Cogito, but the 'git fetch' and 'git pull' commands that come with core GIT used to have a funny interaction of fetch attempting to update the branch head ref if your working tree happened to be on that branch, which was fixed some time ago.