Create account / Log in

Moving on with deployment and build handling

Discussion area for the development team.

Moderators: uckelman, Tim M

Re: Moving on with deployment and build handling

Postby Cattlesquat » July 21st, 2020, 8:28 pm

Okay, for the record the sequence of commands I was normally using was:

git checkout Bugfix13191
git rebase --onto master Bugfix13191
git pull
git push
git push -u origin Bugfix13191

I will fully admit to "only barely understanding" what the three middle commands even do. So if someone provides a different set of steps I'm happy to do it instead.

Meanwhile having apparently erased the entire contents of PR 107, I stuck up PR 110 which has what I had when I finished 107 and built the final successful test the other day (huge bonus dividend of having had to build that on a linux virtual machine). But it will surely have to be remerged in all sorts of painful ways so I'll wait to see if we can recover PR 107 before attempting it.
User avatar
Cattlesquat
 
Posts: 895
Joined: December 2nd, 2019, 4:57 pm
Location: Baltimore, Maryland, USA

Re: Moving on with deployment and build handling

Postby uckelman » July 21st, 2020, 8:58 pm

Thus spake Cattlesquat:
> Okay, for the record the sequence of commands I was normally using was:
>
> git checkout Bugfix13191
> git rebase --onto master Bugfix13191

AAAAAAAAHHHHHH!!!!

You likely have two problems here.

(For anyone reading this who knows how git works: Yes, I know how git
works myself and I know I'm being a bit inexact and hand-wavy here.)

When you rebase, what you're doing is taking one branch and pasting
another branch onto the end of it, more or less.

So, the syntax is this:

git rebase [--onto <newbase>] <upstream> [<branch>]

<newbase> is the branch you are pasting onto, hence the name of the
option. The --onto flag is optional, so if you don't specify it, <newbase>
defaults to <upstream>, and <branch> is also optional, defaulting to the
branch you're on.

When you're trying to do some particuarly complex history rewriting,
you can have situations where <newbase>, <upstream>, and <branch>
are three distinct branches, but that's not the situation you have
when you're just trying to remove de-conflict a PR.

What you want for fixing a PR is for <newbase> and <upstream> to be
the same, and for <branch> to be the branch you're on.

So, the correct command to rebase Bugfix13191 over master when you
have Bugfix13191 checked out already is this:

git rebase master

If, instead, you do

git rebase --onto master Bugfix13191

you're making <newbase> master, but you're making both <upstream> and
<branch> Bugfix13191, and the result is what you've been getting, which
is Totally Fucked Up.

I'll follow up with a bit more in a few minutes...

--
J.
User avatar
uckelman
Site Admin
 
Posts: 8849
Joined: December 10th, 2007, 9:48 am
Location: Durham, England

Re: Moving on with deployment and build handling

Postby uckelman » July 21st, 2020, 9:09 pm

The second problem I suspect you are having is this: When you rebase (or merge, or anything except a pull), you're using your _local_ copies of branches, but GitHub is computing diffs using it's local copies, not yours. GitHub's local copies are "remotes" to you. So if you're going to rebase, it is essential that before you do so, you ensure that the branch you are using as your <upstream> (and <newbase>) are current---if you don't do that, you're pasting your changes onto a branch which is behind what GitHub has and inviting a mess.

So, the right way to do the whole process is:

git checkout master
git pull
git checkout Bugfix13191
git rebase master
git push
User avatar
uckelman
Site Admin
 
Posts: 8849
Joined: December 10th, 2007, 9:48 am
Location: Durham, England

Re: Moving on with deployment and build handling

Postby Cattlesquat » July 21st, 2020, 9:11 pm

Oooooo. I look forward to serving my overlords with a new set of commands!

I guess that just leaves "dealing with the current mess."
User avatar
Cattlesquat
 
Posts: 895
Joined: December 2nd, 2019, 4:57 pm
Location: Baltimore, Maryland, USA

Re: Moving on with deployment and build handling

Postby uckelman » July 21st, 2020, 9:12 pm

That last push will probably need to be a "force push", which always makes me feel like a Jedi when I do it:

git push -f

(You'll get an error when you try to do a regular push after rewriting history, because by doing a rebase you've changed the DAG in a way which is incompatible with what the remote had before. The -f just tells it that you really intend to replace the old branch with the new, rewritten branch.)
User avatar
uckelman
Site Admin
 
Posts: 8849
Joined: December 10th, 2007, 9:48 am
Location: Durham, England

Re: Moving on with deployment and build handling

Postby uckelman » July 21st, 2020, 9:21 pm

Finally, reaching this point with git where you've created a mess that you don't understand is a sort of rite of passage which happens to everyone. It's something you have to go through on your way to enlightenment.

One thing I strongly recommend now that you're starting to bump into these issues is to read enough of the Git Book to get a sense of how Git actually works. Having a mental model of what Git is actually doing is immensely helpful, I found, for understanding what command you want to achieve your ends.

https://git-scm.com/book/en/v2

The short version, condensed to the point of uselessness, is that Git operates on Directed Acyclic Graphs and that branches and tags are names for nodes in your DAG, committing adds leaf nodes with a single parent, merging adds a leaf node with two parents, and rebasing rearranges nodes by reparenting them.

But seriously, read through the book and absorb the diagrams. It is totally worth it for understanding what the tools do. (Note that it is perhaps more theoretical-computer-sciency than some other books of this sort, and that part of it really speaks to me given my background in logic and theoretical CS... but it also underlies why and how it all works.)
User avatar
uckelman
Site Admin
 
Posts: 8849
Joined: December 10th, 2007, 9:48 am
Location: Durham, England

Re: Moving on with deployment and build handling

Postby Flint1b » July 21st, 2020, 10:06 pm

uckelman wrote:Finally, reaching this point with git where you've created a mess that you don't understand is a sort of rite of passage which happens to everyone. It's something you have to go through on your way to enlightenment.


Indeed :D

What I found useful after having learned the basics and especially for these complex situations with rebasing and rewriting history, is graphical tools, or at least a good "git log" alias that displays different paths in the graph in different colors. CS theory is nice and all but computers are a very practical thing and having a graphical representation of a concrete problem in front of you helps a lot.

I even have to admit that I hardly use git on the command line these days, the git client in IntelliJ is good, other graphical tools are very good too, the one in Eclipse is good, "Sourcetree" for Windows (and I think Mac) is good.
User avatar
Flint1b
 
Posts: 461
Joined: May 19th, 2020, 12:27 am
Location: Colonia Agrippina

Re: Moving on with deployment and build handling

Postby Flint1b » July 21st, 2020, 10:16 pm

Oh my, the PRs that had their conflicts resolved look mad now, I think rebasing and force-pushing is in order.

I have about 20 notifications in my github list, some of them say "mention" but I don't see my name mentioned in any new comments there.

If I can help with fixing any PRs, let me know that here, I might miss the cries for help on GitHub.
User avatar
Flint1b
 
Posts: 461
Joined: May 19th, 2020, 12:27 am
Location: Colonia Agrippina

Re: Moving on with deployment and build handling

Postby uckelman » July 21st, 2020, 10:29 pm

Also, here's another useful "reference":

https://git-man-page-generator.lokaltog.net/

--
J.
User avatar
uckelman
Site Admin
 
Posts: 8849
Joined: December 10th, 2007, 9:48 am
Location: Durham, England

Re: Moving on with deployment and build handling

Postby Flint1b » July 21st, 2020, 10:36 pm

About the new maven structure:
- the project is split into two maven modules now, each with it's own pom.xml, held together by an "umbrella" module which also has it's own pom.xml
- vassal-app is Vassal itself, the artifact it produces is the vassal jar
- release-prepare has to do with preparing the release, should be of no interest to anyone except Joel and the build server, it produces the necessary files needed by the Makefile to build the final release
- vassal-parent is the umbrella module

Also,

@everyone, don't forget to update the maven project configuration, a lot has changed.

@Joel - better keep an eye on the new naming of the vassal jar, it now has it's version number attached, I did all I could to prevent any errors due to that but I haven't built actual release packages. We probably have to decide how to handle version numbers, before this change the version number in the pom.xml was largely irrelevant but starting with this change it probably should be the leading version number. And we can now start thinking how we want to deploy the vassal.jar, we can go all the way and get it into maven central (most work needed), or some 3rd party free-for-open-source repository like Bintray (I think less work needed than for maven central), or we make our own maven repository on github (least work needed, just have to decide whether it's going to be in the vassal repo or make a new repo for that e.g. vassalengine/vassal-releases).
User avatar
Flint1b
 
Posts: 461
Joined: May 19th, 2020, 12:27 am
Location: Colonia Agrippina

Re: Moving on with deployment and build handling

Postby Flint1b » July 21st, 2020, 10:38 pm

uckelman wrote:Also, here's another useful "reference":

https://git-man-page-generator.lokaltog.net/

--
J.


You're going to scare everyone away with jokes like this :D
User avatar
Flint1b
 
Posts: 461
Joined: May 19th, 2020, 12:27 am
Location: Colonia Agrippina

Re: Moving on with deployment and build handling

Postby uckelman » July 21st, 2020, 10:44 pm

Thus spake Flint1b:
>
> "uckelman" wrote:
> > Also, here's another useful "reference":
> >
> > https://git-man-page-generator.lokaltog.net/[1]
> >
> > --
> > J.
>
>
> You're going to scare everyone away with jokes like this :D

But! But! That's possibly my favorite thing on the internet. It makes
me laugh every single time I look at it, and has for years. It's near
perfect satire.

--
J.
User avatar
uckelman
Site Admin
 
Posts: 8849
Joined: December 10th, 2007, 9:48 am
Location: Durham, England

Re: Moving on with deployment and build handling

Postby Brent Easton » July 21st, 2020, 10:44 pm

:) Got me!
User avatar
Brent Easton
 
Posts: 3170
Joined: December 21st, 2007, 3:06 am
Location: Berry, NSW, Australia

Re: Moving on with deployment and build handling

Postby Flint1b » July 21st, 2020, 10:58 pm

User avatar
Flint1b
 
Posts: 461
Joined: May 19th, 2020, 12:27 am
Location: Colonia Agrippina

Re: Moving on with deployment and build handling

Postby Brent Easton » July 21st, 2020, 11:06 pm

User avatar
Brent Easton
 
Posts: 3170
Joined: December 21st, 2007, 3:06 am
Location: Berry, NSW, Australia

PreviousNext

Return to Developers

Who is online

Users browsing this forum: No registered users and 3 guests

cron