Release notes
We did our first release from git tonight. It went well, I will chalk that up to all of the hard work from folks like
fu and
exor674 (and others!) to make sure that everything was in place.
fu put together a nice "things we have to do" in
dw_staff, so that was very helpful.
Anyway, I wanted to document some things that are important to know for the period between releases. This probably won't apply to most of you, but just in case...
So, we are following the document about a successful git branching model. This is what git flow is based on and it's a really efficient model, so we're using it for doing our features and in this case, our release.
The release process was, in essence:
- Create a
release-1.11.0branch - Make final tweaks in this branch to get things ready for release
- Push this branch live
- Merge this branch back in to
developandmaster - Add a release tag with the version number on
master
This leaves our repository in this state:
developis still open, you can keep committing things to it (no code freeze, yay!)masterhas stable tags, so you can always roll back to tags here (easy production rolls!)release-1.11.0is open for doing fixes on the live release (easy fixing production, yay!)
The thing that is important to know, if you are going to be committing fixes that you intend to go live, is that you need to make your changes on the release-x.xx.x branch -- not on develop. Any code committed to develop will, because of its nature, have to wait until the next code push -- weeks away.
If you have stuff you need to get live sooner (fixes to things broken in the last code push or stability/important fixes), you need to adjust your workflow slightly. It's pretty easy though, and goes something like this:
git checkout -b release-1.11.0 dreamwidth/release-1.11.0
Now make your fixes, as per normal, and submit a pull request. As long as your current branch is the release branch, then you will be able to submit a pull request on the appropriate branch, and we can merge it in and push it out to the site quite easily.

no subject
no subject
The first thing I've noticed is that "git status" shows that this is on the master branch. It should be on develop for doing stuff, so I am switching it with "git checkout develop".
Once I did that, "git status" says that this branch is ahead of dreamwidth/develop. That happens when there are commits locally that aren't on the remote branch.
This is the reverse of the problem
official branch graph:
ninetyd branch graph:
These are almost identical, but the difference is where "develop" is pointing. On your network graph, it's pointing at the same commit as master -- and on Dreamwidth, the develop branch is one back.
It looks like you have merged master into your develop -- and that's where it breaks, since that commit on master will never appear on develop on Dreamwidth's end. You can't pull or update or merge back since you have this extra commit. (Well, you could try to submit a pull request to merge this commit to Dreamwidth's develop, but we would reject it.)
So! How to fix? The reverse of what I gave to
git checkout develop
git fetch dreamwidth
git reset --hard dreamwidth/develop
This says to switch to the develop branch, then fetch all changesets from GitHub for Dreamwidth, then "blow away whatever I have, overwrite it with Dreamwidth's".
Finally, you will need to push this up to GitHub. Since you will be asking GitHub to go backwards, you have to emphatically push:
git push --force origin develop
You will have to do the same for dw-nonfree, but it will be the exact same steps since we use the same branch names.
Let me know how it goes, or if anything goes wary! I'll be around.
no subject
Edit: ran it again and it keeps happening. I get that frakking merge thing I pasted above.
no subject
no subject
Edit: it's from http://wiki.dwscoalition.org/wiki/index.php/Dev_Maintenance#dwu_-_Updating_the_repos. I've never had any problems with it before.
no subject
That script is not switching to the develop branch first, so it's not going to do what the author expects. If you do a "git pull dreamwidth develop:develop" while on master, it will update master with the commits from develop. And since, right now, the master has different commits, it generates the merge commits that are being a pain.
You can only do a git pull if you're on the right branch, so it needs to be preceded with a git checkout, like this:
git checkout develop
git pull --ff dreamwidth develop
That first makes sure you're on the develop branch, then it pulls it down. I added the --ff because we only want to allow fast-forwarded merges -- merge commits are going to cause problems here, so we don't ever want them.
I updated the dwu script on the wiki page, so that in the future people shouldn't run into this.
Presently though, since dwu pushes up to GitHub, you have pushed the merge commits that dwu made and so your GitHub is in a bad state. The best way to recover, IMO, is just to wipe things out and then start fresh.
This is the process I was advocating a bit ago, that will reset everything. Then you should be able to do the dwu and it will work...
git checkout develop
git fetch dreamwidth
git reset --hard dreamwidth/develop
git push --force origin develop
git checkout master
git fetch dreamwidth
git reset --hard dreamwidth/master
git push --force origin master
Do this in both dw-free and dw-nonfree directories. I will watch my email!
no subject
no subject
git pull dreamwidth develop:develop
git pull dreamwidth master:master
That will merge "develop" into whatever branch you're on. Then it will merge "master" into whatever branch you're on. It doesn't matter where you are -- that particular set of steps will screw up your repositories and then immediately push it up to GitHub, causing all sorts of trouble.
The only reason this ever worked is because we branched develop and then never touched master -- so it worked if someone was always in develop (like you) -- until yesterday, when I updated master. (And the only reason it worked to begin with is because master was an exact subset of develop, down to the ordering and everything.)
When
TMYK, I suppose.
no subject
no subject
no subject
Thanks for putting up with all of that! I hope it'll be smooth sailing from here on out. :)
no subject
no subject
no subject
Edit: I could reset things so they match thanks to the code you've give me above and dwu didn't give me any warnings this time but I still don't understand why this happens and I have to keep doing that. I'm not doing anything. I haven't created any branch or done any coding. I just open my software and pull updates with dwu.
no subject
no subject
This is my dwu script:
#!/bin/bash
stop-apache
cd $LJHOME
# pull changes from dreamwidth
git checkout develop
git pull --ff dreamwidth develop
git checkout master
git pull --ff dreamwidth master
# push them to Github forks
git push origin develop
git push origin master
# change to dw-nonfree
cd $LJHOME/ext/dw-nonfree
# pull changes from dw-nonfree
git checkout develop
git pull --ff dreamwidth develop
git checkout master
git pull --ff dreamwidth master
# push them to Github forks
git push origin develop
git push origin master
start-apache
This is my dwdb script:
#!/bin/bash
$LJHOME/bin/upgrading/update-db.pl -r -p --innodb && \
$LJHOME/bin/upgrading/update-db.pl -r --cluster=all --innodb && \
$LJHOME/bin/upgrading/texttool.pl load
no subject
Your release branch has one commit on it -- that you've opened a pull request for. That also looks fine, assuming that you intend to make this commit on the release branch (i.e., high priority bug fixes we want to release before the next official coce push).
So -- assuming that's true, everything looks just fine... where are you seeing the comments about being 'commits ahead'?
no subject
I did all the steps I mentioned in my previous comment. When I saw the 'ahead' message and my graph didn't match the one for dreamwidth/dw-free I did this:
git checkout develop
git fetch dreamwidth
git reset --hard dreamwidth/develop
git push --force origin develop
git checkout master
git fetch dreamwidth
git reset --hard dreamwidth/master
git push --force origin master
Checked my branches, my graph, ran dwu to make sure everything was ok and it was then. That's when I created the release branch to fix a bug in Librarian's Dream. So everything is fine now but it wasn't before. And I don't understand why because I hadn't done anything on my end. So now it feels my repos are going to keep 'breaking' every time I fetch updates.
no subject
no subject
And it was only the free repo this time, not the nonfree one.
no subject
It would also be helpful, at that time, to see a history of the last few things you typed in the console. Between that and looking at the repositories, I should be able to divine what did what.
no subject
no subject
dh-ninetydegrees@newhack:~$ cd $LJHOME
dh-ninetydegrees@newhack:~/dw$ status
...
dw-free
...
* develop
master
release-1.11.0
...
dw-nonfree
...
develop
* master
dh-ninetydegrees@newhack:~/dw$ switch
dh-ninetydegrees@newhack:~/dw/ext/dw-nonfree$ checkout develop
-bash: checkout: command not found
dh-ninetydegrees@newhack:~/dw/ext/dw-nonfree$ git checkout develop
Switched to branch 'develop'
dh-ninetydegrees@newhack:~/dw/ext/dw-nonfree$ switch
dh-ninetydegrees@newhack:~/dw$ dwupd
Already on 'develop'
remote: Counting objects: 108, done.
remote: Compressing objects: 100% (41/41), done.
remote: Total 79 (delta 62), reused 55 (delta 38)
Unpacking objects: 100% (79/79), done.
From https://github.com/dreamwidth/dw-free
* branch develop -> FETCH_HEAD
Updating b556839..f3ec800
Fast-forward
bin/upgrading/s2layers/librariansdream/layout.s2 | 41 ++++++++++++++++++++++++-----------------
bin/upgrading/s2layers/paperme/layout.s2 | 34 +++++++++++++++++++++++++---------
cgi-bin/DW/Controller/Entry.pm | 10 ++++++----
cgi-bin/LJ/S2.pm | 7 ++-----
cgi-bin/LJ/Tags.pm | 18 ++++++++++++++++++
htdocs/js/jquery.postform.js | 7 ++++++-
schemes/common.tt | 10 +++++-----
views/entry/form.tt | 8 +++++++-
views/entry/form.tt.text | 2 ++
9 files changed, 95 insertions(+), 42 deletions(-)
Switched to branch 'master'
remote: Counting objects: 3, done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 3 (delta 0), reused 2 (delta 0)
Unpacking objects: 100% (3/3), done.
From https://github.com/dreamwidth/dw-free
* branch master -> FETCH_HEAD
Updating ad92f6a..21f0c64
Fast-forward
bin/upgrading/s2layers/core2.s2 | 2 +-
bin/upgrading/s2layers/librariansdream/layout.s2 | 41 ++++++++++++++++++++++++-----------------
bin/upgrading/s2layers/paperme/layout.s2 | 34 +++++++++++++++++++++++++---------
bin/upgrading/s2layers/siteviews/layout.s2 | 2 +-
bin/upgrading/s2layers/siteviews/themes.s2 | 6 ------
cgi-bin/DW/Controller/Entry.pm | 10 ++++++----
cgi-bin/LJ/S2.pm | 25 ++++++++++++++++++-------
htdocs/js/jquery.cuttag-ajax.js | 7 -------
htdocs/js/jquery.postform.js | 7 ++++++-
htdocs/stc/celerity/celerity.css | 4 ++--
htdocs/stc/entrypage.css | 1 +
htdocs/stc/gradation/gradation.css | 4 ++--
htdocs/stc/lynx/lynx.css | 4 ++--
htdocs/stc/replypage.css | 2 +-
schemes/common.tt | 10 +++++-----
views/entry/form.tt | 8 +++++++-
views/entry/form.tt.text | 2 ++
17 files changed, 103 insertions(+), 66 deletions(-)
Password for 'https://ninetyd@github.com':
dh-ninetydegrees@newhack:~/dw$ dwupd
httpd (no pid file) not running
Switched to branch 'develop'
Your branch is ahead of 'dreamwidth/develop' by 17 commits.
From https://github.com/dreamwidth/dw-free
* branch develop -> FETCH_HEAD
Already up-to-date.
Switched to branch 'master'
Your branch is ahead of 'dreamwidth/master' by 22 commits.
From https://github.com/dreamwidth/dw-free
* branch master -> FETCH_HEAD
Already up-to-date.
Password for 'https://ninetyd@github.com':
Counting objects: 108, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (79/79), done.
Writing objects: 100% (79/79), 9.39 KiB, done.
Total 79 (delta 61), reused 0 (delta 0)
To https://ninetyd@github.com/ninetyd/dw-free.git
b556839..f3ec800 develop -> develop
Counting objects: 3, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 1.27 KiB, done.
Total 3 (delta 0), reused 0 (delta 0)
To https://ninetyd@github.com/ninetyd/dw-free.git
ad92f6a..21f0c64 master -> master
Already on 'develop'
From https://github.com/dreamwidth/dw-nonfree
* branch develop -> FETCH_HEAD
Already up-to-date.
Switched to branch 'master'
From https://github.com/dreamwidth/dw-nonfree
* branch master -> FETCH_HEAD
Already up-to-date.
Everything up-to-date
Everything up-to-date
Apache started successfully!
dh-ninetydegrees@newhack:~/dw$ dwupd
Switched to branch 'develop'
Your branch is ahead of 'dreamwidth/develop' by 17 commits.
From https://github.com/dreamwidth/dw-free
* branch develop -> FETCH_HEAD
Already up-to-date.
Switched to branch 'master'
Your branch is ahead of 'dreamwidth/master' by 22 commits.
From https://github.com/dreamwidth/dw-free
* branch master -> FETCH_HEAD
Already up-to-date.
Everything up-to-date
Everything up-to-date
Switched to branch 'develop'
From https://github.com/dreamwidth/dw-nonfree
* branch develop -> FETCH_HEAD
Already up-to-date.
Switched to branch 'master'
From https://github.com/dreamwidth/dw-nonfree
* branch master -> FETCH_HEAD
Already up-to-date.
Everything up-to-date
Everything up-to-date
Apache started successfully!
After that I ran dwdb and everything looked normal there (it's too long to paste; sorry).
no subject
I've updated your dwu script with two 'git fetch dreamwidth' lines. Try that for a bit and see if it works, or if you see any problems?
no subject
(no subject)
(no subject)