Git: Cherry-pick a commit into a branch and resolve a merge conflict

Here’s the merge conflict message our merge master got when she tried to cherry pick my pull request (PR) to version 4.7 of the published OpenShift docs (lines , below).

openshift-cherrypick-robot commented 4 days ago • 
@theythemself: #29573 failed to apply on top of branch "enterprise-4.7":

Applying: [RHDEVDOCS-2614](https://issues.redhat.com/browse/RHDEVDOCS-2614) Define ClusterLogForwarder compatability Matrix
Using index info to reconstruct a base tree...
M	logging/cluster-logging-external.adoc
Falling back to patching base and 3-way merge...
Auto-merging logging/cluster-logging-external.adoc
CONFLICT (content): Merge conflict in logging/cluster-logging-external.adoc
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 [RHDEVDOCS-2614](https://issues.redhat.com/browse/RHDEVDOCS-2614) Define ClusterLogForwarder compatability Matrix
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

Here, I start by deleting the enterprise-4.7 branch (line ) because it had a previous unmerged commit sitting at the top of the pile. (In the future, I think I’ll avoid this by creating a working branch off of the enterprise-4.7 branch.)

[memyself@memyself openshift-docs]$ git checkout master
Switched to branch 'master'
Your branch is up to date with 'upstream/master'.

[memyself@memyself openshift-docs]$ git branch -D enterprise-4.7
Deleted branch enterprise-4.7 (was 803d05ddd).

Next, I create a new enterprise-4.7 branch that tracks Red Hat’s upstream repo (line). I don’t track my forked copy of the repo, origin, because it has that previous unmerged commit sitting at the top of the pile. (Again, there are other better ways to deal with that problem, I’m just sharing the one I used here.)

[memyself@memyself openshift-docs]$ git checkout --track upstream/enterprise-4.7
Branch 'enterprise-4.7' set up to track remote branch 'enterprise-4.7' from 'upstream'.
Switched to a new branch 'enterprise-4.7'

I fetch the latest changes from upstream and use status to verify that my branch is up to date.

[memyself@memyself openshift-docs]$ git fetch upstream
remote: Enumerating objects: 6, done.
remote: Counting objects: 100% (6/6), done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 6 (delta 4), reused 5 (delta 4), pack-reused 0
Unpacking objects: 100% (6/6), 1.22 KiB | 1.22 MiB/s, done.
From github.com:openshift/openshift-docs
   335951a8d..0f6dbceae  enterprise-4.5 -> upstream/enterprise-4.5

[memyself@memyself openshift-docs]$ git status
On branch enterprise-4.7
Your branch is up to date with 'upstream/enterprise-4.7'.

nothing to commit, working tree clean

I go to the pull request with the failed cherry pick and copy the hash of the commit. I always squash commits so each pull request has only one commit.

I cherry pick that commit into the 4.7 branch. The merge conflict on line 5 is expected.

[memyself@memyself openshift-docs]$ git cherry-pick 3cad05d66d11c2d38a08322222f6c9dcbfc839ab
Auto-merging modules/olm-mirroring-package-manifest-catalog.adoc
Auto-merging modules/cluster-logging-deploy-console.adoc
Auto-merging modules/cluster-logging-deploy-cli.adoc
CONFLICT (content): Merge conflict in modules/cluster-logging-deploy-cli.adoc
error: could not apply 3cad05d66... RHDEVDOCS-2589 OpenShift Logging: Update any installation/upgrade specific information to use our new channels.
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'

I check the status.

[memyself@memyself openshift-docs]$ git status
On branch enterprise-4.7
Your branch is up to date with 'upstream/enterprise-4.7'.

You are currently cherry-picking commit 3cad05d66.
  (all conflicts fixed: run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   logging/cluster-logging-exported-fields.adoc
	modified:   logging/cluster-logging-upgrading.adoc
	modified:   modules/cluster-logging-configuring-image-about.adoc
	modified:   modules/cluster-logging-deploy-cli.adoc
	modified:   modules/cluster-logging-deploy-console.adoc
	modified:   modules/cluster-logging-eventrouter-deploy.adoc
	modified:   modules/cluster-logging-log-store-status-comp.adoc
	modified:   modules/cluster-logging-updating-logging.adoc
	modified:   modules/cluster-logging-visualizer-kibana.adoc
	modified:   modules/olm-mirroring-package-manifest-catalog.adoc

In Atom editor (not shown here), I inspect the file that contains the conflict, modules/cluster-logging-deploy-cli.adoc. In it, I select the set of changes I want to keep. Then, I stage and commit the changes.

Back on the command line, I complete the cherry pick process.

[memyself@memyself openshift-docs]$ git cherry-pick --continue

I -f force push the changes to 4.7 to origin, which is my fork of the repo.

[memyself@memyself openshift-docs]$ git push -f origin enterprise-4.7
Enumerating objects: 27, done.
Counting objects: 100% (27/27), done.
Delta compression using up to 8 threads
Compressing objects: 100% (14/14), done.
Writing objects: 100% (14/14), 1.62 KiB | 1.62 MiB/s, done.
Total 14 (delta 13), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (13/13), completed with 13 local objects.
To github.com:rolfedh/openshift-docs.git
 + 803d05ddd...bcc5f087b enterprise-4.7 -> enterprise-4.7 (forced update)

Finally, on GitHub, in rolfedh/openshift-docs, I create the pull request to merge the commit into openshift:enterprise-4.5 from rolfedh:enterprise-4.5.

I’ll need to repeat this process and come up with a more complete set of screenshots.

Here’s a TLDR version of this blog post: Job aid: Git cherry-pick a commit and manually resolve a conflict
I use this short version to copy/paste commands into my terminal.

WordPress bug with highlighting lines in a code block

I discovered a bug. When you use the highlight lines property for code blocks as shown here…

Here, on the right, you see the “Highlight lines” property.

…the highlighting for the higher line numbers gets confused, as shown with lines 27, 39, 60 in the following screenshot.

Here, you see the highlighting on lines 27, 39, and 60 is wrong.

I’ve reached out to WordPress support and will let you know how it goes. I’ll try to file a bug for this.

[UPDATE] A WordPress happiness engineer created the following issue, which does an excellent job of analyzing and describing the problem: https://github.com/Automattic/wp-calypso/issues/50577

That might not be the right question | Seth’s Blog

“Where do you get your ideas?” The thing is, everyone has ideas. All the time, every day. Having ideas is part of the human condition. The right questions might be: Are you exposing yourself to new inputs and new situations, and challenging yourself to find more interesting ideas? Are you pushing the ideas you have further, making them more complete, turning them from hunches to notions to ideas to theories? Are you publishing your theories, sharing your reasoning and having your ideas collide with the real world in service of making things better?

That might not be the right question | Seth’s Blog

Let Gmail to sort your email

Gmail does a pretty good job of categorizing your messages. You can train it to do better.

animation of user moving email to correct tab in gmail
Drag the conversation to the correct tab and click Yes. Google confirms that it will do this for you in the future.

Primary tab

Move messages that you must review, respond to, or take action upon to the Primary tab.

Social tab

  • Move social network notifications to the Social tab.
  • These messages duplicate information in your social networks.
  • You should be able to select and delete everything in this tab without missing it.
  • For example, notifications from Facebook, Instagram, YouTube, TikTok, WordPress, etc.

Promotions tab

  • Move business offers and informational newsletters to the Promotions tab.
  • These messages promote products, services, people, and ideas you like but can safely ignore.
  • You should be able to select and delete everything in this tab without missing it.
  • For example, messages from Medium, Substack, Seth Godin, Walgreens, and Pocket.

Updates tab

  • Move important messages that you should see but usually do not need to act upon to the Updates tab.
  • These include automated automated paystub/billing/account/renewal notifications.

Forums tab

  • Move messages from message boards and mailing lists to the Forums tab.
  • You should be able to individually review and delete most of these messages.

Routinely unsubscribe from notifications and newsletters you don’t read. Some senders let you cut the frequency from daily to weekly or monthly.

Just as wild animals follow patterns that allow them to find adequate nutrition with the minimum expenditure of calories, information seekers follow patterns that allow them to find adequate information with the minimum expenditure of mental energy.

Mark baker, Every Page is Page One

How to learned to love my email inbox

Stop using your email as a holding pen for I should do’s and somedays.

Me, thinking to myself 🙂

My email inbox was a bottomless pile of messages seen and considered but not resolved. Having so many small choices increased my stress and reduced my ability to get things done.

Then, about a month or so ago, I heard “inbox zero” mentioned. I intuitively grasped the concept and set about finding a better way to process my email that reduces my effort, stress, and mess. It’s most obvious feature is that you have zero emails in you inbox.

Now (Feb 20th) I’ve been doing this for over a month and have gotten faster and better at it. Here’s my updated system, which I call zero inbox.

Before you practice zero inbox, train Gmail to sort your messages.

  • Scan and delete the messages that don’t matter.
    • In Gmail, this includes everything in your Social and Promotions tabs.
  • Scan and read the messages that matter. Do the following and then archive these.
    • Respond briefly, if needed
    • Forward messages that require attention or action from others. Include a note saying what you want them to notice or do.
    • If writing this note takes more than a few minutes, schedule a 10-minute videoconference or call with them.
    • Make to-do tasks from messages require further action. (Don’t let yourself start working on this things now.)

When you’re done every message should be deleted or archive. Your inbox should be empty.

It helps to know what your focus/responsibilities/goals/interests are. Don’t waste time on messages that fall outside of these. Don’t get sucked into email threads that don’t concern you or your work.

Conquering my to-do list

Recently, I explained how I implemented zero inbox and started capturing tasks in todoist. By pushing all of my tasks to one place, I cut down on the burden context-switching.

However, this new approach has created a new problem: a ballooning to-do list. Now, I must find a better way manage these tasks.

Fortunately, this article in the Harvard Business Review reminded me of the classic Eisenhower/Covey matrix for prioritizing tasks.

More urgentLess Urgent
More importantDo it nowSchedule it soon
Less importantDivide & conquer, or delegateDelete it, say “No,” or toss
it in the “someday” folder
My adaptation of the task prioritization matrix from Eisenhower, Covey, and the HBR article.

I’ll let you know how it goes.

How I create my to-do list in todoist

Recently, I wrote about zero inbox, my hack for getting rid of email stress and mess. I also mentioned that it depends on having a to-do list that can link back to your email messages.

A few years ago, I started using the free version of Todoist, an elegant and dependable app developed by a Germany-based software company. I was so pleased that I upgraded a year or so ago to their Premium version for $3/mo, billed annually.

Getting the most out of my to-do list requires a little skill and effort. Here’s how I add tasks to todoist:

  • Using the todoist extension in Chrome, I create an item for (almost) every task I encounter. The extension makes it easy to link to an email message or browser tab that’s open.
  • I avoid creating duplicate to-do items for tech docs deliverables I’m already tracking in an enterprise tool, like Jira or Bugzilla. Duplicates double or triple the amount of maintenance work I have to do.
  • For tasks I’m already tracking in enterprise tools, I create an umbrella task like “Work on the top priority item in Jira.”
    • Because this work is my highest priority, I type “p1” as a keyword in the item’s description: Todoist highlights the task with a red checkbox and moves it to the top of my to-do list.
    • I also mention the “every weekday” keyword, so Todoist makes this item a recurring task.
    • Finally, I click “Add website as task” so Todoist includes a link to Jira in the to-do item. This helps me reduce the number of open tabs in my browser, so I’m more productive.

zero inbox

Recently, I started practicing zero inbox. I didn’t read any specific how-to articles or books, I just implemented it based on these two principles:

  • DON’T USE YOUR EMAIL AS A TO DO LIST.
  • MESSAGES: DELETE, ARCHIVE, OR DEAL WITH THEM.

A quick search for “zero inbox” turned up this article and a 2007 Google TechTalks video on YouTube featuring Merlin Mann:

Inbox Zero – Merlin Mann – 2007

Merlin’s approach is a more nuanced (and probably more efficient) than mine. My approach is simpler:

  • I CHECK EMAIL between tasks and scheduled work periods.
  • I DELETE messages that have no informational value.
  • I ARCHIVE messages that seem to have some informational value. If the topic comes up in the future, I can search for it.
  • I DEAL WITH IT by replying to the message, adding a task to my to do list, and archiving the message. The to do task is linked to the archived email message.

This system works for me. It reduces my stress, mess, and effort.

Make it SIMPLE

Il semble que la perfection soit atteinte non quand il n’y a plus rien à ajouter, mais quand il n’y a plus rien à retrancher.

…perfection is finally attained not when there is no longer anything to add, but when there is no longer anything to take away…

ANTOINE DE SAINT EXUPERY, Terre des Hommes, 1939

As technical communicators, how do we ensure that our user instantly gets what the topic is about?

Here are the answers to that question, based on my reading of “Simple,” the central chapter of Chip and Dan Heath’s book, Made to Stick.

The good

Making something simple does not mean dumbing it down.

To make our content simple, we must:

  • Find the core idea and present it first.
  • Use the remaining content to support the core idea.
  • Eliminate everything else.

To illustrate this, Made to Stick describes a problem the US Army had a with orders: By the time commanders in the field received the order, it was outdated and the commanders had to choose between ignoring the order or implementing an order that no longer made sense.

To solve this problem, the US Army improved its communication protocols in 1980 by adding a commander’s intent (CI) to each order. The CI is “a crisp plain-talk statement, [to] the top of every order, specifying the plan’s goal, the desired end-state of an operation.” As a result, field commanders could act on the intention of the order, its core idea, despite changing circumstances in the field.

The CI sounds a lot like the DITA shortdesc element writers put at the beginning of their topic, just below the heading.

  • For a procedural topic, use the shortdesc to “explain what the task information helps users accomplish, the benefits of the task, or the purpose of the task.”
  • For a conceptual topic, use the shortdesc to, “introduce the concept and provide a concise answer to the question ‘What is this?’ and in some cases ‘Why do I care about this?’ If the concept is unfamiliar, you can start with a brief definition.”

I know some of you feel ill when you hear DITA mentioned in tech writing discussions. Even if you’re not using DITA, you can’t deny that it makes sense to give your readers a clear statement of the core idea at the beginning of your topic.

Doing this helps your reader to quickly “sniff” whether this is the information they are seeking so they can decide to read more or continue looking.

The bad

The opposite of identify the core idea and putting it at the top is:

  • Burying it somewhere else in the content.
  • Presenting multiple competing ideas.
  • Including tangential or irrelevant information.

We don’t do these things on purpose. They happen because we are either blind to them or lack the time and energy to revise them out of existence.

The ugly; revising to good

For me, words are like stepping stones that mark a path through a garden of information. When I revise a topic I’m working on, I reread the words and retrace the path I laid out earlier.

As I do this, I notice odd spots:

  • If I notice a misplaced stone, I move it to a better better spot or toss it out.
  • When I find a gap, I fill it with a stone from somewhere else or I generate a new stone by generating the idea that belongs there.

Usually, these changes create new odd spots in the path. So, with each move or fill, I spend a bit of time working it into place and reworking the surrounding material. I keep doing this, developing my thoughts and moving them around until I feel like I’m done.

Then I come back the next day and see a whole new set of things that are out of place. This is more of a problem with blog posts like this one than with technical content, whose structure is more defined.

The trouble with “eliminating everything else” is that I’m still generating new ideas (stones) when I’m revising. To solve this, I have to force myself to stop creating and focus only on removal. This isn’t easy if I’m attached to interesting by irrelevant ideas in the content. The solution is to save off a copy of the document before I start cutting away the excess. That way, when I finish the current topic, I can review the copy and use the interesting bits to generate new topics.