<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<title>zunzuncito - git</title>
	<subtitle>Wolf&#x27;s humming microblog</subtitle>
	<link href="https://zunzuncito.oriole.systems/tags/git/atom.xml" rel="self" type="application/atom+xml"/>
	<link href="https://zunzuncito.oriole.systems"/>
	<generator uri="https://www.getzola.org/">Zola</generator>
	<updated>2024-10-14T20:33:27+02:00</updated>
	<id>https://zunzuncito.oriole.systems/tags/git/atom.xml</id>
	<entry xml:lang="en">
		<author><name>wolf</name></author>
		<title>A plethora of bug fixes</title>
		<published>2024-10-14T20:33:27+02:00</published>
		<updated>2024-10-14T20:33:27+02:00</updated>
		<link href="https://zunzuncito.oriole.systems/24/" type="text/html"/>
		<id>https://zunzuncito.oriole.systems/24/</id>
		<content type="html">&lt;p&gt;For whatever reason I’ve been uncovering software bugs at an unprecedented rate
in the past 10 days. This is by no means a bad thing, I enjoy hunting down and
fixing bugs, but it does mean that the additional overhead of drafting a post
about each bug becomes a bit too much. So instead here’s a quick overview - the
linked patches and merge requests will have more information, if you are
interested.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;trash-size-calculation-in-kio&quot;&gt;Trash size calculation in KIO&lt;&#x2F;h3&gt;
&lt;p&gt;I noticed this one pretty much right after starting to use
&lt;a href=&quot;https:&#x2F;&#x2F;apps.kde.org&#x2F;dolphin&#x2F;&quot;&gt;Dolphin&lt;&#x2F;a&gt; but did not end up looking into it
until quite a bit later: when displaying the size of the items in the trash, the
application would always show 0 bytes. This would also cause the automated
cleanup of items to fail - Dolphin simply believed that the trash was empty.&lt;&#x2F;p&gt;
&lt;p&gt;KDE uses the &lt;a href=&quot;https:&#x2F;&#x2F;invent.kde.org&#x2F;frameworks&#x2F;kio&quot;&gt;KIO&lt;&#x2F;a&gt; framework to provide
management of the trash. A &lt;a href=&quot;https:&#x2F;&#x2F;invent.kde.org&#x2F;frameworks&#x2F;kio&#x2F;-&#x2F;commit&#x2F;0ab81b6bac953b12b454bef4874946bb7fc8db85&quot;&gt;recent
commit&lt;&#x2F;a&gt;
had changed the construction of a
&lt;a href=&quot;https:&#x2F;&#x2F;doc.qt.io&#x2F;qt-6&#x2F;qdiriterator.html&quot;&gt;QDirIterator&lt;&#x2F;a&gt; in a way that would
make it ignore all items when iterating over the trash directory. Thankfully the
fix was straightforward and it was &lt;a href=&quot;https:&#x2F;&#x2F;invent.kde.org&#x2F;frameworks&#x2F;kio&#x2F;-&#x2F;merge_requests&#x2F;1729&quot;&gt;merged
quickly&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;git-shortlog-1-segfaults-outside-of-a-git-repository&quot;&gt;git-shortlog(1) segfaults outside of a git repository&lt;&#x2F;h3&gt;
&lt;p&gt;This one I uncovered as I was writing a small script to give me an overview of
commit authors in all the git repositories I had cloned locally. I was happily
scanning through my source directory using the
&lt;a href=&quot;https:&#x2F;&#x2F;git-scm.com&#x2F;docs&#x2F;git-shortlog#Documentation&#x2F;git-shortlog.txt---authorltpatterngt&quot;&gt;&lt;code&gt;--author&lt;&#x2F;code&gt;&lt;&#x2F;a&gt;
flag for &lt;code&gt;git-shortlog(1)&lt;&#x2F;code&gt; to generate this, fully expecting git to complain
about the few non-git directories I had. Instead of complaints, however, I got a
segfault.&lt;&#x2F;p&gt;
&lt;p&gt;Turns out that a &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;git&#x2F;git&#x2F;commit&#x2F;ab274909d4&quot;&gt;change back in
May&lt;&#x2F;a&gt; stopped setting SHA1 as the
default object hash. This was done to progress the slow-moving &lt;a href=&quot;https:&#x2F;&#x2F;git-scm.com&#x2F;docs&#x2F;hash-function-transition&quot;&gt;transition to
stronger hash functions&lt;&#x2F;a&gt; but
inadvertently broke &lt;code&gt;git-shortlog(1)&lt;&#x2F;code&gt; whose argument parsing machinery expected
a default hash algorithm to be set. I sent &lt;a href=&quot;https:&#x2F;&#x2F;public-inbox.org&#x2F;git&#x2F;20241011183445.229228-1-wolf@oriole.systems&#x2F;T&#x2F;#u&quot;&gt;a
patch&lt;&#x2F;a&gt;
upstream.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;an-infinite-loop-in-plasmashell&quot;&gt;An infinite loop in plasmashell&lt;&#x2F;h3&gt;
&lt;p&gt;I regularly use the
&lt;a href=&quot;https:&#x2F;&#x2F;docs.kde.org&#x2F;stable5&#x2F;en&#x2F;plasma-desktop&#x2F;plasma-desktop&#x2F;activities-interface.html&quot;&gt;Activities&lt;&#x2F;a&gt;
functionality in Plasma 6 and switch through my activities using Plasma’s
built-in activity manager. A couple of days ago I managed to make &lt;code&gt;plasmashell&lt;&#x2F;code&gt;,
the provider for Plasma’s desktop and task bar, freeze - I had hit the “up
arrow” key in the activity filter text box when there were no results visible.
This was perfectly reproducible, so I went to investigate.&lt;&#x2F;p&gt;
&lt;p&gt;The cause of the issue was a do-while construct not handling a specific sentinel
value, making it loop infinitely. For this one I also opened a &lt;a href=&quot;https:&#x2F;&#x2F;invent.kde.org&#x2F;plasma&#x2F;plasma-desktop&#x2F;-&#x2F;merge_requests&#x2F;2574&quot;&gt;merge
request&lt;&#x2F;a&gt;
upstream.&lt;&#x2F;p&gt;
</content>
	</entry>
	<entry xml:lang="en">
		<author><name>wolf</name></author>
		<title>Better hunk headers with gitattributes(5)</title>
		<published>2021-08-11T16:41:49+02:00</published>
		<updated>2021-08-11T16:41:49+02:00</updated>
		<link href="https://zunzuncito.oriole.systems/11/" type="text/html"/>
		<id>https://zunzuncito.oriole.systems/11/</id>
		<content type="html">&lt;p&gt;Yesterday whilst catching up on the Git mailing list I stumbled upon this
&lt;a href=&quot;https:&#x2F;&#x2F;public-inbox.org&#x2F;git&#x2F;20210810190937.305765-1-tsdh@gnu.org&#x2F;&quot;&gt;patch&lt;&#x2F;a&gt;
proposing to improve the hunk header regex for Java. I had never paid much
attention to how &lt;a href=&quot;https:&#x2F;&#x2F;git-scm.com&#x2F;docs&#x2F;git-diff&quot;&gt;&lt;code&gt;git-diff(1)&lt;&#x2F;code&gt;&lt;&#x2F;a&gt; finds the
right method signature to show in the headers though I was vaguely aware of a
bunch of regexes for different languages.&lt;&#x2F;p&gt;
&lt;p&gt;Turns out that by default, as explained in the manual for
&lt;a href=&quot;https:&#x2F;&#x2F;git-scm.com&#x2F;docs&#x2F;gitattributes#_defining_a_custom_hunk_header&quot;&gt;&lt;code&gt;gitattributes(5)&lt;&#x2F;code&gt;&lt;&#x2F;a&gt;,
&lt;code&gt;git-diff(1)&lt;&#x2F;code&gt; emulates the behaviour of GNU &lt;code&gt;diff -p&lt;&#x2F;code&gt; and does &lt;strong&gt;not&lt;&#x2F;strong&gt; consult
any of the language-specific regular expressions. This came as a bit of a
surprise to me, as Git usually has relatively sane and extensive defaults. Why
define all these regexes and then not use them by default?&lt;&#x2F;p&gt;
&lt;p&gt;Perhaps one reason is that it is hard to tell when to use which. Git can only
look at the filename, and not all shell scripts share the &lt;code&gt;.sh&lt;&#x2F;code&gt; ending, for
example. Surely it would not be too invasive, however, to define sensible
defaults for, say, files ending in &lt;code&gt;.py&lt;&#x2F;code&gt; or &lt;code&gt;.rs&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;In any case I updated my &lt;code&gt;~&#x2F;.config&#x2F;git&#x2F;attributes&lt;&#x2F;code&gt; with the following, and am
now enjoying better hunk headers across the board:&lt;&#x2F;p&gt;
&lt;pre&gt;&lt;code&gt;*.c	diff=cpp
*.cpp	diff=cpp
*.go	diff=go
*.md	diff=markdown
*.pl	diff=perl
*.py	diff=python
*.rs	diff=rust
*.sh	diff=bash
*.tex	diff=tex
&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The markdown setting is especially neat since it will now display the nearest
section right in the diff, like so:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;diff&quot; class=&quot;language-diff &quot;&gt;&lt;code class=&quot;language-diff&quot; data-lang=&quot;diff&quot;&gt;--- a&amp;#x2F;posts&amp;#x2F;weltschmerz.md
+++ b&amp;#x2F;posts&amp;#x2F;weltschmerz.md
@@ -24,6 +24,10 @@ ## Download
&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
</content>
	</entry>
	<entry xml:lang="en">
		<author><name>wolf</name></author>
		<title>git-am(1) and mail sorting</title>
		<published>2021-07-25T16:58:29+02:00</published>
		<updated>2021-07-25T16:58:29+02:00</updated>
		<link href="https://zunzuncito.oriole.systems/9/" type="text/html"/>
		<id>https://zunzuncito.oriole.systems/9/</id>
		<content type="html">&lt;p&gt;In the &lt;a class=&quot;internal&quot; href=&quot;&#x2F;8&quot;&gt;previous post&lt;&#x2F;a&gt;
 I talked about a couple of
different ways to apply patches with &lt;code&gt;mutt(1)&lt;&#x2F;code&gt; or &lt;code&gt;neomutt(1)&lt;&#x2F;code&gt;. Turns out
&lt;code&gt;Maildir&lt;&#x2F;code&gt; might not be the best format to use for &lt;code&gt;git-am(1)&lt;&#x2F;code&gt; because its
files are not guaranteed to be in any specific order (per
&lt;a href=&quot;https:&#x2F;&#x2F;cr.yp.to&#x2F;proto&#x2F;maildir.html&quot;&gt;spec&lt;&#x2F;a&gt; they need only carry unique names).&lt;&#x2F;p&gt;
&lt;p&gt;As &lt;code&gt;git-am(1)&lt;&#x2F;code&gt; does not sort its input, patches might be applied in the wrong
order. This came up on the mailing list as well, all the way
&lt;a href=&quot;https:&#x2F;&#x2F;public-inbox.org&#x2F;git&#x2F;20130301222018.GA839@WST420&#x2F;&quot;&gt;back in 2013&lt;&#x2F;a&gt;.
A fix specific to &lt;code&gt;Maildir&lt;&#x2F;code&gt; files created by &lt;code&gt;mutt(1)&lt;&#x2F;code&gt; was added in
&lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;git&#x2F;git&#x2F;commit&#x2F;18505c34237d3544729c3deed3e4f851fb672086&quot;&gt;&lt;code&gt;18505c3&lt;&#x2F;code&gt;&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Sadly &lt;code&gt;neomutt(1)&lt;&#x2F;code&gt; changed this format 5 years ago, removing the sequence number
that &lt;code&gt;git-am(1)&lt;&#x2F;code&gt; relies on in commit
&lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;neomutt&#x2F;neomutt&#x2F;commit&#x2F;75b3708edb18815935692c60bbae56d5301f8210#diff-8904141e55cf466b09a2db0df752f92a29daf093e79df61121ecd347b7631c19L1489-L1491&quot;&gt;&lt;code&gt;75b3708&lt;&#x2F;code&gt;&lt;&#x2F;a&gt;
and replacing it with a call to &lt;code&gt;mutt_rand64()&lt;&#x2F;code&gt;. I can only assume no one is
using &lt;code&gt;neomutt(1)&lt;&#x2F;code&gt; to export patches to &lt;code&gt;Maildir&lt;&#x2F;code&gt;, since having patches applied
in the wrong order is a pretty significant problem.&lt;&#x2F;p&gt;
&lt;p&gt;For now I recommend using the &lt;code&gt;mbox&lt;&#x2F;code&gt; format instead when exporting patches.
Whilst that doesn’t guarantee a specific order either, usually mail clients are
nice enough to export mails to &lt;code&gt;mbox&lt;&#x2F;code&gt; in the order they are shown.&lt;&#x2F;p&gt;
&lt;p&gt;The core issue remains until &lt;code&gt;git-am(1)&lt;&#x2F;code&gt; learns to sort mails itself.&lt;&#x2F;p&gt;
</content>
	</entry>
	<entry xml:lang="en">
		<author><name>wolf</name></author>
		<title>Applying patches with mutt(1)</title>
		<published>2021-07-23T22:37:17+02:00</published>
		<updated>2021-07-23T22:37:17+02:00</updated>
		<link href="https://zunzuncito.oriole.systems/8/" type="text/html"/>
		<id>https://zunzuncito.oriole.systems/8/</id>
		<content type="html">&lt;p&gt;When maintaining a project sooner or later there comes the time when you need to
apply patches that have been submitted to you. Assuming a patch-based workflow,
those are going to be one patch per mail, possibly connected in a thread.
There’s lots of different ways of getting those patches to their final
destination, &lt;a href=&quot;https:&#x2F;&#x2F;git-scm.com&#x2F;docs&#x2F;git-am&quot;&gt;&lt;code&gt;git-am(1)&lt;&#x2F;code&gt;&lt;&#x2F;a&gt;, and in this post I
want to take a look at ones that work well with &lt;a href=&quot;http:&#x2F;&#x2F;mutt.org&#x2F;&quot;&gt;&lt;code&gt;mutt(1)&lt;&#x2F;code&gt;&lt;&#x2F;a&gt; or
&lt;a href=&quot;https:&#x2F;&#x2F;neomutt.org&#x2F;&quot;&gt;&lt;code&gt;neomutt(1)&lt;&#x2F;code&gt;&lt;&#x2F;a&gt; since that is what I use.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;em&gt;I want to rely on the default bindings as much as possible. All mentioned
bindings should work out of the box.&lt;&#x2F;em&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Applying a single patch is very straightforward: Select the mail in the pager
and hit &lt;code&gt;|&lt;&#x2F;code&gt; to pipe it to an external command.  This command will be some
variation of &lt;code&gt;git-am(1)&lt;&#x2F;code&gt;, perhaps &lt;code&gt;git am -s&lt;&#x2F;code&gt; to also add a &lt;code&gt;Signed-off-by&lt;&#x2F;code&gt;
trailer.&lt;&#x2F;p&gt;
&lt;p&gt;What if you want to apply a patch series, however? An obvious solution would be
to pipe each message in the thread to &lt;code&gt;git-am(1)&lt;&#x2F;code&gt;. The &lt;code&gt;&amp;lt;pipe-message&amp;gt;&lt;&#x2F;code&gt; command
we invoked earlier with &lt;code&gt;|&lt;&#x2F;code&gt; only applies to the currently selected message, so
we can’t use that on the whole thread. Instead we can tag the whole thread using
&lt;code&gt;&amp;lt;Esc&amp;gt;t&lt;&#x2F;code&gt;, then use the &lt;code&gt;&amp;lt;tag-prefix&amp;gt;&lt;&#x2F;code&gt; command &lt;code&gt;;&lt;&#x2F;code&gt; followed by &lt;code&gt;|&lt;&#x2F;code&gt; to send all
tagged messages to &lt;code&gt;git-am(1)&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;There’s two problems with this, though. The first is that depending on the setting
of &lt;a href=&quot;https:&#x2F;&#x2F;neomutt.org&#x2F;guide&#x2F;reference#3-280-%C2%A0pipe_split&quot;&gt;&lt;code&gt;pipe_split&lt;&#x2F;code&gt;&lt;&#x2F;a&gt;,
&lt;code&gt;git-am(1)&lt;&#x2F;code&gt; might only apply the first patch in the series. This is the case if
&lt;code&gt;pipe_split&lt;&#x2F;code&gt; is set to the default of &lt;code&gt;no&lt;&#x2F;code&gt;; &lt;code&gt;mutt(1)&lt;&#x2F;code&gt; will then concatenate the
messages before sending them to the external command. Sadly this concatenated
format is slightly different from the &lt;code&gt;mbox&lt;&#x2F;code&gt; format that &lt;code&gt;git-am(1)&lt;&#x2F;code&gt; expects,
making it not see anything past the first patch.&lt;&#x2F;p&gt;
&lt;p&gt;With &lt;code&gt;pipe_split&lt;&#x2F;code&gt; set to &lt;code&gt;yes&lt;&#x2F;code&gt;, &lt;code&gt;mutt(1)&lt;&#x2F;code&gt; spawns one process per tagged mail
instead, applying all patches correctly. Now that &lt;code&gt;git-am(1)&lt;&#x2F;code&gt; is spawned once
per mail, however, you lose its atomicity: Neither &lt;code&gt;ORIG_HEAD&lt;&#x2F;code&gt; will be set
correctly, nor will &lt;code&gt;--abort&lt;&#x2F;code&gt; go back to the original branch.&lt;&#x2F;p&gt;
&lt;p&gt;This might not be a big issue, but I am not a fan. Thankfully &lt;code&gt;git-am(1)&lt;&#x2F;code&gt;
supports reading patches from &lt;code&gt;mbox&lt;&#x2F;code&gt; files or &lt;code&gt;Maildir&lt;&#x2F;code&gt; structures. So instead
of piping mails to &lt;code&gt;git-am(1)&lt;&#x2F;code&gt; via &lt;code&gt;&amp;lt;pipe-message&amp;gt;&lt;&#x2F;code&gt;, let’s save them to the
current directory: With the thread still tagged, &lt;code&gt;;C&lt;&#x2F;code&gt; (&lt;code&gt;&amp;lt;tag-prefix&amp;gt;&lt;&#x2F;code&gt; followed
by &lt;code&gt;&amp;lt;copy-message&amp;gt;&lt;&#x2F;code&gt;) will save a copy of it under a given path. Now you can
apply the series by hitting &lt;code&gt;!&lt;&#x2F;code&gt; and running &lt;code&gt;git am -s &amp;lt;path&amp;gt;&lt;&#x2F;code&gt;. This works with
&lt;a href=&quot;https:&#x2F;&#x2F;neomutt.org&#x2F;guide&#x2F;reference#3-188-%C2%A0mbox_type&quot;&gt;&lt;code&gt;mbox_type&lt;&#x2F;code&gt;&lt;&#x2F;a&gt; set to
either &lt;code&gt;mbox&lt;&#x2F;code&gt; or &lt;code&gt;Maildir&lt;&#x2F;code&gt; (but see &lt;a class=&quot;internal&quot; href=&quot;&#x2F;9&quot;&gt;№ 9&lt;&#x2F;a&gt;
).&lt;&#x2F;p&gt;
&lt;p&gt;Of course there is no need to rely on the default bindings, especially if you
need to do this kind of thing very often. &lt;code&gt;mutt(1)&lt;&#x2F;code&gt; is easily customizable,
making it possible to bind the entire chain of actions to just one keystroke.
If you’re interested in a more detailed examination of a patch-based workflow
with &lt;code&gt;mutt(1)&lt;&#x2F;code&gt;, check out this
&lt;a href=&quot;http:&#x2F;&#x2F;kroah.com&#x2F;log&#x2F;blog&#x2F;2019&#x2F;08&#x2F;14&#x2F;patch-workflow-with-mutt-2019&#x2F;&quot;&gt;post&lt;&#x2F;a&gt;
by Greg Kroah-Hartman.&lt;&#x2F;p&gt;
</content>
	</entry>
	<entry xml:lang="en">
		<author><name>wolf</name></author>
		<title>Use git-send-email(1) only to send</title>
		<published>2021-06-25T18:25:34+02:00</published>
		<updated>2021-06-25T18:25:34+02:00</updated>
		<link href="https://zunzuncito.oriole.systems/5/" type="text/html"/>
		<id>https://zunzuncito.oriole.systems/5/</id>
		<content type="html">&lt;p&gt;Even though &lt;a href=&quot;https:&#x2F;&#x2F;git-scm.com&#x2F;docs&#x2F;git-send-email&quot;&gt;&lt;code&gt;git-send-email(1)&lt;&#x2F;code&gt;&lt;&#x2F;a&gt; calls
&lt;a href=&quot;https:&#x2F;&#x2F;git-scm.com&#x2F;docs&#x2F;git-format-patch&quot;&gt;&lt;code&gt;git-format-patch(1)&lt;&#x2F;code&gt;&lt;&#x2F;a&gt; if you
provide a revision list, oftentimes when submitting a patch series you should
instead run &lt;code&gt;git-format-patch(1)&lt;&#x2F;code&gt; first, and later use &lt;code&gt;git-send-email(1)&lt;&#x2F;code&gt; only
to submit the files it generated. There’s a bunch of reasons for this.&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;send-email&lt;&#x2F;code&gt; is built chiefly for mail submission, not patch formatting.
There is no way to pass options meant for &lt;code&gt;format-patch&lt;&#x2F;code&gt;, meaning that
you miss out on really good features like
&lt;a href=&quot;https:&#x2F;&#x2F;git-scm.com&#x2F;docs&#x2F;git-format-patch#Documentation&#x2F;git-format-patch.txt---no-cover-letter&quot;&gt;&lt;code&gt;--cover-letter&lt;&#x2F;code&gt;&lt;&#x2F;a&gt;
or
&lt;a href=&quot;https:&#x2F;&#x2F;git-scm.com&#x2F;docs&#x2F;git-format-patch#Documentation&#x2F;git-format-patch.txt---interdiffltpreviousgt&quot;&gt;&lt;code&gt;--interdiff&lt;&#x2F;code&gt;&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;If you use
&lt;a href=&quot;https:&#x2F;&#x2F;git-scm.com&#x2F;docs&#x2F;git-send-email#Documentation&#x2F;git-send-email.txt---annotate&quot;&gt;&lt;code&gt;--annotate&lt;&#x2F;code&gt;&lt;&#x2F;a&gt;
or decide to edit the mail body, you will lose all changes if you quit before
sending. You can’t save your work and continue writing the mail later either.
Once you call &lt;code&gt;send-email&lt;&#x2F;code&gt;, you’re committed; It’s all or nothing.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&quot;https:&#x2F;&#x2F;git-scm.com&#x2F;docs&#x2F;git-send-email#Documentation&#x2F;git-send-email.txt---compose&quot;&gt;&lt;code&gt;--compose&lt;&#x2F;code&gt;&lt;&#x2F;a&gt;
gets you a worse version of &lt;code&gt;format-patch&lt;&#x2F;code&gt;’s &lt;code&gt;--cover-letter&lt;&#x2F;code&gt;. No diffstat is
included by default, and the same problems as in 2) apply.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;format-patch&lt;&#x2F;code&gt; outputs text files for you to browse and edit. This can be
done on your own time and with your own tools, without the &lt;code&gt;send-email&lt;&#x2F;code&gt; prompt
nagging and stressing you.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;Providing a convenient way of quickly sending out small patches makes sense, but
all in all I think the inclusion of formatting in &lt;code&gt;git-send-email(1)&lt;&#x2F;code&gt; is a
glaring misfeature. Hiding &lt;code&gt;git-format-patch(1)&lt;&#x2F;code&gt; away from the user makes
&lt;code&gt;git-send-email(1)&lt;&#x2F;code&gt; intransparent and, worse, really clunky to use for regular
patch workflows.&lt;&#x2F;p&gt;
&lt;p&gt;Sadly, &lt;a href=&quot;https:&#x2F;&#x2F;git-send-email.io&#x2F;&quot;&gt;git-send-email.io&lt;&#x2F;a&gt; still tells newcomers to
use &lt;strong&gt;only&lt;&#x2F;strong&gt; &lt;code&gt;get-send-email(1)&lt;&#x2F;code&gt;, without even mentioning &lt;code&gt;git-format-patch(1)&lt;&#x2F;code&gt;.
This &lt;a href=&quot;https:&#x2F;&#x2F;lists.sr.ht&#x2F;~sircmpwn&#x2F;sr.ht-dev&#x2F;%3C20200925224503.10032-1-evan.gates%40gmail.com%3E#%3CC5WTCDJYQZGF.22D6HCBBU9T82@homura%3E&quot;&gt;won’t change&lt;&#x2F;a&gt; any time soon, either.&lt;&#x2F;p&gt;
&lt;p&gt;That is a shame. Guiding people to a worse workflow will not increase the
standing of mail-based processes. For now I’d recommend linking newcomers &lt;a href=&quot;https:&#x2F;&#x2F;git-scm.com&#x2F;docs&#x2F;MyFirstContribution#howto-git-send-email&quot;&gt;this
section&lt;&#x2F;a&gt; of
Git’s own contribution tutorial instead.&lt;&#x2F;p&gt;
</content>
	</entry>
	<entry xml:lang="en">
		<author><name>wolf</name></author>
		<title>Patch workflows and git branch -d</title>
		<published>2021-06-13T20:22:51+02:00</published>
		<updated>2021-06-13T20:22:51+02:00</updated>
		<link href="https://zunzuncito.oriole.systems/3/" type="text/html"/>
		<id>https://zunzuncito.oriole.systems/3/</id>
		<content type="html">&lt;p&gt;The notion of a “merged” branch is highly dependent on the
&lt;a href=&quot;https:&#x2F;&#x2F;git-scm.com&#x2F;docs&#x2F;gitworkflows&quot;&gt;workflow&lt;&#x2F;a&gt; used for a project. I was
wanting to clean up some topic branches in my copy of git.git today, but &lt;code&gt;git branch -d&lt;&#x2F;code&gt; refused to delete them, pointing out that they were not yet merged.&lt;&#x2F;p&gt;
&lt;p&gt;I knew for a fact that they were, which made me look up how &lt;code&gt;git branch -d&lt;&#x2F;code&gt;
actually determines that. The manual is not entirely clear, but a
&lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;git&#x2F;git&#x2F;blob&#x2F;211eca0895794362184da2be2a2d812d070719d3&#x2F;builtin&#x2F;branch.c#L116-L121&quot;&gt;comment&lt;&#x2F;a&gt;
in the code pointed out that git constructs the merge base of the branch and its
upstream (or &lt;code&gt;HEAD&lt;&#x2F;code&gt; if there is none) and checks whether the branch is reachable
from that merge base.&lt;&#x2F;p&gt;
&lt;p&gt;In a patch workflow, this will generally not be true. A lot of things may
happen to your patches before inclusion, and with git.git they will get at least
one other sign-off. They’ll be recorded in a merge commit, but it will not have
your original branch as one of its parents.&lt;&#x2F;p&gt;
&lt;p&gt;Therefore, neither &lt;code&gt;git branch -d&lt;&#x2F;code&gt; nor &lt;code&gt;git branch --merged&lt;&#x2F;code&gt; will report your
branch as merged. Both of these tools are built for the merge workflow instead.&lt;&#x2F;p&gt;
&lt;p&gt;To see if your work was merged in patch-based workflows, use
&lt;a href=&quot;https:&#x2F;&#x2F;git-scm.com&#x2F;docs&#x2F;git-cherry&quot;&gt;&lt;code&gt;git-cherry(1)&lt;&#x2F;code&gt;&lt;&#x2F;a&gt;. Then you can safely
force deletion of the branch with &lt;code&gt;git branch -D&lt;&#x2F;code&gt;&lt;&#x2F;p&gt;
</content>
	</entry>
</feed>
