Reading List
The most recent articles from a list of feeds I subscribe to.
Reasons to use your shell's job control
Hello! Today someone on Mastodon asked about job control (fg, bg, Ctrl+z,
wait, etc). It made me think about how I don’t use my shell’s job
control interactively very often: usually I prefer to just open a new terminal
tab if I want to run multiple terminal programs, or use tmux if it’s over ssh.
But I was curious about whether other people used job control more often than me.
So I asked on Mastodon for reasons people use job control. There were a lot of great responses, and it even made me want to consider using job control a little more!
In this post I’m only going to talk about using job control interactively (not in scripts) – the post is already long enough just talking about interactive use.
what’s job control?
First: what’s job control? Well – in a terminal, your processes can be in one of 3 states:
- in the foreground. This is the normal state when you start a process.
- in the background. This is what happens when you run
some_process &: the process is still running, but you can’t interact with it anymore unless you bring it back to the foreground. - stopped. This is what happens when you start a process and then press
Ctrl+Z. This pauses the process: it won’t keep using the CPU, but you can restart it if you want.
“Job control” is a set of commands for seeing which processes are running in a terminal and moving processes between these 3 states
how to use job control
fgbrings a process to the foreground. It works on both stopped processes and background processes. For example, if you start a background process withcat < /dev/zero &, you can bring it back to the foreground by runningfgbgrestarts a stopped process and puts it in the background.- Pressing
Ctrl+zstops the current foreground process. jobslists all processes that are active in your terminalkillsends a signal (likeSIGKILL) to a job (this is the shell builtinkill, not/bin/kill)disownremoves the job from the list of running jobs, so that it doesn’t get killed when you close the terminalwaitwaits for all background processes to complete. I only use this in scripts though.- apparently in bash/zsh you can also just type
%2instead offg %2
I might have forgotten some other job control commands but I think those are all the ones I’ve ever used.
You can also give fg or bg a specific job to foreground/background. For example if I see this in the output of jobs:
$ jobs
Job Group State Command
1 3161 running cat < /dev/zero &
2 3264 stopped nvim -w ~/.vimkeys $argv
then I can foreground nvim with fg %2. You can also kill it with kill -9 %2, or just kill %2 if you want to be more gentle.
how is kill %2 implemented?
I was curious about how kill %2 works – does %2 just get replaced with the
PID of the relevant process when you run the command, the way environment
variables are? Some quick experimentation shows that it isn’t:
$ echo kill %2
kill %2
$ type kill
kill is a function with definition
# Defined in /nix/store/vicfrai6lhnl8xw6azq5dzaizx56gw4m-fish-3.7.0/share/fish/config.fish
So kill is a fish builtin that knows how to interpret %2. Looking at
the source code (which is very easy in fish!), it uses jobs -p %2 to expand %2
into a PID, and then runs the regular kill command.
on differences between shells
Job control is implemented by your shell. I use fish, but my sense is that the basics of job control work pretty similarly in bash, fish, and zsh.
There are definitely some shells which don’t have job control at all, but I’ve only used bash/fish/zsh so I don’t know much about that.
Now let’s get into a few reasons people use job control!
reason 1: kill a command that’s not responding to Ctrl+C
I run into processes that don’t respond to Ctrl+C pretty regularly, and it’s
always a little annoying – I usually switch terminal tabs to find and kill and
the process. A bunch of people pointed out that you can do this in a faster way
using job control!
How to do this: Press Ctrl+Z, then kill %1 (or the appropriate job number
if there’s more than one stopped/background job, which you can get from
jobs). You can also kill -9 if it’s really not responding.
reason 2: background a GUI app so it’s not using up a terminal tab
Sometimes I start a GUI program from the command line (for example with
wireshark some_file.pcap), forget to start it in the background, and don’t want it eating up my terminal tab.
How to do this:
- move the GUI program to the background by pressing
Ctrl+Zand then runningbg. - you can also run
disownto remove it from the list of jobs, to make sure that the GUI program won’t get closed when you close your terminal tab.
Personally I try to avoid starting GUI programs from the terminal if possible
because I don’t like how their stdout pollutes my terminal (on a Mac I use
open -a Wireshark instead because I find it works better but sometimes you
don’t have another choice.
reason 2.5: accidentally started a long-running job without tmux
This is basically the same as the GUI app thing – you can move the job to the background and disown it.
I was also curious about if there are ways to redirect a process’s output to a file after it’s already started. A quick search turned up this Linux-only tool which is based on nelhage’s reptyr (which lets you for example move a process that you started outside of tmux to tmux) but I haven’t tried either of those.
reason 3: running a command while using vim
A lot of people mentioned that if they want to quickly test something while
editing code in vim or another terminal editor, they like to use Ctrl+Z
to stop vim, run the command, and then run fg to go back to their editor.
You can also use this to check the output of a command that you ran before
starting vim.
I’ve never gotten in the habit of this, probably because I mostly use a GUI version of vim. I feel like I’d also be likely to switch terminal tabs and end up wondering “wait… where did I put my editor???” and have to go searching for it.
reason 4: preferring interleaved output
A few people said that they prefer to the output of all of their commands being interleaved in the terminal. This really surprised me because I usually think of having the output of lots of different commands interleaved as being a bad thing, but one person said that they like to do this with tcpdump specifically and I think that actually sounds extremely useful. Here’s what it looks like:
# start tcpdump
$ sudo tcpdump -ni any port 1234 &
tcpdump: data link type PKTAP
tcpdump: verbose output suppressed, use -v[v]... for full protocol decode
listening on any, link-type PKTAP (Apple DLT_PKTAP), snapshot length 524288 bytes
# run curl
$ curl google.com:1234
13:13:29.881018 IP 192.168.1.173.49626 > 142.251.41.78.1234: Flags [S], seq 613574185, win 65535, options [mss 1460,nop,wscale 6,nop,nop,TS val 2730440518 ecr 0,sackOK,eol], length 0
13:13:30.881963 IP 192.168.1.173.49626 > 142.251.41.78.1234: Flags [S], seq 613574185, win 65535, options [mss 1460,nop,wscale 6,nop,nop,TS val 2730441519 ecr 0,sackOK,eol], length 0
13:13:31.882587 IP 192.168.1.173.49626 > 142.251.41.78.1234: Flags [S], seq 613574185, win 65535, options [mss 1460,nop,wscale 6,nop,nop,TS val 2730442520 ecr 0,sackOK,eol], length 0
# when you're done, kill the tcpdump in the background
$ kill %1
I think it’s really nice here that you can see the output of tcpdump inline in your terminal – when I’m using tcpdump I’m always switching back and forth and I always get confused trying to match up the timestamps, so keeping everything in one terminal seems like it might be a lot clearer. I’m going to try it.
reason 5: suspend a CPU-hungry program
One person said that sometimes they’re running a very CPU-intensive program,
for example converting a video with ffmpeg, and they need to use the CPU for
something else, but don’t want to lose the work that ffmpeg already did.
You can do this by pressing Ctrl+Z to pause the process, and then run fg
when you want to start it again.
reason 6: you accidentally ran Ctrl+Z
Many people replied that they didn’t use job control intentionally, but
that they sometimes accidentally ran Ctrl+Z, which stopped whatever program was
running, so they needed to learn how to use fg to bring it back to the
foreground.
The were also some mentions of accidentally running Ctrl+S too (which stops
your terminal and I think can be undone with Ctrl+Q). My terminal totally
ignores Ctrl+S so I guess I’m safe from that one though.
reason 7: already set up a bunch of environment variables
Some folks mentioned that they already set up a bunch of environment variables that they need to run various commands, so it’s easier to use job control to run multiple commands in the same terminal than to redo that work in another tab.
reason 8: it’s your only option
Probably the most obvious reason to use job control to manage multiple processes is “because you have to” – maybe you’re in single-user mode, or on a very restricted computer, or SSH’d into a machine that doesn’t have tmux or screen and you don’t want to create multiple SSH sessions.
reason 9: some people just like it better
Some people also said that they just don’t like using terminal tabs: for instance a few folks mentioned that they prefer to be able to see all of their terminals on the screen at the same time, so they’d rather have 4 terminals on the screen and then use job control if they need to run more than 4 programs.
I learned a few new tricks!
I think my two main takeaways from thos post is I’ll probably try out job control a little more for:
- killing processes that don’t respond to Ctrl+C
- running
tcpdumpin the background with whatever network command I’m running, so I can see both of their output in the same place
New zine: How Git Works!
Hello! I’ve been writing about git on here nonstop for months, and the git zine is FINALLY done! It came out on Friday!
You can get it for $12 here: https://wizardzines.com/zines/git, or get an 14-pack of all my zines here.
Here’s the cover:
the table of contents
Here’s the table of contents:
who is this zine for?
I wrote this zine for people who have been using git for years and are still afraid of it. As always – I think it sucks to be afraid of the tools that you use in your work every day! I want folks to feel confident using git.
My goals are:
- To explain how some parts of git that initially seem scary (like “detached HEAD state”) are pretty straightforward to deal with once you understand what’s going on
- To show some parts of git you probably should be careful around. For example, the stash is one of the places in git where it’s easiest to lose your work in a way that’s incredibly annoying to recover form, and I avoid using it heavily because of that.
- To clear up a few common misconceptions about how the core parts of git (like commits, branches, and merging) work
what’s the difference between this and Oh Shit, Git!
You might be wondering – Julia! You already have a zine about git! What’s going on? Oh Shit, Git! is a set of tricks for fixing git messes. “How Git Works” explains how Git actually works.
Also, Oh Shit, Git! is the amazing Katie Sylor Miller’s concept: we made it into a zine because I was such a huge fan of her work on it.
I think they go really well together.
what’s so confusing about git, anyway?
This zine was really hard for me to write because when I started writing it, I’d been using git pretty confidently for 10 years. I had no real memory of what it was like to struggle with git.
But thanks to a huge amount of help from Marie as well as everyone who talked to me about git on Mastodon, eventually I was able to see that there are a lot of things about git that are counterintuitive, misleading, or just plain confusing. These include:
- confusing terminology (for example “fast-forward”, “reference”, or “remote-tracking branch”)
- misleading messages (for example how
Your branch is up to date with 'origin/main'doesn’t necessary mean that your branch is up to date with themainbranch on the origin) - uninformative output (for example how I STILL can’t reliably figure out which code comes from which branch when I’m looking at a merge conflict)
- a lack of guidance around handling diverged branches (for example how when you run
git pulland your branch has diverged from the origin, it doesn’t give you great guidance how to handle the situation) - inconsistent behaviour (for example how git’s reflogs are almost always append-only, EXCEPT for the stash, where git will delete entries when you run
git stash drop)
The more I heard from people how about how confusing they find git, the more it became clear that git really does not make it easy to figure out what its internal logic is just by using it.
handling git’s weirdnesses becomes pretty routine
The previous section made git sound really bad, like “how can anyone possibly use this thing?”.
But my experience is that after I learned what git actually means by all of its
weird error messages, dealing with it became pretty routine! I’ll see an
error: failed to push some refs to 'github.com:jvns/wizard-zines-site',
realize “oh right, probably a coworker made some changes to main since I last
ran git pull”, run git pull --rebase to incorporate their changes, and move
on with my day. The whole thing takes about 10 seconds.
Or if I see a You are in 'detached HEAD' state warning, I’ll just make sure
to run git checkout mybranch before continuing to write code. No big deal.
For me (and for a lot of folks I talk to about git!), dealing with git’s weird language can become so normal that you totally forget why anybody would even find it weird.
a little bit of internals
One of my biggest questions when writing this zine was how much to focus on
what’s in the .git directory. We ended up deciding to include a couple of
pages about internals (“inside .git”, pages 14-15), but otherwise focus more on
git’s behaviour when you use it and why sometimes git behaves in unexpected
ways.
This is partly because there are lots of great guides to git’s internals out there already (1, 2), and partly because I think even if you have read one of these guides to git’s internals, it isn’t totally obvious how to connect that information to what you actually see in git’s user interface.
For example: it’s easy to find documentation about remotes in git – for example this page says:
Remote-tracking branches […] remind you where the branches in your remote repositories were the last time you connected to them.
But even if you’ve read that, you might not realize that the statement Your branch is up to date with 'origin/main'" in git status doesn’t necessarily
mean that you’re actually up to date with the remote main branch.
So in general in the zine we focus on the behaviour you see in Git’s UI, and then explain how that relates to what’s happening internally in Git.
the cheat sheet
The zine also comes with a free printable cheat sheet: (click to get a PDF version)
it comes with an HTML transcript!
The zine also comes with an HTML transcript, to (hopefully) make it easier to read on a screen reader! Our Operations Manager, Lee, transcribed all of the pages and wrote image descriptions. I’d love feedback about the experience of reading the zine on a screen reader if you try it.
I really do love git
I’ve been pretty critical about git in this post, but I only write zines about technologies I love, and git is no exception.
Some reasons I love git:
- it’s fast!
- it’s backwards compatible! I learned how to use it 10 years ago and everything I learned then is still true
- there’s tons of great free Git hosting available out there (GitHub! Gitlab! a million more!), so I can easily back up all my code
- simple workflows are REALLY simple (if I’m working on a project on my own, I
can just run
git commit -am 'whatever'andgit pushover and over again and it works perfectly) - Almost every internal file in git is a pretty simple text file (or has a version which is a text file), which makes me feel like I can always understand exactly what’s going on under the hood if I want to.
I hope this zine helps some of you love it too.
people who helped with this zine
I don’t make these zines by myself!
I worked with Marie Claire LeBlanc Flanagan every morning for 8 months to write clear explanations of git.
The cover is by Vladimir Kašiković, Gersande La Flèche did copy editing, James Coglan (of the great Building Git) did technical review, our Operations Manager Lee did the transcription as well as a million other things, my partner Kamal read the zine and told me which parts were off (as he always does), and I had a million great conversations with Marco Rogers about git.
And finally, I want to thank all the beta readers! There were 66 this time which is a record! They left hundreds of comments about what was confusing, what they learned, and which of my jokes were funny. It’s always hard to hear from beta readers that a page I thought made sense is actually extremely confusing, and fixing those problems before the final version makes the zine so much better.
get the zine
Here are some links to get the zine again:
- get How Git Works
- get an 14-pack of all my zines here.
As always, you can get either a PDF version to print at home or a print version shipped to your house. The only caveat is print orders will ship in July – I need to wait for orders to come in to get an idea of how many I should print before sending it to the printer.
thank you
As always: if you’ve bought zines in the past, thank you for all your support over the years. And thanks to all of you (1000+ people!!!) who have already bought the zine in the first 3 days. It’s already set a record for most zines sold in a single day and I’ve been really blown away.
Notes on git's error messages
While writing about Git, I’ve noticed that a lot of folks struggle with Git’s error messages. I’ve had many years to get used to these error messages so it took me a really long time to understand why folks were confused, but having thought about it much more, I’ve realized that:
- sometimes I actually am confused by the error messages, I’m just used to being confused
- I have a bunch of strategies for getting more information when the error message git gives me isn’t very informative
So in this post, I’m going to go through a bunch of Git’s error messages, list a few things that I think are confusing about them for each one, and talk about what I do when I’m confused by the message.
improving error messages isn’t easy
Before we start, I want to say that trying to think about why these error messages are confusing has given me a lot of respect for how difficult maintaining Git is. I’ve been thinking about Git for months, and for some of these messages I really have no idea how to improve them.
Some things that seem hard to me about improving error messages:
- if you come up with an idea for a new message, it’s hard to tell if it’s actually better!
- work like improving error messages often isn’t funded
- the error messages have to be translated (git’s error messages are translated into 19 languages!)
That said, if you find these messages confusing, hopefully some of these notes will help clarify them a bit.
error: git push on a diverged branch
$ git push To github.com:jvns/int-exposed ! [rejected] main -> main (non-fast-forward) error: failed to push some refs to 'github.com:jvns/int-exposed' hint: Updates were rejected because the tip of your current branch is behind hint: its remote counterpart. Integrate the remote changes (e.g. hint: 'git pull ...') before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details. $ git status On branch main Your branch and 'origin/main' have diverged, and have 2 and 1 different commits each, respectively.
Some things I find confusing about this:
- You get the exact same error message whether the branch is just behind
or the branch has diverged. There’s no way to tell which it is from this
message: you need to run
git statusorgit pullto find out. - It says
failed to push some refs, but it’s not totally clear which references it failed to push. I believe everything that failed to push is listed with! [rejected]on the previous line– in this case just themainbranch.
What I like to do if I’m confused:
- I’ll run
git statusto figure out what the state of my current branch is. - I think I almost never try to push more than one branch at a time, so I usually totally ignore git’s notes about which specific branch failed to push – I just assume that it’s my current branch
error: git pull on a diverged branch
$ git pull
hint: You have divergent branches and need to specify how to reconcile them.
hint: You can do so by running one of the following commands sometime before
hint: your next pull:
hint:
hint: git config pull.rebase false # merge
hint: git config pull.rebase true # rebase
hint: git config pull.ff only # fast-forward only
hint:
hint: You can replace "git config" with "git config --global" to set a default
hint: preference for all repositories. You can also pass --rebase, --no-rebase,
hint: or --ff-only on the command line to override the configured default per
hint: invocation.
fatal: Need to specify how to reconcile divergent branches.
The main thing I think is confusing here is that git is presenting you with a kind of overwhelming number of options: it’s saying that you can either:
- configure
pull.rebase false,pull.rebase true, orpull.ff onlylocally - or configure them globally
- or run
git pull --rebaseorgit pull --no-rebase
It’s very hard to imagine how a beginner to git could easily use this hint to sort through all these options on their own.
If I were explaining this to a friend, I’d say something like “you can use git pull --rebase
or git pull --no-rebase to resolve this with a rebase or merge
right now, and if you want to set a permanent preference, you can do that
with git config pull.rebase false or git config pull.rebase true.
git config pull.ff only feels a little redundant to me because that’s git’s
default behaviour anyway (though it wasn’t always).
What I like to do here:
- run
git statusto see the state of my current branch - maybe run
git log origin/mainorgit logto see what the diverged commits are - usually run
git pull --rebaseto resolve it - sometimes I’ll run
git push --forceorgit reset --hard origin/mainif I want to throw away my local work or remote work (for example because I accidentally commited to the wrong branch, or because I rangit commit --amendon a personal branch that only I’m using and want to force push)
error: git checkout asdf (a branch that doesn't exist)
$ git checkout asdf error: pathspec 'asdf' did not match any file(s) known to git
This is a little weird because we my intention was to check out a branch,
but git checkout is complaining about a path that doesn’t exist.
This is happening because git checkout’s first argument can be either a
branch or a path, and git has no way of knowing which one you intended. This
seems tricky to improve, but I might expect something like “No such branch,
commit, or path: asdf”.
What I like to do here:
- in theory it would be good to use
git switchinstead, but I keep usinggit checkoutanyway - generally I just remember that I need to decode this as “branch
asdfdoesn’t exist”
error: git switch asdf (a branch that doesn't exist)
$ git switch asdf fatal: invalid reference: asdf
git switch only accepts a branch as an argument (unless you pass -d), so why is it saying invalid reference: asdf instead of invalid branch: asdf?
I think the reason is that internally, git switch is trying to be helpful in its error messages: if you run git switch v0.1 to switch to a tag, it’ll say:
$ git switch v0.1
fatal: a branch is expected, got tag 'v0.1'`
So what git is trying to communicate with fatal: invalid reference: asdf is
“asdf isn’t a branch, but it’s not a tag either, or any other reference”. From my various git polls my impression is that
a lot of git users have literally no idea what a “reference” is in git, so I’m not sure if that’s coming across.
What I like to do here:
90% of the time when a git error message says reference I just mentally
replace it with branch in my head.
error: git checkout HEAD^
$ git checkout HEAD^ Note: switching to 'HEAD^'. You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by switching back to a branch. If you want to create a new branch to retain commits you create, you may do so (now or later) by using -c with the switch command. Example: git switch -cOr undo this operation with: git switch - Turn off this advice by setting config variable advice.detachedHead to false HEAD is now at 182cd3f add "swap byte order" button
This is a tough one. Definitely a lot of people are confused about this message, but obviously there's been a lot of effort to improve it too. I don't have anything smart to say about this one.
What I like to do here:
- my shell prompt tells me if I’m in detached HEAD state, and generally I can remember not to make new commits while in that state
- when I’m done looking at whatever old commits I wanted to look at, I’ll run
git checkout mainor something to go back to a branch
message: git status when a rebase is in progress
This isn’t an error message, but I still find it a little confusing on its own:
$ git status interactive rebase in progress; onto c694cf8 Last command done (1 command done): pick 0a9964d wip No commands remaining. You are currently rebasing branch 'main' on 'c694cf8'. (fix conflicts and then run "git rebase --continue") (use "git rebase --skip" to skip this patch) (use "git rebase --abort" to check out the original branch) Unmerged paths: (use "git restore --staged..." to unstage) (use "git add ..." to mark resolution) both modified: index.html no changes added to commit (use "git add" and/or "git commit -a")
Two things I think could be clearer here:
- I think it would be nice if
You are currently rebasing branch 'main' on 'c694cf8'.were on the first line instead of the 5th line – right now the first line doesn’t say which branch you’re rebasing. - In this case,
c694cf8is actuallyorigin/main, so I feel likeYou are currently rebasing branch 'main' on 'origin/main'might be even clearer.
What I like to do here:
My shell prompt includes the branch that I’m currently rebasing, so I rely on that instead of the output of git status.
error: git rebase when a file has been deleted
$ git rebase main CONFLICT (modify/delete): index.html deleted in 0ce151e (wip) and modified in HEAD. Version HEAD of index.html left in tree. error: could not apply 0ce151e... wip
The thing I still find confusing about this is – index.html was modified in
HEAD. But what is HEAD? Is it the commit I was working on when I started
the merge/rebase, or is it the commit from the other branch? (the answer is
“HEAD is your branch if you’re doing a merge, and it’s the “other branch” if
you’re doing a rebase, but I always find that hard to remember)
I think I would personally find it easier to understand if the message listed the branch names if possible, something like this:
CONFLICT (modify/delete): index.html deleted on `main` and modified on `mybranch`
error: git status during a merge or rebase (who is "them"?)
$ git status On branch master You have unmerged paths. (fix conflicts and run "git commit") (use "git merge --abort" to abort the merge)Unmerged paths: (use “git add/rm
…” as appropriate to mark resolution) deleted by them: the_file no changes added to commit (use “git add” and/or “git commit -a”)
I find this one confusing in exactly the same way as the previous message: it
says deleted by them:, but what “them” refers to depends on whether you did a merge or rebase or cherry-pick.
- for a merge,
themis the other branch you merged in - for a rebase,
themis the branch that you were on when you rangit rebase - for a cherry-pick, I guess it’s the commit you cherry-picked
What I like to do if I’m confused:
- try to remember what I did
- run
git show main --stator something to see what I did on themainbranch if I can’t remember
error: git clean
$ git clean fatal: clean.requireForce defaults to true and neither -i, -n, nor -f given; refusing to clean
I just find it a bit confusing that you need to look up what -i, -n and
-f are to be able to understand this error message. I’m personally way too
lazy to do that so even though I’ve probably been using git clean for 10
years I still had no idea what -i stood for (interactive) until I was
writing this down.
What I like to do if I’m confused:
Usually I just chaotically run git clean -f to delete all my untracked files
and hope for the best, though I might actually switch to git clean -i now
that I know what -i stands for. Seems a lot safer.
that’s all!
Hopefully some of this is helpful!
Making crochet cacti
I noticed some tech bloggers I follow have been making April Cools Day posts about topics they don’t normally write about (like decaf or microscopes). The goal isn’t to trick anyone, just to write about something different for a day.
I thought those posts were fun so here is a post with some notes on learning to crochet tiny cacti.
first, the cacti
I’ve been trying to do some non-computer hobbies, without putting a lot of pressure on myself to be “good” at them. Here are some cacti I crocheted:
They are a little wonky and I like them.
a couple of other critters
Here are a couple of other things I made: an elephant, an orange guy, a much earlier attempt at a cactus, and an in-progress cactus
Some of these are also pretty wonky, but sometimes it adds to the charm: for example the elephant’s head is attached at an angle which was not on purpose but I think adds to the effect. (orange guy pattern, elephant pattern)
I haven’t really been making clothing: I like working in a pretty chaotic way and I think you need to be a lot more careful when you make clothing so that it will actually fit.
the first project: a mouse
The first project I made was this little mouse. It took me a few hours (maybe 3 hours?) and I made a lot of mistakes and it definitely was not as cute as it was in the pictures in the pattern, but it was still good! I can’t find a picture right now though.
buying patterns is great
Originally I started out using free patterns, but I found some cacti patterns I really liked in an ebook called Knotmonsters: Cactus Gardens Edition, so I bought it.
I like the patterns in that book and also buying patterns seems like a nice way to support people who are making fun patterns. I found this guide to designing your own patterns through searching on Ravelry and it seems like a lot of work! Maybe I will do it one day but for now I appreciate the work of other people who make the patterns.
modifying patterns chaotically is great too
I’ve been modifying all of the patterns I make in a somewhat chaotic way, often just because I made a mistake somewhere along the way and then decide to move forward and change the pattern to adjust for the mistake instead of undoing my work. Some of of the changes I’ve made are:
- remove rows
- put fewer stitches in a row
- use a different stitch
This doesn’t always work but often it works well enough, and I think all of the mistakes help me learn.
no safety eyes
A lot of the patterns I’ve been seeing for animals suggest using “safety eyes” (plastic eyes). I didn’t really feel like buying those , so I’ve been embroidering eyes on instead. “Embroidering” might not be accurate, really I just sew some black yarn on in a haphazard way and hope it doesn’t come out looking too weird.
My crochet kit came with a big plastic yarn needle that I’ve been using to embroider and also
no stitch markers
My crochet kit came with some plastic “stitch markers” which you can use to figure out where the beginning of your row is, so you know when you’re done. I’ve been finding it easier to just use a short piece of scrap yarn instead.
on dealing with all the counting
In crochet there is a LOT of counting. Like “single crochet 3 times, then double crochet 1 time, then repeat that 6 times”. I find it hard to do that accurately without making mistakes, and all of the counting is not that fun! A few things that have helped:
- go back and look at my stitches to see what I did (“have I done 1 single crochet, or 2?”). I’m not actually very good at doing this, but I find it easier to see my stitches with wool/cotton yarn than with acrylic yarn for some reason.
- count how many stitches in total I’ve done since the last row, and make sure it seems approximately right (“well, I’m supposed to have 20 stitches and I have 19, that’s pretty close!”). Then I’ll maybe just add an extra stitch in the wrong place to adjust, or maybe just leave it the way it is.
notes on yarn
So far I’ve tried three kinds of yarn: merino (for the elephant), cotton (for the cacti), and acrylic (for the orange dude). I still don’t know which one I like best, but since I’m doing small projects it feels like the right move is still to just buy small amounts of yarn and experiment. I think I like the cotton and merino more than the acrylic.
For the cacti I used Ricorumi cotton yarn, which comes in tiny balls (which is good for me because if I don’t end up liking it, I don’t have a lot of extra!) and in a lot of different colours.
There are a lot of yarn weights (lace! sock! sport! DK! worsted! bulky! and more!). I don’t really underestand them yet but I think so far I’ve been mostly using DK and worsted yarn.
hook size? who knows!
I’ve mostly been using a 3.5mm hook, probably because I read a tutorial that said to use a 3.5mm hook. It seems to work fine! I used a larger hook size when making a hat, and that also worked.
I still don’t really know how to choose hook sizes but that doesn’t seem to have a lot of consequences when making cacti.
every stitch I’ve learned
I think I’ve probably only learned how to do 5 things in crochet so far:
- magic ring (mr)
- single crochet (sc)
- half double crochet (hdc)
- front post half double crochet (fphdc)
- double crochet (dc)
- back loops only/front loops only (flo/blo)
- increase/decrease
The way I’ve been approaching learning new crochet stitches is:
- find a pattern I want to make
- start it without reviewing it very much at all
- when I get to a stitch I don’t know, watch youtube videos
- don’t watch it very carefully and get it wrong
- eventually realize that it doesn’t look right at all, rewatch the video, and continue
I’ve been using Sarah Maker’s pages a lot, except for the magic ring where I used this 3-minute youtube video.
The magic ring took me a very long time to learn to do correctly, I didn’t pay attention very closely to the 3-minute youtube video so I did it wrong in maybe 4 projects before I figured out how to do it right.
every single thing I’ve bought
So far I’ve only needed:
- a crochet kit (which I got as a gift). it came with yarn, a bunch of crochet needles in different sizes, big sewing needles, and some other things I haven’t needed yet.
- some Ricorumi cotton (for the cacti)
- 1 ball of gray yarn (for the elephant)
I’ve been trying to not buy too much stuff, because I never know if I’ll get bored with a new hobby, and if I get bored it’s annoying to have a bunch of stuff lying around. Some examples of things I’ve avoided buying so far:
- Instead of buying polyester fiberfill, to fill all of the critters I’ve just been cutting up an old sweater I have that was falling apart.
- I’ve been embroidering the eyes instead of buying safety eyes
Everything I have right now fits in a the box the crochet kit came in (which is about the size of a large shoebox), and my plan is to keep it that way for a while.
that’s all!
Mainly what I like about crochet so far is that:
- it’s a way to not be on the computer, and you can chat with people while doing it
- you can do it without buying too much stuff, it’s pretty compact
- I end up with cacti in our living room which is great (I also have a bunch of real succulents, so they go with those)
- it seems extremely forgiving of mistakes and experimentation
There are definitely still a lot of things I’m doing “wrong” but it’s fun to learn through trial and error.
Some Git poll results
A new thing I’ve been trying while writing this Git zine is doing a bunch of polls on Mastodon to learn about:
- which git commands/workflows people use (like “do you use merge or rebase more?” or “do you put your current git branch in your shell prompt?”)
- what kinds of problems people run into with git (like “have you lost work because of a git problem in the last year or two?”)
- which terminology people find confusing (like “how confident do you feel that you know what HEAD means in git?”)
- how people think about various git concepts (“how do you think about git branches?”)
- in what ways my usage of git is “normal” and in what ways it’s “weird”. Where am I pretty similar to the majority of people, and where am I different?
It’s been a lot of fun and some of the results have been surprising to me, so here are some of the results. I’m partly just posting these so that I can have them all in one place for myself to refer to, but maybe some of you will find them interesting too.
these polls are highly unscientific
Polls on social media that I thought about for approximately 45 seconds before posting are not the most rigorous way of doing user research, so I’m pretty cautious about drawing conclusions from them. Potential problems include: I phrased the poll badly, the set of possible responses aren’t chosen very carefully, some of the poll responses I just picked because I thought they were funny, and the set of people who follow me on Mastodon is not representative of all git users.
But here are a couple of examples of why I still find these poll results useful:
- The first poll is “what’s your approach to merge commits and rebase in git”? 600 people (30% of responders) replied “I usually use merge, rarely/never rebase”. It’s helpful for me to know that there are a lot of people out there who rarely/never use rebase, because I use rebase all the time – it’s a good reminder that my experiences isn’t necessarily representative.
- For the poll “how confident do you feel that you know what HEAD means in
git?”, 14% of people replied “literally no idea”. That tells me to be careful
about assuming that people know what
HEADmeans in my writing.
where to read more
If you want to read more about any given poll, you can click at the date at the bottom – there’s usually a bunch of interesting follow-up discussion.
Also this post has a lot of CSS so it might not work well in a feed reader.
Now! Here are the polls! I’m mostly just going to post the results without commenting on them.
merge and rebase
poll: what's your approach to merge commits and rebase in git?
merge conflicts
poll: if you use git, how often do you deal with nontrivial merge conflicts? (like where 2 people were really editing the same code at the same time and you need to take time to think about how to reconcile the edits)
another merge conflict poll:
have you ever seen a bug in production caused by an incorrect merge conflict resolution? I've heard about this as a reason to prefer merges over rebase (because it makes the merge conflict resolution easier to audit) and I'm curious about how common it is
I thought it was interesting in the next one that “edit the weird text file by hand” was most people’s preference:
poll: when you have a merge conflict, how do you prefer to handle it?
merge conflict follow up: if you prefer to edit the weird text file by hand instead of using a dedicated merge conflict tool, why is that?
poll: did you know that in a git merge conflict, the order of the code is different when you do a merge/rebase?
merge:
<<<<<<< HEAD
YOUR CODE
=======
OTHER BRANCH'S CODE
>>>>>>> c694cf8aabe
rebase:
<<<<<<< HEAD
OTHER BRANCH'S CODE
=======
YOUR CODE
>>>>>>> d945752 (your commit message)
(where "YOUR CODE" is the code from the branch you were on when you ran `git merge` or `git rebase`)
git pull
poll: do you prefer `git fetch` or `git pull`?
(no lectures about why you think `git pull` is bad please but if you use both I'd be curious to hear in what cases you use fetch!)
commits
[poll] how do you think of a git commit?
(sorry, you can't pick “it’s all 3”, I'm curious about which one feels most true to you)
branches
poll: how do you think about git branches? (I'll put an image in a reply with pictures for the 3 options)
as with all of these polls obviously all 3 are valid, I'm curious which one feels the most true to you
git environment
poll: do you put your current git branch in your shell prompt?
poll: do you use git on the command line or in a GUI?
(you can pick more than one option if it’s a mix of both, sorry magit users I didn't have space for you in this poll)
losing work
poll: have you lost work because of a git problem in the last year or two? (it counts even if it was "your fault" :))
meaning of various git terms
These polls gave me the impression that for a lot of git terms (fast-forward, reference, HEAD), there are a lot of git users who have “literally no idea” what they mean. That makes me want to be careful about using and defining those terms.
poll: how confident do you feel that you know what HEAD means in git?
another poll: how do you think of HEAD in git?
poll: when you see this message in `git status`:
”Your branch is up to date with 'origin/main’.”
do you know that your branch may not actually be up to date with the `main` branch on the remote?
poll: how confident do you feel that you know what the term "fast-forward" means in git, for example in this error message:
`! [rejected] main -> main (non-fast-forward)`
or this one:
fatal: Not possible to fast-forward, aborting.
(I promise this is not a trick question, I'm just writing a blog post about git terminology and I'm trying to gauge how people feel about various core git terms)
poll: how confident do you feel that you know what a "ref" or "reference" is in git? (“ref” and “reference” are the same thing)
for example in this error message (from `git push`)
error: failed to push some refs to 'github.com:jvns/int-exposed'
or this one: (from `git switch mybranch`)
fatal: invalid reference: mybranch
another git terminology poll: how confident do you feel that you know what a git commit is?
(not a trick question, I'm mostly curious how this one relates to people's reported confidence about more "advanced" terms like reference/fast-forward/HEAD)
poll: in git, do you think of "detached HEAD state" and "not having any branch checked out" as being the same thing?
poll: how confident do you feel that you know what the term "current branch" means in git?
(deleted & reposted to clarify that I'm asking about the meaning of the term)
other version control systems
I occasionally hear “SVN was better than git!” but this “svn vs git” poll makes me think that’s a minority opinion. I’m much more cautious about concluding anything from the hg-vs-git poll but it does seem like some people prefer git and some people prefer Mercurial.
poll 2: if you've used both svn and git, which do you prefer?
(no replies please, i have already read 300 comments about git vs other version control systems today and they were great but i can't read more)
gonna do a short thread of git vs other version control systems polls just to get an overall vibe
poll 1: if you've used both hg and git, which do you prefer?
(no replies please though, i have already read 300 comments about git vs other version control systems today and i can't read more)
that’s all!
It’s been very fun to run all of these polls and I’ve learned a lot about how people use and think about git.