<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>Alex's Adventures on the Infobahn - magit</title><link href="https://www.bennee.com/~alex/" rel="alternate"></link><link href="https://www.bennee.com/~alex/blog/tag/magit/feed" rel="self"></link><id>https://www.bennee.com/~alex/</id><updated>2020-12-14T16:10:00+00:00</updated><subtitle>the wanderings of a supposed digital native</subtitle><entry><title>magit-file-dispatch</title><link href="https://www.bennee.com/~alex/blog/2020/12/14/magit-file-dispatch/" rel="alternate"></link><published>2020-12-14T16:10:00+00:00</published><updated>2020-12-14T16:10:00+00:00</updated><author><name>alex</name></author><id>tag:www.bennee.com,2020-12-14:/~alex/blog/2020/12/14/magit-file-dispatch/</id><summary type="html">&lt;p&gt;&lt;a href="https://magit.vc/manual/magit/Commands-for-Buffers-Visiting-Files.html" title="manual page for magit-file-dispatch"&gt;magit-file-dispatch&lt;/a&gt; is my new favourite command since the recent removal of &lt;a href="https://github.com/magit/magit/pull/4237" title="pull request describing change"&gt;magit-file-mode&lt;/a&gt;. Rather than paper over the change and stick to the old way I tried the &lt;a href="https://emacsredux.com/blog/2020/12/10/essential-magit-file-commands/" title="Bozhidar Batsov blog post discussing Magit launch strategies"&gt;suggestions of launching with the dispatch commands&lt;/a&gt;. I discovered a few cool things including the ability to trace an individual functions changes over …&lt;/p&gt;</summary><content type="html">&lt;p&gt;&lt;a href="https://magit.vc/manual/magit/Commands-for-Buffers-Visiting-Files.html" title="manual page for magit-file-dispatch"&gt;magit-file-dispatch&lt;/a&gt; is my new favourite command since the recent removal of &lt;a href="https://github.com/magit/magit/pull/4237" title="pull request describing change"&gt;magit-file-mode&lt;/a&gt;. Rather than paper over the change and stick to the old way I tried the &lt;a href="https://emacsredux.com/blog/2020/12/10/essential-magit-file-commands/" title="Bozhidar Batsov blog post discussing Magit launch strategies"&gt;suggestions of launching with the dispatch commands&lt;/a&gt;. I discovered a few cool things including the ability to trace an individual functions changes over time which has completely replaced my old method of piping &lt;em&gt;git log&lt;/em&gt; through &lt;em&gt;less&lt;/em&gt;. In the end I found the fall-back of going to &lt;em&gt;magit-dispatch&lt;/em&gt; a little too much friction given I've a lot of memory muscle to launch the status of git from various non-file backed yet still project orientated buffers. &lt;em&gt;compilation-mode&lt;/em&gt; is one example but I also have my mail client set-up so I can quickly get to the code from the relevant mailing list. As everyone can have their own special snowflake settings in Emacs I finally went with:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;with-eval-after-load&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="ss"&gt;&amp;#39;magit&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;defun&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;my-magit-file-bindings&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="s"&gt;&amp;quot;Setup my file bindings&amp;quot;&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;local-set-key&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;kbd&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;quot;&amp;lt;f5&amp;gt;&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="ss"&gt;&amp;#39;my-counsel-git-grep&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;add-hook&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="ss"&gt;&amp;#39;magit-find-file-hook&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="ss"&gt;&amp;#39;my-magit-file-bindings&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;

&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;defun&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;my-magit-dispatch&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kp"&gt;&amp;amp;optional&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;prefix&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="s"&gt;&amp;quot;My personal preference for magit-dispatch.&lt;/span&gt;
&lt;span class="s"&gt;While magit-file-dispatch is cool, falling back to magit-dispatch is&lt;/span&gt;
&lt;span class="s"&gt;not, I&amp;#39;d rather just go to magit-status. Lets make it so.&amp;quot;&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;interactive&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;quot;P&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;or&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;prefix&lt;/span&gt;
&lt;span class="w"&gt;          &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;not&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;buffer-file-name&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="w"&gt;          &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;not&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;functionp&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="ss"&gt;&amp;#39;magit-file-dispatch&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;span class="w"&gt;      &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;magit-status&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;magit-file-dispatch&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;

&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;use-package&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;magit&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="nb"&gt;:bind&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;C-x g&amp;quot;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;my-magit-dispatch&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</content><category term="geek"></category><category term="emacs"></category><category term="magit"></category></entry></feed>