liv: Stylised sheep with blue, purple, pink horizontal stripes, and teacup brand, dreams of Dreamwidth (sheeeep)
[personal profile] liv posting in [community profile] livredor
Three years since I touched DW dev, so I'm rusty as you could imagine. I decided to start with a simple colour theme, because at least I know S2 meaning that it would be a way of doing hello world and getting used to the workflow for submitting patches. I grabbed the top entry from [site community profile] dreamscapes, which happened to be four themes by [personal profile] rising. [personal profile] rising has excellent colour sense and enough experience with DW that his themes are generally almost ready to go with minimal tweaking, so that made it an easy starter bug for me.

As it happens, several things about the environment have changed over my long hiatus. The S2 layer editor has been tweaked so it's less user-hostile (I always test code in the layer editor first before I start changing theme files). DW's file structure has been moved around and rationalized a bit so it's more logical and easier to find the file to work with. The Wiki has ridiculously better documentation than what I was working with when I first started, including detailed style guidance so that code committed by different people, even newbies, will have the same structure, yay.

And... we have migrated from Mercurial to Git. I know a lot of people found it hard to adapt, so the fact I've forgotten everything I ever knew about submitting patches probably actually stood me in good stead. Getting set up was pretty easy; I went into #dreamwidth IRC to ask if I should try to revive my old Dreamhack or start afresh, and [personal profile] sophie happened to be online so she set me up with a new 'hack right away. I followed Dreamhack Getting Started from the Wiki, and it was pretty smooth sailing, apart from a very minor issue about Viz, the documentation was slightly out of date and the inheritance pattern between the master file and the local one was a bit off. But people in IRC quickly fixed that for me and updated the Wiki page on the fly, so that was fine.

Then I turned to Getting started on Windows. In fact I was able to skip most of the first half of the page as I already had a Bugzilla account, a CLA, and all the software from last time I was active in development. The only new thing was creating a GitHub account and forking the DW code. And that was delightfully straightforward! Then I followed the links from the Getting Started page to create bash scripts for updating. Again, straightforward and I refreshed my memory on how to use WinSCP to modify files on my Dreamhack.

So from here on in, Make changes to your local code and Adding a new color theme become my Bible. I keep referring back to them at every step, and being impressed at how helpful and clear they are!

I create a Bugzilla bug. Easy for me, I'm familiar with Bugzilla. I notice 'zilla has been modernized slightly since I last poked it, but only in ways that make it easier to use, not harder. Then I have to make a Git branch. That seems to work; being over-cautious because I'm still a bit scared of Git, I devote a whole branch to just one theme, Evening.

Rather than go straight to modifying the files, I work in the web-based S2 editor on my Dreamhack. Mainly because I like having the preliminary check of clicking compile and getting "No errors" and then going direct to my journal and seeing if it looks right, without having to mess around updating databases. And because it keeps the worst stages of my initial, error-filled attempts out of my dev environment and the code that I actually ask people to review. Yes, I have issues about doing stuff badly; volunteering for DW and being admittedly a very very tiny little babydev is part of what I'm doing to try to get round that.

I fairly quickly manage to get a theme layer that works, that looks identical to [personal profile] rising's submission to [site community profile] dreamscapes, and fits the style guide in Adding a new color theme. Then I modify Patsy/themes.s2 using WinSCP plus Notepad++, and following the instructions in How to patch styles and themes to find the relevant file. Update the database on my Dreamhack (dwdb), check that the Evening theme is now available as a selectable style from the customize wizard and listed in the layers directory, and there's my first little patchling.

I'm generally hanging out in IRC while I code, and people are being encouraging and don't seem to mind my habit of thinking aloud. I get a bit of reassurance that (unlike the bad old days) you can actually make a complete new colour theme by altering one file only, and some suggestions for testing said colour theme (eg setting the browser background colour to something other than the default and checking it doesn't show through; you'd be surprised how many quite major pro sites fail this test now I've changed this setting!)

Time for my first interaction with Git. I initially didn't quite understand what was supposed to happen in between git add, git commit and git push, but the answer is that if you're not being excessively cautious due to trying everything for the first time, you can add several files to the same commit, one at a time if need be. And you can test the locally committed files before pushing them to GitHub. Once I'd had that explained to me, I was able to make my first pull request. I was a bit confused about the relationship between a pull request in the new system and a patch in the old, Mercurial-based system, but IRC people helpfully explained all.

Then I repeated the whole process to implement [personal profile] rising's Hollow Silence theme, with a bit less stopping to ask questions at every single step. Then the same for Today I'm Happy. So, three teeny twig-like branches on Git, each with a single altered file. This is about the point where I start to like Git, because I was a bit confused about what would happen with trying to compare my new theme to the original parent version, or the version after I'd added the previous themes. And Git makes this just magically work; with Mercurial I'd have had to think it through carefully at each stage and probably messed it up!

Then, after I went offline, [personal profile] afuna came and reviewed my pull requests. She found some minor style errors and very gently explained to me what I needed to fix. So I revised the relevant files and updated the branches and it was generally very plausible. However, at some point in this process I did something wrong, I think it was to do with forgetting to switch to the right branch before I made a change, I really don't know. But as a result of that, every time I did anything I ended up with this commit in my branches. That isn't a real commit at all, it's just whatever happened to be the latest change to the repository at the time I made the error.

So the first time it happened, I went in IRC and [staff profile] mark and others helped me clean up my branch with that incorrect commit in it. And we made a new branch and used Git magic to cherrypick the wanted commits and leave behind the weird messed up one. However, when I went to look at GitHub again the messed up commit was right there in the newly created branch after all. Then I got stressed about having messed up, and also busy, so I left it alone for a week or so. I did a bit of trying to troubleshoot, with the help of [personal profile] sophie and others in IRC, trying to figure out what I had done to put that commit into both the original Hollow Silence branch and the new version I made with [staff profile] mark's help. This ended up with updating the dwu script a bit, and some even more careful checks for me to make to really really make sure I wasn't in the wrong branch at any point, but we didn't really track down the problem.

When I came back, I decided to start again with a completely new thing, namely implementing the sole Leftovers theme from [personal profile] rising's post. And it was all fine, went through the process with no problems, until I made the pull request on GitHub and bam, the zombie commit appeared again in my newly created branch that had nothing to do with the previous problem I'd had. So I went back to IRC and [staff profile] mark took a look at the situation. We still couldn't figure out what exactly I had done wrong to cause this zombie commit to keep showing up all the time, but [staff profile] mark was able to fix it and make sure that my repository was clean and I could safely create new branches.

Oh, and in between this, I learned how to make preview images, a step I've always struggled with before in making S2 themes. My main issue is that the only image manipulation software I have is Photoshop, which is a bit overkill for just resizing things down to 150x114. Plus I can't start Photoshop on my computer without a clean restart, which is very annoying if I'm in the middle of developing and have a browser with multiple tabs and PuTTY and WinSCP and an IRC client (Pidgin) open. Also I didn't really know how to take a screenshot of the actual screen area, not the whole desktop including all the toolbars and unwanted gubbins, and again, cropping all that out of the image is faffy. So I installed a Firefox extension, Fireshot, as instructed in the Wiki, and played around until I had worked out that the correct plan is to open my journal in a new window, use F11 to fullsize it, and then take the screenshot with Fireshot, giving me a .png with the appropriate aspect ratio. The second thing that happened was that [personal profile] momijizukamori and [personal profile] sophie installed ImageMagick into the Dreamhacks, meaning that I could resize images actually on my hack by simply invoking a script, much easier than faffing around with Photoshop. The thing I need to be careful of is that I have to add the file to git, not the whole folder with all the preview images in it, because Momiji's script resizes all the files, even the ones that are already the right size and I don't want them to show up as changed files in my commits.

The thing that was frustrating about this was not being able to work out what I'd done wrong! I'm not worried about making a mistake, that's obviously going to happen when I'm learning the system for the first time. What I found difficult was that the thing I did wrong, whatever it was, was untraceable, and most especially that it was putting the zombie commit into all my branches, even though I was being ultra, ultra careful to do everything right when I created the branches. However, everybody in IRC was incredibly supportive and helpful, so I'm not going to give up trying to learn version control because of that set-back.

Date: 2013-05-21 06:42 pm (UTC)
kaberett: Overlaid Mars & Venus symbols, with Swiss Army knife tools at other positions around the central circle. (Default)
From: [personal profile] kaberett
This would be super-interesting to have over in dw_dev_training (or linked to from there, or whatever) if you're okay with that?

Date: 2013-05-21 09:08 pm (UTC)
kaberett: Overlaid Mars & Venus symbols, with Swiss Army knife tools at other positions around the central circle. (Default)
From: [personal profile] kaberett
Honestly, I think even the only-relevant-to-you detail is really helpful because it gives people a realistic idea of what's involved "and then this step happened, and then this other one, and then I GAVE UP IN HORROR" is exactly the kind of thing rah loves to read in dev_training, so if you're comfortable with it... :-)

(I am feeling a bit weird about how much I'm doing babydev-wise atm, but will post a link if you'd rather not put this there yourself!)

And: I like reading about learning, and I like reading about all the things you're learning _about_, and I'm sure I'll learn things myself from them :-) So!

Date: 2013-05-22 09:12 am (UTC)
synecdochic: torso of a man wearing jeans, hands bound with belt (Default)
From: [personal profile] synecdochic
it's like you know me or something!

and yes, this is exactly the kind of thing i'd love to see more of in [site community profile] dw_dev_training. one of the things we most try to demystify is the notion that there are Programmers and Non-Programmers, and if you're a Programmer you spring forth fully able to do all this sort of stuff without thinking twice, and if you're a Non-Programmer you'll never learn it. i love seeing posts that go into people's problem-solving thought processes with all the dead ends included, people's total cock-ups, people's "i am going to throw this laptop out the window" frustrations, etc, because it really reinforces the idea that nobody is born knowing this kind of thing!

which reminds me, next time i patch a bug, i should do a walkthrough. i sometimes think i exist to prove that just because your name's on the incorporation paperwork doesn't mean you know what you're doing. ;)

but yes, [personal profile] liv, please do post this to [site community profile] dw_dev_training if you're willing! hearing multiple voices sharing their frustrations and imperfections and giving-up-in-horror moments is definitely a great club to beat down the impostor syndrome with.

Date: 2013-05-28 01:18 pm (UTC)
purplecat: Programming the Eniac Computer (programming)
From: [personal profile] purplecat
Re: zombie commits. I was getting these too and I have a suspicion it is because I was merging changes from the development branch into my working branch as I went along. Since I switched to rebasing my working branch every time develop is updated rather than merging I have, fingers crossed, not had any zombie commits.

Date: 2013-05-28 03:57 pm (UTC)
purplecat: Programming the Eniac Computer (programming)
From: [personal profile] purplecat
Well, bearing in mind my grasp of Git is somewhat hazy.

When I see on [site community profile] changelog that a bunch of commits have happened on the develop branch I used to do git merge develop on whatever branch I was working on at the time. That way the branch I was working on would be up-to-date with whatever was happening on the development branch. This seemed to result in lots of weird commit messages in my log. If you're not doing this then my suggestion probably isn't going to help. (Though it occurs to me that, in that case, your phantom commit message could be appearing because the branch you are working on for your changes has got behind the develop branch).

Now I type git rebase develop instead and that seems to get rid of the weird commit messages.

I think I know why this works, but it might work better if someone with a sounder grasp of git explained the difference between merge and rebase because my thoughts about them could be wrong.

Date: 2013-05-28 05:05 pm (UTC)
ninetydegrees: Drawing: cowboy lassoing on a horse (rodeo)
From: [personal profile] ninetydegrees
Thanks for sharing this! It was very interesting indeed. Thanks also for your kind words about the newbie articles on the wiki. I had already updated the windows guide following IRC conversations but this prompted me to update the color theme guide too. Hopefully the section about previews is simpler and clearer now. :)
Edited (oops) Date: 2013-05-28 05:05 pm (UTC)

Date: 2013-05-28 09:57 pm (UTC)
momijizukamori: Green icon with white text - 'I do believe in phosphorylation! I do!' with a string of DNA basepairs on the bottom (Default)
From: [personal profile] momijizukamori
I really need to clean up my preview script instructions and add them to that page, too.

(which I started as I was explaining it to Liv, but I'm not sure how clear my typed up instructions are alone)

February 2016

1415 1617181920

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Sep. 21st, 2017 11:13 pm
Powered by Dreamwidth Studios