And now we have git.

What do you want to see in Armagetron soon? Any new feature ideas? Let's ponder these ground breaking ideas...
User avatar
aP|Nelg
Match Winner
Posts: 621
Joined: Wed Oct 22, 2014 10:22 pm
Contact:

Re: And now we have git.

Post by aP|Nelg »

Z-Man wrote: Sun Mar 22, 2020 3:52 pm There now is a fork of bzr called Breezy or brz, ported to Python 3. I noticed all this because Arch replaced bzr with it, breaking my local git-bzr. I don't think it does us any good here, git-bzr would need to be adapted to it.
I've learned that Breezy supports git by itself, so one can `bzr push` to something like `git+ssh://[email protected]/armagetronad/armagetronad.git,branch=master`.

I was able to push a bazaar instance of an Armagetron branch to a Git repository. It also seems to be able to work directly with Git repositories, however I haven't tried pushing one of those to a Bazaar branch on Launchpad.
User avatar
Z-Man
God & Project Admin
Posts: 11585
Joined: Sun Jan 23, 2005 6:01 pm
Location: Cologne
Contact:

Re: And now we have git.

Post by Z-Man »

Yeah. Is it merge compatible, though? I could not get it to merge git+ssh://[email protected]/armagetronad/armagetronad.git,branch=master and lp:armagetronad, I tried both directions. Closest probably was merging lp:armagetronad into a local clone of the git one:

Code: Select all

$ brz branch git+ssh://[email protected]/armagetronad/armagetronad.git,branch=master
...
$ cd armagetronad.git
$ brz merge lp:armagetronad
brz: ERROR: Ghost tags not supported by format <breezy.git.branch.LocalGitTagDict object at 0x7f8c44f892b0>.
No clue what ghost tags are. Google gave nothing on that error; some changelog said something about a fetch-ghost brz command. Tried that (maybe ghosts are things not yet locally present and fetch-ghosts fetches them, turning them real?), same result afterwards.
User avatar
Z-Man
God & Project Admin
Posts: 11585
Joined: Sun Jan 23, 2005 6:01 pm
Location: Cologne
Contact:

Re: And now we have git.

Post by Z-Man »

Temporary screwup on my part: During the night, one of my automated scripts accidentally merged the entirety of 0.2.9 into 0.2.8.3. github, gitlab and launchpad were all affected. The repository state has since been corrected and I could stop the build pipeline before it made permanent changes, phew.

If you pulled 0.2.8.3 from there in the past couple of hours, you'll need to do a forced/overwrite pull as soon as possible.
User avatar
Z-Man
God & Project Admin
Posts: 11585
Joined: Sun Jan 23, 2005 6:01 pm
Location: Cologne
Contact:

Re: And now we have git.

Post by Z-Man »

The bzr<->git syncing was stuck for months a bit back without anyone noticing... not even me, until I wanted to check on the state of the ap branches in git, finding them out of date. Syncing operates on git-remote-bzr (a modified version, too), which just like bzr itself requires Python 2. That is, of course, no longer under support. Syncing was just stuck on a task this time, but if it ever breaks now, especially if the raspi it's running on dies, or even just its SD card, I won't be able to restore it.

So, get to git!

I did give breezy another go. They support local storage either in git or bzr format. Using a local git format was full of pain and internal errors for me when trying to interface with bzr branches, and also what is the point? Using local bzr format integrates well with git, however (I'm snipping out some irrelevant messages):

Code: Select all

[manuel@Kermit breezy]$ brz init # that makes a local bzr repository
Created a standalone tree (format: 2a)
[manuel@Kermit breezy]$ bzr pull https://github.com/ArmagetronAd/armagetronad,branch=trunk
Total 37102 (delta 4538), reused 5470 (delta 4430), pack-reused 31428
+N  .bzrignore
+N  .cdtproject
...
All changes applied successfully.
Now on revision 3314 (git sha: b'ffac82d5b8bdbdc5e553e671b346dc5a50c15989').
It is completely incompatible with the existing bzr branches, however:

Code: Select all

[manuel@Kermit breezy]$ brz missing lp:armagetronad | head
You have 3314 extra revisions: ....
(3314 is all of the revisions)
And not even merge compatible with other git branches, if used remotely:

Code: Select all

[manuel@Kermit breezy]$ brz missing https://github.com/ArmagetronAd/armagetronad,branch=legacy_0.2.9 | head
You have 3314 extra revisions: ...
Only oddly:

Code: Select all

[manuel@Kermit breezy]$ brz missing https://github.com/ArmagetronAd/armagetronad,branch=legacy_0.2.8.3 | head
You have 2148 extra revisions: ...
And creating a local bzr version of 0.2.9 also works and creates a merge compatible branch:

Code: Select all

$ cd ..
$ mkdir 0.2.9
$ cd 0.2.9
$ bzr init
$ brz pull https://github.com/ArmagetronAd/armagetronad,branch=legacy_0.2.9
$ ...
$ cd ../breezy
$ [manuel@Kermit breezy]$ brz missing ../0.2.9/ 
$ You have 1862 extra revisions: ...
$ You are missing 1 revision: ...
which is about right.

I found no way to teach breezy about mark files, that is where git-remote-bzr stores which bzr revison corresponds to which git revision, and I keep them backed up.

BUT: I did the same operations on a different PC (one of my VPSes), and the resulting bzr branches were compatible! breezy must be generating the bzr revision identifiers (random GUIDs, normally) from the git hash. What I could verify is that it stores the git revision IDs in bzr.

BUTBUT: It is not round trip safe. You can't push from a bzr branch to git without losing information:

Code: Select all

bazaarmagetron@vmd53736:~/test/brz/brz$ brz push ../git/
brz: ERROR: It is not possible to losslessly push to git. You may want to use --lossy.
bazaarmagetron@vmd53736:~/test/brz/brz$ brz push ../git/ --lossy
All changes applied successfully.                                                                                                                                            
Pushed up to revision 1.
bazaarmagetron@vmd53736:~/test/brz/brz$ brz pull ../git/
brz: ERROR: These branches have diverged. Use the missing command to see how.                                                                                                
Use the merge command to reconcile them.
Yeah, then I did a 'bzr pull --overwrite' to at least see whether one can re-sync to the state from git, and the next
'brz push' produced yet another internal error.

So, in conclusion: breezy is a nice try, but can't be used to provide git/bzr interoperability for multiple users. Pulls from git to bzr work fine, though.

Breezy also comes with a replacement for git-remote-bzr, now for Pyhon 3. I suppose if anything has a chance of keeping our bzr branches alive longer, it's that. But do we need it?

(I tried to use 'bzr' for the repository type and 'brz' for the program consistently, but probably failed)

Edit: Nope, the new git-remote-bzr only works with smart bzr remote servers; on a repo with one commit, pull worked, but it can't then do the empty push back. Internal errors all around. Well, it warns about being experimental. I'll be checking back.
User avatar
Lucifer
Project Developer
Posts: 8640
Joined: Sun Aug 15, 2004 3:32 pm
Location: Republic of Texas
Contact:

Re: And now we have git.

Post by Lucifer »

I'm only using breezy for my private stuff. I've gotten the basics of git, and I just need to get around to making a gitlab account. :)

(One of these days, got a lot going on again :/ )
Image

Be the devil's own, Lucifer's my name.
- Iron Maiden
User avatar
Z-Man
God & Project Admin
Posts: 11585
Joined: Sun Jan 23, 2005 6:01 pm
Location: Cologne
Contact:

Re: And now we have git.

Post by Z-Man »

Z-Man wrote:Syncing was just stuck on a task this time, but if it ever breaks now, especially if the raspi it's running on dies, or even just its SD card, I won't be able to restore it.
Guess what happened just now. I thought I would need to move the power supply of the raspi to a different socket, so I shut it down cleanly. I did not actually have to relocate the plug... but when I restarted the raspi, it halted with a fatal error that, as casual googling suggest, means the SD is severely borked. We'll see about that, but I can only repeat:
So, get to git!
(The Login service does not start, which also means I can't even log in to diagnose the problem. I'll mirror the SD card before I do anything hasty.)
User avatar
Z-Man
God & Project Admin
Posts: 11585
Joined: Sun Jan 23, 2005 6:01 pm
Location: Cologne
Contact:

Re: And now we have git.

Post by Z-Man »

Managed to get it going again; the SD card was indeed partially borked, but for the syncing, only an easily reconstructible git repository was affected. The rest I moved back to the build server, where apparently it was running originally? I can't remember why I moved it away.

The Python2 constraint turned out to not be much of an issue so far. Python2 itself is still available on Ubuntu 22.04. Pip for it is not, but it's straightforward to manually install, and it then can be used to install bazaar (the original) only for the local user. The custom git-remote-bzr can also be directly installed for the user, and it all seems to be working fine; it picked up the balls right where the raspi dropped them. And all of the really crazy custom stuff is only visible for that one user, so a) it does not mess up anything else on the server and b) can easily be moved again.
Post Reply