first-class merges and cover letters

Sep. 11th, 2025 02:38 am
fanf: (Default)
[personal profile] fanf

https://dotat.at/@/2025-09-11-cover-letter.html

Although it looks really good, I have not yet tried the Jujutsu (jj) version control system, mainly because it's not yet clearly superior to Magit. But I have been following jj discussions with great interest.

One of the things that jj has not yet tackled is how to do better than git refs / branches / tags. As I underestand it, jj currently has something like Mercurial bookmarks, which are more like raw git ref plumbing than a high-level porcelain feature. In particular, jj lacks signed or annotated tags, and it doesn't have branch names that always automatically refer to the tip.

This is clearly a temporary state of affairs because jj is still incomplete and under development and these gaps are going to be filled. But the discussions have led me to think about how git's branches are unsatisfactory, and what could be done to improve them.

branch

One of the huge improvements in git compared to Subversion was git's support for merges. Subversion proudly advertised its support for lightweight branches, but a branch is not very useful if you can't merge it: an un-mergeable branch is not a tool you can use to help with work-in-progress development.

The point of this anecdote is to illustrate that rather than trying to make branches better, we should try to make merges better and branches will get better as a consequence.

Let's consider a few common workflows and how git makes them all unsatisfactory in various ways. Skip to cover letters and previous branch below where I eventually get to the point.

merge

A basic merge workflow is,

  • create a feature branch
  • hack, hack, review, hack, approve
  • merge back to the trunk

The main problem is when it comes to the merge, there may be conflicts due to concurrent work on the trunk.

Git encourages you to resolve conflicts while creating the merge commit, which tends to bypass the normal review process. Git also gives you an ugly useless canned commit message for merges, that hides what you did to resolve the conflicts.

If the feature branch is a linear record of the work then it can be cluttered with commits to address comments from reviewers and to fix mistakes. Some people like an accurate record of the history, but others prefer the repository to contain clean logical changes that will make sense in years to come, keeping the clutter in the code review system.

rebase

A rebase-oriented workflow deals with the problems of the merge workflow but introduces new problems.

Primarily, rebasing is intended to produce a tidy logical commit history. And when a feature branch is rebased onto the trunk before it is merged, a simple fast-forward check makes it trivial to verify that the merge will be clean (whether it uses separate merge commit or directly fast-forwards the trunk).

However, it's hard to compare the state of the feature branch before and after the rebase. The current and previous tips of the branch (amongst other clutter) are recorded in the reflog of the person who did the rebase, but they can't share their reflog. A force-push erases the previous branch from the server.

Git forges sometimes make it possible to compare a branch before and after a rebase, but it's usually very inconvenient, which makes it hard to see if review comments have been addressed. And a reviewer can't fetch past versions of the branch from the server to review them locally.

You can mitigate these problems by adding commits in --autosquash format, and delay rebasing until just before merge. However that reintroduces the problem of merge conflicts: if the autosquash doesn't apply cleanly the branch should have another round of review to make sure the conflicts were resolved OK.

squash

When the trunk consists of a sequence of merge commits, the --first-parent log is very uninformative.

A common way to make the history of the trunk more informative, and deal with the problems of cluttered feature branches and poor rebase support, is to squash the feature branch into a single commit on the trunk instead of mergeing.

This encourages merge requests to be roughly the size of one commit, which is arguably a good thing. However, it can be uncomfortably confining for larger features, or cause extra busy-work co-ordinating changes across multiple merge requests.

And squashed feature branches have the same merge conflict problem as rebase --autosquash.

fork

Feature branches can't always be short-lived. In the past I have maintained local hacks that were used in production but were not (not yet?) suitable to submit upstream.

I have tried keeping a stack of these local patches on a git branch that gets rebased onto each upstream release. With this setup the problem of reviewing successive versions of a merge request becomes the bigger problem of keeping track of how the stack of patches evolved over longer periods of time.

cover letters

Cover letters are common in the email patch workflow that predates git, and they are supported by git format-patch. Github and other forges have a webby version of the cover letter: the message that starts off a pull request or merge request.

In git, cover letters are second-class citizens: they aren't stored in the repository. But many of the problems I outlined above have neat solutions if cover letters become first-class citizens, with a Jujutsu twist.

  • A first-class cover letter starts off as a prototype for a merge request, and becomes the eventual merge commit.

    Instead of unhelpful auto-generated merge commits, you get helpful and informative messages. No extra work is needed since we're already writing cover letters.

    Good merge commit messages make good --first-parent logs.

  • The cover letter subject line works as a branch name. No more need to invent filename-compatible branch names!

    Jujutsu doesn't make you name branches, giving them random names instead. It shows the subject line of the topmost commit as a reminder of what the branch is for. If there's an explicit cover letter the subject line will be a better summary of the branch as a whole.

    I often find the last commit on a branch is some post-feature cleanup, and that kind of commit has a subject line that is never a good summary of its feature branch.

  • As a prototype for the merge commit, the cover letter can contain the resolution of all the merge conflicts in a way that can be shared and reviewed.

    In Jujutsu, where conflicts are first class, the cover letter commit can contain unresolved conflicts: you don't have to clean them up when creating the merge, you can leave that job until later.

    If you can share a prototype of your merge commit, then it becomes possible for your collaborators to review any merge conflicts and how you resolved them.

To distinguish a cover letter from a merge commit object, a cover letter object has a "target" header which is a special kind of parent header. A cover letter also has a normal parent commit header that refers to earlier commits in the feature branch. The target is what will become the first parent of the eventual merge commit.

previous branch

The other ingredient is to add a "previous branch" header, another special kind of parent commit header. The previous branch header refers to an older version of the cover letter and, transitively, an older version of the whole feature branch.

Typically the previous branch header will match the last shared version of the branch, i.e. the commit hash of the server's copy of the feature branch.

The previous branch header isn't changed during normal work on the feature branch. As the branch is revised and rebased, the commit hash of the cover letter will change fairly frequently. These changes are recorded in git's reflog or jj's oplog, but not in the "previous branch" chain.

You can use the previous branch chain to examine diffs between versions of the feature branch as a whole. If commits have Gerrit-style or jj-style change-IDs then it's fairly easy to find and compare previous versions of an individual commit.

The previous branch header supports interdiff code review, or allows you to retain past iterations of a patch series.

workflow

Here are some sketchy notes on how these features might work in practice.

One way to use cover letters is jj-style, where it's convenient to edit commits that aren't at the tip of a branch, and easy to reshuffle commits so that a branch has a deliberate narrative.

  • When you create a new feature branch, it starts off as an empty cover letter with both target and parent pointing at the same commit.

  • Alternatively, you might start a branch ad hoc, and later cap it with a cover letter.

  • If this is a small change and rebase + fast-forward is allowed, you can edit the "cover letter" to contain the whole change.

  • Otherwise, you can hack on the branch any which way. Shuffle the commits that should be part of the merge request so that they occur before the cover letter, and edit the cover letter to summarize the preceding commits.

  • When you first push the branch, there's (still) no need to give it a name: the server can see that this is (probably) going to be a new merge request because the top commit has a target branch and its change-ID doesn't match an existing merge request.

  • Also when you push, your client automatically creates a new instance of your cover letter, adding a "previous branch" header to indicate that the old version was shared. The commits on the branch that were pushed are now immutable; rebases and edits affect the new version of the branch.

  • During review there will typically be multiple iterations of the branch to address feedback. The chain of previous branch headers allows reviewers to see how commits were changed to address feedback, interdiff style.

  • The branch can be merged when the target header matches the current trunk and there are no conflicts left to resolve.

When the time comes to merge the branch, there are several options:

  • For a merge workflow, the cover letter is used to make a new commit on the trunk, changing the target header into the first parent commit, and dropping the previous branch header.

  • Or, if you like to preserve more history, the previous branch chain can be retained.

  • Or you can drop the cover letter and fast foward the branch on to the trunk.

  • Or you can squash the branch on to the trunk, using the cover letter as the commit message.

questions

This is a fairly rough idea: I'm sure that some of the details won't work in practice without a lot of careful work on compatibility and deployability.

  • Do the new commit headers ("target" and "previous branch") need to be headers?

  • What are the compatibility issues with adding new headers that refer to other commits?

  • How would a server handle a push of an unnamed branch? How could someone else pull a copy of it?

  • How feasible is it to use cover letter subject lines instead of branch names?

  • The previous branch header is doing a similar job to a remote tracking branch. Is there an opportunity to simplify how we keep a local cache of the server state?

Despite all that, I think something along these lines could make branches / reviews / reworks / merges less awkward. How you merge should me a matter of your project's preferred style, without interference from technical limitations that force you to trade off one annoyance against another.

There remains a non-technical limitation: I have assumed that contributors are comfortable enough with version control to use a history-editing workflow effectively. I've lost all perspective on how hard this is for a newbie to learn; I expect (or hope?) jj makes it much easier than git rebase.

Music

Sep. 10th, 2025 06:17 pm
ysabetwordsmith: Cartoon of me in Wordsmith persona (Default)
[personal profile] ysabetwordsmith
This flash mob put on a complex performance of "Bohemian Rhapsody."

It reminds me very much of the "musical dimension" -- the world in which people naturally, spontaneously form into teams for song and dance routines. People here are just using prosthetic technology to substitute for whatever energy phenomenon allows that in Musical Land. :D
juan_gandhi: (Default)
[personal profile] juan_gandhi

В отношении людей, не считающих, что Украине нужна помощь, так как... ну и так далее.

В частости, этого невинно-убиенного Чарлза Кирка моя реакция такая: ну и хуй с ним, этого не жалко. 

Особенно когда начинают противопоставлять Украину и Израиль, тут я чуть ли не зверею, мысленно. FYI, я за Украину и я за Израиль. Но сколько кругом ненависти и к тем, и к другим, это ж ужас.

глобус не пропила

Sep. 10th, 2025 06:35 pm
juan_gandhi: (Default)
[personal profile] juan_gandhi
 В Германии (Сев.Рейн-Вестфалия) одна училка географии вышла на больничный в 2009-м году. И с тех пор получала свои законные 5 тыс в месяц. Все про неё забыли. Директор был вообще не в курсе. Инспекция обнаружила в прошлом году такое интересное явление, достойное книги Гиннеса.

Interesting app for Android [tech]

Sep. 10th, 2025 05:14 pm
siderea: (Default)
[personal profile] siderea
I don't know who needs to know about this, but:

I just discovered the Android app "Periodically". It's described as an "event logger". It's for keeping track of when a recurring thing has happened, and figuring out what the average time is between occurrences. You just keep it updated each time the event happens, and it will do the math for you to figure out the frequency, and even give you a notification when it predicts the event is likely to happen again. If you're tracking more than one thing, it will try to suss out correlations for you.

I mention because twenty five years ago or so, I needed exactly this functionality and could not find any application that would do what I needed, so I wrote a thing for myself, and since then a lot of people I've mentioned it to have wondered where they can get one like it. Mine was Mac/Palm Pilot, so not of much use to most people, especially these days.
Lo, somebody seems to have realized the need for this functionality, and brought it to the market. So I thought I'd mention.

Now, in this day and age, a lot of people, especially in the US, are concerned with security. Especially if they're tracking something to do with their health. This app is not specific to health, so nothing about it immediately reveals that it is storing health information on casual inspection; you could use some sort of other term for whatever health condition it is you are actually tracking. So, for instance, If you were tracking how often your migraines happened, you could call that "new box of cereal".

This app defaults to local-only data storage on your Android device, and the developer claims that it only collects "app activity" for analytics, and shares nothing with third parties. It outputs CSV and has an option to back up to Google Drive.

I haven't tried it myself, but it has a rating of 4.6 stars out of five on the Play Store.

Reviewers on the Play Store note that tracker apps that are specific to the kind of event – such as health- specific loggers – often have needless complexity, and often some weird ideas about graphic design. They praise this app for its clean, elegant look and simple, effective functionality.

In addition to its obvious applicability to episodic health conditions, it strikes me as potentially extremely useful in one of the trickier parts of prepping: figuring out one's burn rate of resources. I think I might trial it to help me figure out how often I should expect to have to buy a fresh bale of toilet paper and how long the big bottle of ibuprofen will last me.

Birdfeeding

Sep. 10th, 2025 02:30 pm
ysabetwordsmith: Cartoon of me in Wordsmith persona (Default)
[personal profile] ysabetwordsmith
Today is partly cloudy and hot.

I fed the birds.  Lots of sparrows and house finches today.

I put out water for the birds.

EDIT 9/10/25 -- I did a bit of work around the patio.

I've seen a male cardinal.

I picked several groundcherries.

EDIT 9/10/25 -- I did more work around the patio.

EDIT 9/10/25 -- I watered the new picnic table, telephone pole garden, and some of the savanna seedlings.

Cicadas and crickets are singing.

As it is now dark, I am done for the night.
 

vicarious travel

Sep. 10th, 2025 10:09 am
calimac: (Default)
[personal profile] calimac
The Not-Quite States of America, Doug Mack (Norton, 2017)

I've visited all 50 of the U.S. states. So, I would think, has Doug Mack. I don't think he says so specifically, but he prides himself on his knowledge of the states.

But I've never been to any non-state territory of the U.S. except the contiguous one, the District of Columbia. Neither had Doug Mack when the other five inhabited territories came to his attention when they showed up as appendices to the state quarters series.

So he decided to visit all of them. The two in the Caribbean - Puerto Rico and the U.S. Virgin Islands - are common tourist destinations, but for two in the Pacific - Guam and the Northern Mariana Islands - the tourists are mostly Japanese, and hardly anyone visits American Samoa except expatriates and government bureaucrats on business.

This book is Mack's account of going to all these places. (He also visits the Marshall Islands, which is an "associated state" - he explains what that means - near the Northern Marianas.)

He has a colorful touristy time, and gets into friendly conversations with the locals of a kind that introverted me would not be able to handle. It gives the reader a good idea of what it would be like to go to these places, which is good because I have no intention of doing so myself.

But Mack has more of an agenda than that. These places all have strange and uncomfortable histories as U.S. colonial possessions, and even today are poised awkwardly between being parts of the U.S. and being foreign, where U.S. laws and rights don't apply. He goes into some detail on the history of this and what it means, with lots of references to the Spanish-American War and the Insular Cases, but the most striking example of this comes when he tells you that if you fly to the Virgin Islands from the mainland U.S. there's no customs station, you can just walk off the plane and out to the street, but when you come back you have to show your passport. I hope that airlines inform customers of this when they buy tickets.

He also asks the inhabitants whether they consider themself U.S.-Americans or people of their own territory. The usual answer is, "Both!" The number of U.S.-based chains he finds in places like Guam impresses him, as does the time he goes to what he expects will be a genuine native restaurant in American Samoa and discovers that, like a lot of Samoans, the chef has lived in L.A. and has really taken to Tex-Mex cuisine. So he eats tacos in Samoa. It's both.

I <3 fandom

Sep. 10th, 2025 05:45 pm
cesy: "Cesy" - An old-fashioned quill and ink (Default)
[personal profile] cesy
I really appreciate when authors of longer fics occasionally put a note in the author's notes at the end of a chapter saying it's a good break point if you're binge-reading. Because yes, sometimes I do find it hard to stop, and it helps to have the author say that the next few chapters are intense and flow closely and you might prefer to pause before them rather than in the middle of them.
[personal profile] cosmolinguist

Post-restructure, my little team (which ofc got unconscionably smaller) is part of an even bigger team. Ever since, the big bosses have been saying we need an away day "to get to know each other so we can work together better."

Far be it from me to greet this with "skill issue, get gud." I know other kinds of brains from mine work better face-to-face, and I don't want to denigrate that. But... I just don't get this.

It might end up being a moot point anyway, because now they've realized how expensive it is to get us all to London for two days, the away day might not happen at all. So today we got sent this survey, asking us how to make it worthwhile.

I'm really stumped by one of the questions: "Overall, what would make the away day a success for you?"

I'm trying to be a good sport here, I'm also trying to introspect more about work for my own sake even if I don't tell anyone else what I think because it's good for me to know what I think and that hasn't felt easy to me lately.

And...as far as I can tell, success doesn't make sense to me as a characteristic of an away day.

My ceiling is "...it was only the expected amount of exhausting?"

I dug out this thing I wrote (almost exactly two years ago; is it something about this time of year? sheesh) about talkers and writers because I've been thinking about it ever since:

It starts with a vague anecdote about "a small group of leaders" gathering most of their people for two days of talking about "big changes to their organisation's mission."

The writer goes on, "These leaders were talkers. At the end of the second day of this, they were amped up and excited about the plans that had been hashed out." She contrasts these "talkers" with "writers":

The writers were on the whole befuddled and exhausted; they weren‘t sure what had been decided on, and when they tried to reflect on all that talking, it was a blur. They could feel the energy of the room was such that something exciting had happened but they didn‘t quite know what to think of it. They were uncertain if they had made themselves clear; they were uncertain of what they had wanted to make clear. They wondered if they were missing something, but they couldn‘t articulate what it was. They too sent thanks and thumbs up emojis, but they went home with a vague sense of dread.

That's me. I truly can't imagine it being anything else, without the whole organization getting the restructure it needs (rather than the one it got).

conuly: (Default)
[personal profile] conuly
And they now expect the part in tomorrow, at which point we should be able to make an appointment to repair.

As I reiterated - but briefly, because the person making the call was not responsible for this situation - a delay in shipping is one thing, but lack of communication is something very different.
[syndicated profile] smbc_comics_feed

Posted by Zach Weinersmith



Click here to go see the bonus panel!

Hovertext:
Anyone complaining about my delineations should decide they are not in fact a self and so no email need be sent to correct me.


Today's News:
james_davis_nicoll: (Default)
[personal profile] james_davis_nicoll


Otaku Hina is delighted that her Japanese neighbour Kyuta looks just like Hina's favourite anime character. Alas, Kyuta dislikes anime almost as much as vampires like Hina.

Otaku Vampire's Love Bite, volume 1 By Julietta Suzuki (Translated by Tomo Kimura)
[syndicated profile] whateverscalzi_feed

Posted by John Scalzi

Fun fact: John Darnielle, the leader and songwriter of The Mountain Goats, went to high school in the same town I did (different schools, though) and share friends in common with me from that era. However, we did not meet each other in person until about a decade ago, at Nerdcon, run by John and Hank Green. What a strange, small and weird world it is. I am glad to know him now, of course. The above song is from the band’s upcoming album, which you can read about here. Enjoy the song, and I’ll see you all tomorrow.

— JS

Murmur - 9

Sep. 10th, 2025 03:32 pm
michifugu: Stego's eye closed (Uma Musume - Stay Gold)
[personal profile] michifugu
Sorry for the long update, a lot has happened this month (both good and bad). Honestly, I didn’t know what to write at first because of the recent uprising in my country, and also because I’ve been fixated on a horsegirl game. But as usual in this murmur, I’ll just write down what’s been on my mind lately.
I usually don’t like talking about politics too much, but holy hell, the situation in my country has been getting worse this past week. There was a massive protest recently because people are fed up with our corrupt government, and things escalated when the cops ran over a deliveryman with a truck and killed him. I was really focused on that—it’s been mentally exhausting. You can read more about it on the wiki if you want. Honestly, I just hope our current president would fucking die.
On a lighter note, I watched the new KNY movie, and it was a really good film overall. Unfortunately, my experience was kind of ruined because someone brought their girlfriend, who had no prior knowledge of the series, and she kept TALKING through the entire movie, asking questions nonstop. Hhhhh.
Anyway, I feel like I’m in the mood to read a lot of yuri and BL lately. Especially Asada Nemui’s works, I’d like to revisit them and maybe write down my thoughts (I’ve been wanting to make a tier list of her works). I might also reread some yuri I’ve gone through before, since I remember people liked my review on Kamieshi. So I want to spread more good (and toxic) yuri too!
Also I've been adicted with Umamusu 4.5th anniv song lately (Menishuki)....it's really cute song...
tamaranth: me, in the sun (Default)
[personal profile] tamaranth
2025/141: The Nature of the Beast — Louise Penny
One person, not associated with the case, would be chosen to represent all Canadians. They would absorb the horror. They would hear and see things that could never be forgotten. And then, when the trial was over, they would carry it to their grave, so that the rest of the population didn’t have to. One person sacrificed for the greater good. “You more than read his file, didn’t you?” said Myrna. “There was a closed-door trial, wasn’t there?” Armand stared at her... [p. 34]

This was a real contrast to The Long Way Home: there's a murder in the first couple of chapters, and a plot that spans decades and continents. We learn more about some of the less storied inhabitants of Three Pines (Ruth and Monsieur Béliveau, the grocer, were activists in the 1970s: one of the villagers is a veteran of the Vietnam War) and a terrifying new -- or old -- threat is introduced.

Read more... )

Etsy Witches

Sep. 9th, 2025 11:14 pm
[syndicated profile] jwz_blog_feed

Posted by jwz

We Paid Some Etsy Witches to Curse Charlie Kirk:

If the far-right misogynist with a bad haircut wants to villainize independent women, Jezebel is more than happy to be the hag of his nightmares. [...]

Then I found the crown jewel: "Shit Your Pants Spell." Review: "It really worked. Thank you." At that point, it was clear I'd need to order multiple curses, at different severity levels and price points, to guarantee results.

Previously, previously, previously, previously, previously, previously, previously, previously, previously, previously, previously, previously, previously.

Cuddle Party

Sep. 10th, 2025 12:04 am
ysabetwordsmith: Cartoon of me in Wordsmith persona (Default)
[personal profile] ysabetwordsmith
Everyone needs contact comfort sometimes. Not everyone has ample opportunities for this in facetime. So here is a chance for a cuddle party in cyberspace. Virtual cuddling can help people feel better.

We have a
cuddle room that comes with fort cushions, fort frames, sheets for draping, and a weighted blanket. A nest full of colorful egg pillows sits in one corner. There is a basket of grooming brushes, hairbrushes, and styling combs. A bin holds textured pillows. There is a big basket of craft supplies along with art markers, coloring pages, and blank paper. The kitchen has a popcorn machine. Labels are available to mark dietary needs, recipe ingredients, and level of spiciness. Here is the bathroom, open to everyone. There is a lawn tent and an outdoor hot tub. Bathers should post a sign for nude or clothed activity. Come snuggle up!

September 2025

S M T W T F S
  12 3 4 5 6
7 8 9 10111213
14151617181920
21222324252627
282930    

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Sep. 11th, 2025 03:53 am
Powered by Dreamwidth Studios