<?xml version="1.0" encoding="utf-8" ?>

<?xml-stylesheet type="text/xsl" href="/templates/2k11/rss.xsl" media="screen" ?>
<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    
    <title>Daniel Lange's blog (Entries tagged as git)</title>
    <link>http://daniel-lange.com/</link>
    <description>agrep -pB IT /dev/life</description>
    <dc:language>en</dc:language>
    <generator>Serendipity 2.6.0 - http://www.s9y.org/</generator>
    <pubDate>Fri, 28 Jan 2022 12:01:41 GMT</pubDate>

    <image>
    <url>//daniel-lange.com/uploads/Avatar_Blog_144_234.png</url>
    <title>RSS: Daniel Lange's blog - agrep -pB IT /dev/life</title>
    <link>http://daniel-lange.com/</link>
    <width>144</width>
    <height>234</height>
</image>

<item>
    <title>Git shared hosting quirk</title>
    <link>http://daniel-lange.com/archives/165-Git-shared-hosting-quirk.html</link>
            <category>IT</category>
    
    <comments>http://daniel-lange.com/archives/165-Git-shared-hosting-quirk.html#comments</comments>
    <wfw:comment>http://daniel-lange.com/wfwcomment.php?cid=165</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://daniel-lange.com/rss.php?version=2.0&amp;type=comments&amp;cid=165</wfw:commentRss>
    

    <author>nospam@example.com (Daniel Lange)</author>
    <content:encoded>
    &lt;p&gt;Show &lt;a href=&quot;https://github.com/torvalds/linux/blob/b4061a10fc29010a610ff2b5b20160d7335e69bf/drivers/hid/hid-samsung.c#L113-L118&quot;&gt;https://github.com/torvalds/linux/blob/b4061a10fc29010a610ff2b5b20160d7335e69bf/drivers/hid/hid-samsung.c#L113-L118&lt;/a&gt; to a friend.&lt;/p&gt;

&lt;p&gt;Oops &#039;eh? Yep, Linux has been backdoored.&lt;/p&gt;

&lt;p&gt;Well, or not.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://mricon.com/&quot;&gt;Konstantin Ryabitsev&lt;/a&gt; explains it nicely in a &lt;a href=&quot;https://lists.zx2c4.com/pipermail/cgit/2020-October/004571.html&quot;&gt;cgit mailing list email&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
It is common for git hosting environments to configure all forks of the
same repo to use an &quot;object storage&quot; repository. For example, this is
what allows git.kernel.org&#039;s 600+ forks of linux.git to take up only
10GB on disk as opposed to 800GB.

One of the side-effects of this setup is that any object in the shared
repository can be accessed from any of the forks, which periodically
confuses people into believing that something terrible has happened.
&lt;/blockquote&gt;

&lt;p&gt;The hack was &lt;a href=&quot;https://github.com/torvalds/linux/commit/b4061a10fc29010a610ff2b5b20160d7335e69bf#diff-b2b8b8422630002a41cf5901247f9a6af2cc8d000fc792ef7aae9ea1f393f8b4&quot;&gt;discussed on Github in Dec 2018&lt;/a&gt; 
when it was discovered. I forgot about it again but Konstantin&#039;s mail brought the memory back and I think it deserves more attention.&lt;/p&gt;

&lt;p&gt;I&#039;m sure putting some illegal content into a fork and sending a made up &quot;blob&quot; URL to law enforcement would go quite far.
Good luck explaining the issue. &lt;i&gt;&quot;Yes this is my repo&quot;&lt;/i&gt; but &lt;i&gt;&quot;no, no that&#039;s not my data&quot;&lt;/i&gt; ... &lt;i&gt;&quot;yes, it &lt;u&gt;is&lt;/u&gt; my repo but not my data&quot;&lt;/i&gt; ... &lt;i&gt;&quot;no we don&#039;t want that data either, really&quot;&lt;/i&gt; ... &lt;i&gt;&quot;but, but there is nothing we can do, we host on github...&lt;sup id=&quot;fnref:1&quot;&gt;&lt;a href=&quot;#fn:1&quot; rel=&quot;footnote&quot;&gt;1&lt;/a&gt;&lt;/sup&gt;&quot;&lt;/i&gt;.&lt;/p&gt;

&lt;h3&gt;Updates&lt;/h3&gt;

&lt;p&gt;05.11.20 Nate Friedman (CEO of Github) &lt;a href=&quot;https://news.ycombinator.com/item?id=24995121&quot;&gt;promises&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;[..] we are going to make it much more obvious when you&#039;re viewing an orphaned commit.&lt;/blockquote&gt;

&lt;p&gt;For context: The source code of Github (the product) had been leaked as a &lt;a href=&quot;https://web.archive.org/web/20201104050026/https://github.com/github/dmca/tree/565ece486c7c1652754d7b6d2b5ed9cb4097f9d5&quot;&gt;commit to Github&#039;s own DMCA repository&lt;/a&gt;. The repository has turned into a &lt;a href=&quot;https://github.com/github/dmca/pull/8148&quot;&gt;playground&lt;/a&gt; since Github took down the hosting for &lt;code&gt;youtube-dl&lt;/code&gt; as the result of a &lt;a href=&quot;https://github.com/github/dmca/blob/18429823a5404ff7d9f6f0418588d8a48b81f671/2020/10/2020-10-23-RIAA.md&quot;&gt;DMCA complaint&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;14.11.20 Seems Github now adds a warning to commits that are not in a reachable branch
&lt;!-- s9ymdb:665 --&gt;&lt;img class=&quot;serendipity_image_center&quot; width=&quot;789&quot; height=&quot;85&quot;  src=&quot;http://daniel-lange.com/uploads/entries/201114_Github_commit_warning_message.png&quot;  alt=&quot;Github commit warning message&quot; style=&quot;border:0px; display: inline;&quot;&gt;&lt;/p&gt;

&lt;p&gt;28.01.22 Github currently fails to show the warning message, so &lt;a href=&quot;https://github.com/torvalds/linux/tree/8bcab0346d4fcf21b97046eb44db8cf37ddd6da0&quot;&gt;https://github.com/torvalds/linux/tree/8bcab0346d4fcf21b97046eb44db8cf37ddd6da0&lt;/a&gt; is making rounds now:
&lt;!-- s9ymdb:685 --&gt;&lt;img class=&quot;serendipity_image_center&quot; width=&quot;1063&quot; height=&quot;651&quot;  src=&quot;http://daniel-lange.com/uploads/entries/220128_Github_still_failing_attribution.png&quot;  alt=&quot;Fake commit to Linus Torvalds&#039; kernel repo updating the README file and claiming to have deleted Linux&quot;&gt;&lt;/p&gt;

&lt;div class=&quot;footnotes&quot;&gt;
&lt;hr /&gt;
&lt;ol&gt;

&lt;li id=&quot;fn:1&quot;&gt;
&lt;p&gt;Actually there is something you can do. Making a repo private takes it out of the shared &quot;object storage&quot;. You can make it public again afterwards. Seems to work at least for now.&amp;#160;&lt;a href=&quot;#fnref:1&quot; rev=&quot;footnote&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;

&lt;/ol&gt;
&lt;/div&gt;
 
    </content:encoded>

    <pubDate>Wed, 28 Oct 2020 21:30:00 +0000</pubDate>
    <guid isPermaLink="false">http://daniel-lange.com/archives/165-guid.html</guid>
    <category>git</category>
<category>github</category>
<category>hacking</category>
<category>linux</category>
<category>updated</category>

</item>
<item>
    <title>Debian Gitlab (salsa.debian.org) tricks</title>
    <link>http://daniel-lange.com/archives/140-Debian-Gitlab-salsa.debian.org-tricks.html</link>
            <category>Debian</category>
    
    <comments>http://daniel-lange.com/archives/140-Debian-Gitlab-salsa.debian.org-tricks.html#comments</comments>
    <wfw:comment>http://daniel-lange.com/wfwcomment.php?cid=140</wfw:comment>

    <slash:comments>2</slash:comments>
    <wfw:commentRss>http://daniel-lange.com/rss.php?version=2.0&amp;type=comments&amp;cid=140</wfw:commentRss>
    

    <author>nospam@example.com (Daniel Lange)</author>
    <content:encoded>
    &lt;p&gt;Debian is moving the git hosting from &lt;a href=&quot;https://alioth.debian.org&quot;&gt;alioth.debian.org&lt;/a&gt;, an instance of Fusionforge, to &lt;a href=&quot;https://salsa.debian.org&quot;&gt;salsa.debian.org&lt;/a&gt; which is a Gitlab instance.&lt;/p&gt;

&lt;p&gt;There is some background reading available on &lt;a href=&quot;https://wiki.debian.org/Salsa/&quot;&gt;https://wiki.debian.org/Salsa/&lt;/a&gt;. This also has pointers to an import script to ease migration for people that move repositories. It&#039;s definitely worth hanging out in &lt;a href=&quot;irc://irc.oftc.net/alioth&quot;&gt;#alioth on oftc&lt;/a&gt;, too, to learn more about salsa / gitlab in case you have a persistent irc connection.&lt;/p&gt;

&lt;p&gt;As of now() salsa has 15,320 projects, 2,655 users in 298 groups.&lt;br /&gt;
Alioth has 29,590 git repositories (which is roughly equivalent to a project in Gitlab), 30,498 users in 1,154 projects (which is roughly equivalent a group in Gitlab).&lt;/p&gt;

&lt;p&gt;So we currently have 50% of the git repositories migrated. One month after leaving beta. This is very impressive.&lt;br /&gt;
As Alioth has naturally accumulated some cruft, Alexander Wirt (formorer) estimates that 80% of the repositories in use have already been migrated.&lt;/p&gt;

&lt;p&gt;So it&#039;s time to update your local &lt;code&gt;.git/config&lt;/code&gt; URLs!&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://dogguy.org&quot;&gt;Mehdi Dogguy&lt;/a&gt; has written &lt;a href=&quot;https://salsa.debian.org/mehdi/salsa-scripts/&quot;&gt;nice scripts&lt;/a&gt; to ease handling salsa / gitlab via the (extensive and very well documented) &lt;a href=&quot;https://docs.gitlab.com/ce/api/&quot;&gt;API&lt;/a&gt;. Among them is &lt;a href=&quot;https://salsa.debian.org/mehdi/salsa-scripts/blob/master/list_projects.sh&quot;&gt;list_projects&lt;/a&gt; that gets you nice overview of the projects in a specific group. This is especially true for the &quot;Debian&quot; group that contains the former &lt;a href=&quot;https://wiki.debian.org/Alioth/Git#Collab_Maint_project&quot;&gt;collab-maint&lt;/a&gt; repositories, so source code that can and shall be maintained by Debian Developers collectively.&lt;/p&gt;

&lt;h2&gt;Finding migrated repositories&lt;/h2&gt;

&lt;p&gt;Salsa can search quite quickly via the Web UI: &lt;a href=&quot;https://salsa.debian.org/search?utf8=✓&amp;amp;search=htop&quot;&gt;https://salsa.debian.org/search?utf8=✓&amp;amp;search=htop&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a class=&quot;serendipity_image_link&quot; title=&quot;Salsa search screenshot&quot; href=&#039;https://salsa.debian.org/search?utf8=✓&amp;search=htop&#039; target=&quot;_blank&quot;&gt;&lt;!-- s9ymdb:648 --&gt;&lt;img class=&quot;serendipity_image_center&quot; style=&quot;border:1px solid black&quot; width=&quot;774&quot; height=&quot;304&quot; src=&quot;http://daniel-lange.com/uploads/entries/180225_Salsa_search_screenshot.png&quot; title=&quot;Salsa search screenshot&quot; alt=&quot;Salsa search screenshot&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;but finding the URL to clone the repository from is more clicks and ~4MB of data each time (yeah, the modern web), so&lt;/p&gt;

&lt;div class=&quot;bash geshi&quot; style=&quot;text-align: left&quot;&gt;$ curl &lt;span style=&quot;color: #660033;&quot;&gt;--silent&lt;/span&gt; https:&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;//&lt;/span&gt;salsa.debian.org&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;api&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;v4&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;projects?&lt;span style=&quot;color: #007800;&quot;&gt;search&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;htop&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;|&lt;/span&gt; jq .&lt;br /&gt;&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;br /&gt;&amp;#160; &lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;id&amp;quot;&lt;/span&gt;: &lt;span style=&quot;color: #000000;&quot;&gt;9546&lt;/span&gt;,&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;description&amp;quot;&lt;/span&gt;: &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;interactive processes viewer&amp;quot;&lt;/span&gt;,&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;name&amp;quot;&lt;/span&gt;: &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;htop&amp;quot;&lt;/span&gt;,&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;name_with_namespace&amp;quot;&lt;/span&gt;: &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;Debian / htop&amp;quot;&lt;/span&gt;,&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;path&amp;quot;&lt;/span&gt;: &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;htop&amp;quot;&lt;/span&gt;,&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;path_with_namespace&amp;quot;&lt;/span&gt;: &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;debian/htop&amp;quot;&lt;/span&gt;,&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;created_at&amp;quot;&lt;/span&gt;: &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;2018-02-05T12:44:35.017Z&amp;quot;&lt;/span&gt;,&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;default_branch&amp;quot;&lt;/span&gt;: &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;master&amp;quot;&lt;/span&gt;,&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;tag_list&amp;quot;&lt;/span&gt;: &lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#93;&lt;/span&gt;,&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;ssh_url_to_repo&amp;quot;&lt;/span&gt;: &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;git@salsa.debian.org:debian/htop.git&amp;quot;&lt;/span&gt;,&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;http_url_to_repo&amp;quot;&lt;/span&gt;: &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;https://salsa.debian.org/debian/htop.git&amp;quot;&lt;/span&gt;,&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;web_url&amp;quot;&lt;/span&gt;: &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;https://salsa.debian.org/debian/htop&amp;quot;&lt;/span&gt;,&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;avatar_url&amp;quot;&lt;/span&gt;: null,&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;star_count&amp;quot;&lt;/span&gt;: &lt;span style=&quot;color: #000000;&quot;&gt;0&lt;/span&gt;,&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;forks_count&amp;quot;&lt;/span&gt;: &lt;span style=&quot;color: #000000;&quot;&gt;0&lt;/span&gt;,&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;last_activity_at&amp;quot;&lt;/span&gt;: &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;2018-02-17T18:23:05.550Z&amp;quot;&lt;/span&gt;&lt;br /&gt;&amp;#160; &lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/div&gt;

&lt;p&gt;is a bit nicer.&lt;/p&gt;

&lt;p&gt;Please notice the git url format is a bit odd, it&#039;s either&lt;br /&gt;
&lt;code&gt;git@salsa.debian.org:debian/htop.git&lt;/code&gt; or&lt;br /&gt;
&lt;code&gt;ssh://git@salsa.debian.org/debian/htop.git&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Notice the &quot;:&quot; -&gt; &quot;/&quot; after the hostname. Bit me once.&lt;/p&gt;

&lt;h2&gt;Finding repositories to update&lt;/h2&gt;

&lt;p&gt;At this time I found it useful to check which of the repositories I have cloned had not yet been updated in the local &lt;code&gt;.git/config&lt;/code&gt;:&lt;/p&gt;

&lt;div class=&quot;bash geshi&quot; style=&quot;text-align: left&quot;&gt;&lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;find&lt;/span&gt; ~&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;debconf&lt;/span&gt; ~&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;my_sources ~&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;shared &lt;span style=&quot;color: #660033;&quot;&gt;-ipath&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;*.git/config&#039;&lt;/span&gt; &lt;span style=&quot;color: #660033;&quot;&gt;-exec&lt;/span&gt; &lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;grep&lt;/span&gt; &lt;span style=&quot;color: #660033;&quot;&gt;-H&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;url.*git\.debian&#039;&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;{}&#039;&lt;/span&gt; \;&lt;/div&gt;

&lt;p&gt;Thanks to Jörg Jaspert (Ganneff) the Debconf repositories have all been &lt;a href=&quot;https://salsa.debian.org/debconf-team/public&quot;&gt;moved to Salsa&lt;/a&gt; now.&lt;br /&gt;
Hint: Bug him for his scripts if you need to do complex moves.&lt;/p&gt;

&lt;p&gt;Updating the URLs has been an hours work on my side and there is little you can do to speed that up if - as in the Debconf case - teams have used the opportunity to clean up and things are not as easy as using &lt;code&gt;sed -i&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;But there is no reason to do this more than once, so for the laptops...&lt;/p&gt;

&lt;h2&gt;Speeding up migration on multiple devices&lt;/h2&gt;

&lt;div class=&quot;bash geshi&quot; style=&quot;text-align: left&quot;&gt;rsync &lt;span style=&quot;color: #660033;&quot;&gt;-armuvz&lt;/span&gt; &lt;span style=&quot;color: #660033;&quot;&gt;--existing&lt;/span&gt; &lt;span style=&quot;color: #660033;&quot;&gt;--include&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;*/&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #660033;&quot;&gt;--include&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;.git/config&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #660033;&quot;&gt;--exclude&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;*&amp;quot;&lt;/span&gt; ~&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;debconf&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt; laptop:debconf&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;&lt;/div&gt;

&lt;p&gt;will rsync the &lt;code&gt;.git/config&lt;/code&gt; files that you changed to other systems where you keep partial copies.&lt;/p&gt;

&lt;p&gt;On these a simple &lt;code&gt;git pull&lt;/code&gt; to get up to remote HEAD or using the &lt;code&gt;git_pull_all&lt;/code&gt; one-liner from &lt;a href=&quot;https://daniel-lange.com/archives/99-Managing-a-project-consisting-of-multiple-git-repositories.html&quot;&gt;https://daniel-lange.com/archives/99-Managing-a-project-consisting-of-multiple-git-repositories.html&lt;/a&gt; will suffice.&lt;/p&gt;

&lt;h2&gt;Git short URL&lt;/h2&gt;

&lt;p&gt;Stefano Rivera (tumbleweed) shared this clever trick:&lt;/p&gt;

&lt;div class=&quot;bash geshi&quot; style=&quot;text-align: left&quot;&gt;&lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;git config&lt;/span&gt; &lt;span style=&quot;color: #660033;&quot;&gt;--global&lt;/span&gt; url.&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;ssh://git@salsa.debian.org/&amp;quot;&lt;/span&gt;.insteadOf salsa:&lt;/div&gt;

&lt;p&gt;This way you can &lt;code&gt;git clone salsa:debian/htop&lt;/code&gt;.&lt;/p&gt;
 
    </content:encoded>

    <pubDate>Sun, 25 Feb 2018 11:30:00 +0000</pubDate>
    <guid isPermaLink="false">http://daniel-lange.com/archives/140-guid.html</guid>
    <category>bash</category>
<category>debian</category>
<category>find</category>
<category>git</category>
<category>gitlab</category>
<category>rsync</category>
<category>salsa</category>

</item>
<item>
    <title>Managing a project consisting of multiple git repositories</title>
    <link>http://daniel-lange.com/archives/99-Managing-a-project-consisting-of-multiple-git-repositories.html</link>
            <category>IT</category>
    
    <comments>http://daniel-lange.com/archives/99-Managing-a-project-consisting-of-multiple-git-repositories.html#comments</comments>
    <wfw:comment>http://daniel-lange.com/wfwcomment.php?cid=99</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://daniel-lange.com/rss.php?version=2.0&amp;type=comments&amp;cid=99</wfw:commentRss>
    

    <author>nospam@example.com (Daniel Lange)</author>
    <content:encoded>
    &lt;p&gt;The core team organizing DebConf, the annual Debian developer conference, reached out to me two weeks ago to help support this year&#039;s effort a bit.&lt;/p&gt;

&lt;p&gt;I&#039;m very happy to do so as Debian is a cornerstone of everything I do in the Open Source/Free Software space.&lt;/p&gt;

&lt;p&gt;&lt;!-- s9ymdb:612 --&gt;&lt;img class=&quot;serendipity_image_right&quot; width=&quot;459&quot; height=&quot;494&quot;  src=&quot;http://daniel-lange.com/uploads/entries/150329_git_pull_all_screenshot.png&quot; title=&quot;Screenshot of git_pull_all with color&quot; alt=&quot;Screenshot of git_pull_all with color&quot; /&gt;&lt;/p&gt;

&lt;p&gt;To get me started I got access to a lot of mailing lists and irc channels. And even more git repositories. So many that the DebConf team even has an &lt;a href=&quot;https://wiki.debconf.org/wiki/GitMigration&quot; title=&quot;DebConf explanation of git repository structure&quot;&gt;instruction page&lt;/a&gt; on how the repositories all fit together.&lt;/p&gt;

&lt;p&gt;It&#039;s unfortunately quite common to split a bigger project into many git repositories to ease access rights management and reduce the noise and data transfer volume for the average user. The downside is, everybody ends up with a dozen or more individual repositories to keep pulling. And then there&#039;s git annex for yet another &lt;a href=&quot;http://en.wikipedia.org/wiki/Fundamental_theorem_of_software_engineering&quot; title=&quot;Wikipedia: The Fundamental theorem of software engineering&quot;&gt;level of indirection&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://joeyh.name/&quot; title=&quot;Joey Hess&#039; homepage&quot;&gt;Joey Hess&lt;/a&gt;, a former Debian developer, has even written an extensive tool, &lt;a href=&quot;http://myrepos.branchable.com/&quot; title=&quot;Myrepos (mr) homepage&quot;&gt;myrepos&lt;/a&gt;, to meta-manage the different repositories and it can do quite some magic across different SCMSs&lt;sup id=&quot;fnref:1&quot;&gt;&lt;a href=&quot;#fn:1&quot; rel=&quot;footnote&quot;&gt;1&lt;/a&gt;&lt;/sup&gt;. In my case this is a bit of an overkill though.&lt;/p&gt;

&lt;p&gt;And using myrepos may get you confused at some point whether to now run &lt;code&gt;mr&lt;/code&gt; or &lt;code&gt;git&lt;/code&gt; directly for each batch of repos you have inherited over some time of working on multiple projects.&lt;sup id=&quot;fnref:2&quot;&gt;&lt;a href=&quot;#fn:2&quot; rel=&quot;footnote&quot;&gt;2&lt;/a&gt;&lt;/sup&gt; Thus I prefer the simple route:&lt;/p&gt;

&lt;p&gt;Check out each repository into a common top-level directory (&lt;code&gt;~/debconf/&lt;/code&gt; in this case) and then put the following two lines into an executable script &lt;code&gt;git_pull_all&lt;/code&gt; into that top level directory:&lt;/p&gt;

&lt;div class=&quot;bash geshi&quot; style=&quot;text-align: left&quot;&gt;&lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;#!/bin/sh&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;find&lt;/span&gt; ~&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;debconf&lt;/span&gt; &lt;span style=&quot;color: #660033;&quot;&gt;-mindepth&lt;/span&gt; &lt;span style=&quot;color: #000000;&quot;&gt;1&lt;/span&gt; &lt;span style=&quot;color: #660033;&quot;&gt;-maxdepth&lt;/span&gt; &lt;span style=&quot;color: #000000;&quot;&gt;1&lt;/span&gt; &lt;span style=&quot;color: #660033;&quot;&gt;-type&lt;/span&gt; d &lt;span style=&quot;color: #660033;&quot;&gt;-exec&lt;/span&gt; &lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;sh&lt;/span&gt; &lt;span style=&quot;color: #660033;&quot;&gt;-c&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;cd {}; test -r .git/config &amp;amp;&amp;amp; git pull $*&amp;quot;&lt;/span&gt; \;&lt;/div&gt;

&lt;p&gt;This will allow you to pull all git repos with one command and keep the normal syntax for everything else you do with each repo.&lt;/p&gt;

&lt;p&gt;The --mindepth and --maxdepth will instruct &lt;code&gt;find&lt;/code&gt; to just go and run your &lt;code&gt;git pull&lt;/code&gt; only inside each direct child of the top level directory. So recursion depth = 1. That is the single trick there is to this.&lt;/p&gt;

&lt;h3&gt;Updates:&lt;/h3&gt;

&lt;p&gt;If you like to have some color and a bit of a spaced layout for improved readability, try:&lt;/p&gt;

&lt;div class=&quot;bash geshi&quot; style=&quot;text-align: left&quot;&gt;&lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;#!/bin/sh&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;find&lt;/span&gt; ~&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;debconf&lt;/span&gt; &lt;span style=&quot;color: #660033;&quot;&gt;-mindepth&lt;/span&gt; &lt;span style=&quot;color: #000000;&quot;&gt;1&lt;/span&gt; &lt;span style=&quot;color: #660033;&quot;&gt;-maxdepth&lt;/span&gt; &lt;span style=&quot;color: #000000;&quot;&gt;1&lt;/span&gt; &lt;span style=&quot;color: #660033;&quot;&gt;-type&lt;/span&gt; d &lt;span style=&quot;color: #660033;&quot;&gt;-exec&lt;/span&gt; &lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;sh&lt;/span&gt; &lt;span style=&quot;color: #660033;&quot;&gt;-c&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;cd {}; test -r .git/config &amp;amp;&amp;amp; (printf &lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\&amp;quot;&lt;/span&gt;\033[1m\033[34m%-50s\033[0m&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\$&lt;/span&gt;{PWD}:&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\&amp;quot;&lt;/span&gt; ; git pull $*)&amp;quot;&lt;/span&gt; \;&lt;/div&gt;

&lt;p&gt;When you have &lt;strong&gt;pull.rebase=true&lt;/strong&gt; set in your .gitconfig, you can run &lt;code&gt;./git_pull_all --no-rebase&lt;/code&gt; to avoid rebases in case you work somewhere and want to have the merge commits.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;P.S.:&lt;/strong&gt; The DebConf15 Heidelberg registration just opened, please check &lt;a href=&quot;http://debconf15.debconf.org&quot; title=&quot;DebConf15 Heidelberg home page&quot;&gt;the DebConf15 homepage&lt;/a&gt; for news, venue information and please register if you want to come around.&lt;/p&gt;

&lt;div class=&quot;footnotes&quot;&gt;
&lt;hr /&gt;
&lt;ol&gt;

&lt;li id=&quot;fn:1&quot;&gt;
&lt;p&gt;Source Code Management Systems, like git, mercurial (hg) or subversion (svn). Or God forbid ... &lt;a href=&quot;https://git.wiki.kernel.org/index.php/LinusTalk200705Transcript&quot; title=&quot;Linus&#039; talk of git with a lot of .... info on cvs; transcript&quot;&gt;cvs&lt;/a&gt;. I don&#039;t like the (D)VCS (Distributed) Version Control Systems moniker. Because that&#039;s not really all these systems do. Not even the most important piece of what they do these days.&amp;#160;&lt;a href=&quot;#fnref:1&quot; rev=&quot;footnote&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;

&lt;li id=&quot;fn:2&quot;&gt;
&lt;p&gt;With myrepos you can still work with each individual repository via git. Just so nobody will write in &quot;but...&quot;.&amp;#160;&lt;a href=&quot;#fnref:2&quot; rev=&quot;footnote&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;

&lt;/ol&gt;
&lt;/div&gt;
 
    </content:encoded>

    <pubDate>Thu, 05 Mar 2015 13:30:00 +0000</pubDate>
    <guid isPermaLink="false">http://daniel-lange.com/archives/99-guid.html</guid>
    <category>debian</category>
<category>git</category>
<category>scms</category>
<category>script</category>
<category>shell</category>
<category>updated</category>

</item>

</channel>
</rss>
