Shared posts

03 Aug 18:33

The Best We Can Do — the pragmatic views of Cheryl Misak and young Frank Ramsey

Is there anything better than “the best we can do”? According to some pragmatic philosophers, it’s not about settling for less but constantly pushing for more, and more. IDEAS presents the case for a particular, ‘moderate’ brand of pragmatism that may be deeply valuable in times of uncertainty.
09 Jun 02:46

Thanks a Lot, Milton Jones!

Tom Roche

very excellent oneliners

Milton’s attempt to become an international art dealer leads to a deadly brush with danger. Mention Milton Jones to most people and the first thing they think is "Help!". Each week, Milton and his trusty assistant Anton set out to help people and soon find they're embroiled in a new adventure. Because when you're close to the edge, then Milton can give you a push. "Milton Jones is one of Britain's best gagsmiths with a flair for creating daft yet perfect one-liners" - The Guardian. "King of the surreal one-liners" - The Times "If you haven't caught up with Jones yet - do so!" - The Daily Mail Written by Milton with James Cary (Bluestone 42, Miranda), and Dan Evans (who co-wrote Milton's Channel 4 show House Of Rooms), the man they call "Britain's funniest Milton," returns to the radio with a fully-working cast and a shipload of new jokes. The cast includes regulars Tom Goodman-Hill (Spamalot, Mr. Selfridge) as the ever-faithful Anton, Josie Lawrence and Ben Willbond (Yonderland, Ghosts). With music by Guy Jackson Produced and directed by David Tyler A Pozzitive production for BBC Radio 4
04 May 02:10

The Nature of Democracy In the Times of Crisis

04 May 02:05

When The Battle Between Capital and Labor Was at its Fiercest

02 May 18:08

Bali and Beyond

Can we ever capture the diversity of Indonesia? Deborah Cassrels has lived in Bali for more than ten years working as a reporter and has written a memoir about her experiences and the stories she has covered, beyond the perfect tourist destination.
28 Apr 15:53

The Vast Majority: Bernie's Campaign Strategy Wasn't the Problem with Hadas Thier and Paul Heideman

by Jacobin magazine
Tom Roche

very shallow analysis--tees up the obviously-bogus liberal critiques (shoulda been nicer to USCFM, shoulda run a more Warren-like campaign) but ignores more tactical considerations (notably, You Can't Be Friends With The Enemy, conceding electability for ... Joe Biden !?!) advanced by (e.g.) Ball and Enjeti @ Rising.

There are too many bad takes out there about the end of the Bernie Sanders campaign. Thankfully, Hadas Thier and Paul Heideman wrote one that is good: "Bernie's Campaign Strategy Wasn't the Problem."
And you can still get Micah Uetricht and Meagan Day's 'Bigger Than Bernie' for only $12.95 from Jacobin: https://jacobinmag.com/store/product/69
24 Apr 02:10

Jane Mayer On How Mitch McConnell Became Trump's 'Enabler-In-Chief'

'New Yorker' staff writer Jane Mayer talks about how the Senate majority leader has thrown his support behind the President, and allowed the president to diminish congressional power — in spite of the fact that Trump and McConnell are opposites in several ways. Mayer says McConnell's refusal to rein in Trump is looking riskier than ever.

Also, TV critic David Bianculli bids farewell to 'Homeland' and welcomes back 'Penny Dreadful' on Showtime.
22 Apr 14:30

Americans have Texas-sized carbon footprints—here’s why

by Scott K. Johnson
Tom Roche

The fourfold 'why' (per this piece--TODO: get underlying papers):

1. Transportation:
1.1. Americans own more vehicles.
1.2. US vehicles have lower average fuel efficiency.
1.3. US vehicles have higher average VMTs (vehicle miles traveled)

2. Housing:
2.1. US homes tend to be single-family detached
2.2. US homes are bigger

3. Diet:
3.1. US beef consumption (which has esp huge carbon and water and land footprints)

4. Consumption of other goods (besides energy, transportation, housing) and services

"[sectors contributing to] the average American carbon footprint [are] around one-third transportation, one-quarter housing, [one-quarter] purchased goods and services, [and one-sixth] diet"

Also, great infographic on 'Fossil CO2 Emissions Per Capita and Population' @ https://cdn.arstechnica.net/wp-content/uploads/2020/04/1-s70_2019_skyline_population.png . TODO: get original chart

Casually dressed people congregate around an oddly misshapen humanoid statue.

Enlarge / Fairgoers gather at Big Tex at the State Fair of Texas in 2018. Based on American data, presumably some not-insignificant portion of fairgoers traveled to Dallas in not-the-most-fuel-efficient of vehicles. (credit: Ron Jenkins / The Washington Post / Getty Images)

Greenhouse gas emissions are most commonly reported at the national level, which tends to make us compare nations to other nations. This makes some sense, as national policy can significantly influence emissions trends. But it's easy to forget that borders are just lines on a map, and some lines have considerably more people inside them than others. The citizens of Luxembourg don't ensure their country's low carbon emissions because they're lightyears ahead of the people of China in terms of efficiency—there are just a whole lot fewer of them.

In order to make more meaningful comparisons, you obviously have to calculate emissions per person. And when you do that, the United States really sticks out. (As does Luxembourg, by the way.) It's not surprising that per capita emissions in the United States are much greater than in India, where millions of people still lack electricity. But why are they also much greater than in the wealthier Western nations in Europe?

To answer that question, we need to do more than divide a national total by population. We need to break down the contributions to a person's carbon footprint—the emissions behind the things we buy and do. Doing that in a detailed way is a challenge, and researchers haven't been at it that long. "A lot of the research that's been done has been done quite quickly [with] available data and resources," UC Berkeley's Chris Jones told Ars, "And there really is a lot of work to do."

Read 33 remaining paragraphs | Comments

20 Apr 17:02

Bernie Sanders Is Staying on the Ballot to Get More Delegates, but He and His Supporters Aren’t Investing Much in That Effort

by Rachel M. Cohen
Tom Roche

Bernie betraying the cause ...

When Bernie Sanders ended his presidential bid last week, he conceded that he could not feasibly catch up to Joe Biden’s 300-some delegate lead to win the nomination but told supporters that he would stay on the ballot in all the remaining state primaries. “While Vice President Biden will be the nominee, we must continue working to assemble as many delegates as possible at the Democratic convention, where we will be able to exert significant influence over the party platform and other functions,” he said in a livestreamed video address.

At the time, Sanders had 911 delegates to Biden’s 1,226. Sanders picked up 24 more from Wisconsin’s controversial in-person election — which was held the day before he dropped out but whose results were announced this week — with the Vermont senator taking just 31 percent of the vote. He got seven more delegates from Alaska, where he won 45 percent of the vote. Alaska’s vote-by-mail primary was the first contest held after Sanders had dropped out, but only 15 out of the 3,979 total pledged delegates were up for grabs. Roughly 1,600 delegates remain, according to NBC News’s delegate tracker.  

The party platform will be decided at the Democratic National Convention, which was postponed from July to August due to the coronavirus pandemic. To have more influence over shaping it, Sanders will need at least 1,200 elected delegates, which will require winning at least 15 percent of the vote in the remaining primaries. Some delegate-rich states are still up for grabs, like Ohio, New York,  Pennsylvania, and Georgia. (Many of the votes in Ohio have already been cast by mail; GOP Gov. Mike DeWine postponed the in-person election that had been scheduled for March 17.)

But it’s unclear how hard the Sanders campaign — or what’s left of it — will be working to get those delegates. Sanders has already said he would not actively campaign or spend money on advertising in any of the remaining contests, and he has made clear that he will be campaigning for Biden.

The Sanders campaign, which has laid off the vast majority of its organizing staff, told The Intercept that there’s “a team that works on delegates that is working the strategy” but declined to provide further detail, including how many staffers are staying on to do that.

As the senator deliberated the future of his campaign in recent weeks, Larry Cohen, chair of Our Revolution, urged Sanders to stay in the race all the way to the convention. He warned that if Sanders failed to amass at least 25 percent of the total, then all the democratic reforms his supporters had fought for after 2016, such as reducing the power of superdelegates and making caucuses more transparent, could be lost. 

“The reforms were only put in place for one cycle,” Cohen told The Intercept. “It’s not what we set out to do, but it’s what we could get passed at the time.”

While Our Revolution, the group that formed from the remnants of Sanders’s 2016 campaign, says it’s prioritizing turning out voters to rack up Sanders’s delegate count, most of the other national groups that backed Sanders’s candidacy aren’t planning to direct much, if any, resources to that effort. 

Our Revolution will be doing personal outreach to its most active supporters in the remaining states with requests that they volunteer to send get-out-the-vote texts to other voters. The group is not running any independent expenditures for Sanders. 

Other Sanders-supporting groups don’t have plans to get involved or are planning to do just minimal outreach over email and social media. Evan Weber, political director for the Sunrise Movement, which endorsed Sanders in January, told The Intercept that the group hasn’t determined whether it will be phone-banking or doing other kinds of GOTV work for the remaining primaries. “It’s not in our organizing plans as they are developed thus far,” he said.

A spokesperson for the Democratic Socialists of America said that since Sanders has left the race, the organization has “shifted our work to focus on down ballot races,” naming a handful of local, state, and congressional candidates it is supporting. 

Justice Democrats will also be focusing on down-ballot primaries, said spokesperson Waleed Shahid, and the Center for Popular Democracy Action is also not investing more in getting out the vote for Sanders. Jennifer Epps-Addison, co-executive director of CPD Action, said its stance is “folks can choose to vote for Sanders in the remaining primaries, and Biden should see those votes as an endorsement of the progressive agenda he’ll need to make room for to motivate key voting blocs needed to defeat Trump.” The group’s biggest focus now though, she said, is “defeating Trump and advancing bold progressive ideals.”

The Working Families Party, which originally endorsed Sen. Elizabeth Warren but then endorsed Sanders several days after she dropped out, will be encouraging members to vote for Sanders through email and social media, but is not planning to run a big persuasion effort. “We’re going to urge WFP members in the remaining primary states to cast a vote for Sanders, in order to send as many progressive delegates as possible to the convention,” said WFP’s national campaigns director, Joe Dinkin. 

There is historical precedent for a losing candidate to focus on influencing their party’s convention even when their nomination was out of reach. When Jesse Jackson ran for president in 1984 and 1988, he also used his position to push for rules reform in the Democratic nominating process, which he argued had unfairly hurt black candidates and other outsiders running as progressives. Jackson successfully pushed for abolishing the “winner-take-all” delegate standard, and now delegates are divided up proportionally according to a candidate’s share of the vote. It was these reforms that enabled Barack Obama to win his presidential primary in 2008.

Sanders reaching the 25 percent threshold is important, said Cohen, because under current Democratic Party rules, if a candidate has at least 25 percent, then those delegates can introduce minority resolutions on the floor — a sometimes long and dramatic process that convention leaders work very hard to avoid. The goal is always to reach a compromise among committee members beforehand so as to avoid that scenario. Sanders supporters say that having the leverage to bring issues to the floor, even a virtual floor, will be key to winning concessions from the centrist wing.

Five days after dropping out, Sanders endorsed Biden and has since emphasized that he will work to support the former vice president in the general election. “I will do everything I can to help elect Joe,” Sanders told the Associated Press on Tuesday. “We had a contentious campaign. We disagree on issues. But my job now is to not only rally my supporters, but to do everything I can to bring the party together to see that [Trump] is not elected president.”

Regardless of whether Sanders is able to reach the delegate threshold he seeks, Biden is facing greater pressure to unify the party and court Sanders supporters than Hillary Clinton did in 2016. This week the two men announced that they will be forming task forces to work on issues like education, immigration, health care, criminal justice, and climate change. On Tuesday night, during an Instagram Live conversation with rapper Cardi B, Sanders said Biden was “moving in the right direction” on immigration and criminal justice reform.

Under pressure to unify the party, it’s unlikely that Biden would come out explicitly against the rules reforms the DNC Unity Commission agreed to in 2017 — especially as Biden’s campaign manager Jen O’Malley Dillon co-chaired that commission. The Biden campaign did not return a request for comment.

Cohen, though, has his eye not just on maintaining those reforms, but expanding them and pushing the party to adopt more progressive positions. Examples of platform stances he said Sanders delegates could push for include allowing employers to join Medicare, which is how South Korea eventually got to single payer, and allowing Medicare to negotiate prescription drug prices, like the U.S. Department of Veterans Affairs can.

The post Bernie Sanders Is Staying on the Ballot to Get More Delegates, but He and His Supporters Aren’t Investing Much in That Effort appeared first on The Intercept.

19 Apr 17:41

Irreal: An Organizational Workflow

by jcs
Tom Roche

notes @ logfile.200413::U 19 Apr 2020

Gregory J Stein has another interesting post on Emacs and Org Mode. This time it’s about how he leverages Org Mode to organize his life and workflow. It’s basically an update to his 2016 post on the same subject. This time he has a lengthy introduction that explains his goals and places his workflow in the context of the Getting Things Done method.

His workflow is a lot like mine except that I put most things into my engineering notebook/journal file including a record of my daily activities, phone calls, and discovery of things worth remembering. As Stein says, his setup works well for him but may not be exactly right for anyone else. Still, it’s a nice basis for anyone who wants to organize his life.

Stein says that his system transformed his life and enables him to plan for the future as well as manage his day-to-day activities. Take a look at his post and see if there’s something in there for you too.

19 Apr 14:25

Codementor: python Web Scrapping (requests_html not beautiful-soup)

Tom Roche

this is of course web scraping

Using request-html in Python we do data scrapping of a movies listing site https://www.boxofficemojo.com/year/world/?ref=bonbhmtab
19 Apr 02:30

Viking women

Tom Roche

excellent

Johanna Katrin Fridriksdottir explores what everyday life was like for women in Norse society, the opportunities available to them and the challenges they faced. Historyextra.com/podcast



 

See acast.com/privacy for privacy and opt-out information.

14 Apr 01:58

The late, great John Clarke

Tom Roche

rerun

First broadcast October 29, 2008. John Clarke talks about the evolution of his spot on ABC TV and the state of comedy in general in Australia and in the United States, The Colbert Report in particular. It's been over 30 years since political satirists John Clarke and Bryan Dawe first got together for their weekly interview series. It began on ABC radio and moved to Channel 9's A Current Affair before returning to the ABC.
13 Apr 14:53

The Vast Majority: Bernie Is Out with Marianela D’Aprile and Eric Blanc

by Jacobin magazine
Tom Roche

unfortunately mostly happytalk

Bernie Sanders is out of the race. We can’t go on; we must go on. Micah talked about it with Jacobin contributor Eric Blanc and Democratic Socialists of America National Political Committee member Marianela D’Aprile.
Buy ‘Bigger than Bernie’ here:
13 Apr 14:47

Matt Stoller On The Covid-19 Bailout, Plus Live Reactions To Bernie's Campaign Suspension

Tom Roche

Stoller is excellent

Matt Stoller joins the show to discuss the the Covid-19 bailout, Katie and Matt get the news of Bernie's campaign suspension in real-time, and discuss the backlash against Joe Rogan for his Trump vs. Biden quote.

Learn more about your ad choices. Visit megaphone.fm/adchoices

12 Apr 14:49

Why the Stock Market Is Healthy as Americans Die From Coronavirus

by Jon Schwarz
Tom Roche

commented

stockmarkter-theintercept-2

Photo Illustration: Soohee Cho/The Intercept; Getty Images

This past week the S&P 500 went up 301 points, or 12 percent, its best performance in 46 years.

During the same week, the reported number of Americans killed by Covid-19 went up 11,499, or 161 percent, the coronavirus’s best performance ever.

So this seems like a good time to reevaluate our treasured belief that a rising stock market reflects general human flourishing.

Consider a few more events that happened this week around the same time as this excited tweet from Donald Trump, who somehow is the president of the United States:


Hurrah! Meanwhile, the Covid-19 death toll that day topped 2,000 for the first time. It is now, according to a San Diego gerontologist, the leading cause of death in the U.S., beating out the traditional champions, heart disease and cancer. New data showed that Covid-19 is killing African Americans and Latinos in New York City at rates twice that of whites, with a similar disjunction in rates appearing across the country.

Also last week, over 6 million Americans filed for unemployment. The chief economist at RSM, one of the largest accounting firms in the U.S., said this demonstrated that “the carnage in the American labor market continued unabated.” The recent cumulative total of the newly unemployed is 16.8 million people, or about one in 10 workers.

As Americans were thrown out of work and into sudden fear of hunger, our economic system encouraged farmers to intentionally destroy their crops. At least 60,000 gallons of milk were dumped into dairy farm manure pits, traditionally the last place you like to see food. Milking cows were sent to slaughter. Fertilized chicken eggs were crushed rather than hatched.

A report sent to the White House on Tuesday from the National Academy of Sciences cast doubt on hopes that the novel coronavirus will naturally diminish in the spring and summer. “A decrease in cases with increases in humidity and temperature elsewhere should not be assumed,” the report explained. “Pandemic influenza strains have not exhibited the typical seasonal pattern of endemic/epidemic strains.”

Amid all of this, Trump demonstrated that he apparently believes Covid-19 is a disease caused by bacteria, rather than a virus. The difference between bacteria and viruses is often taught around fifth grade, when children are 10 years old.

The combination of this bad news with the stock market’s ebullience makes it tough not to think that it actively delights in human suffering. During the 1990s in particular, it was notorious for leaping upward when corporations announced massive layoffs.

What would truly make the stock market skyrocket, you might think by now, would be nuclear war followed immediately by a gigantic asteroid striking Manhattan. A hideously mutated Jim Cramer, the last man on Earth, would shriek “Dow 10,000,000!” just before expiring.

This is not the case, however. Rather, the stock market is simply agnostic about human happiness. It’s just a best-guess measure of future post-tax corporate profitability. If future post-tax corporate profitability is compatible with people being alive and having enough to eat, that’s OK. If not, that’s likewise totally fine. We’re just not part of the equation.

Looked at through this lens, the stock market’s latest behavior is easy to understand. As Dean Baker, senior economist at the Center for Economic and Policy Research in Washington, D.C., puts it: “We should take the recent jump to mean that investors are betting that Congress and Trump just gave them lots of money.”

That’s the true meaning of this week’s odd combination of events. Your grandmother can die of Covid-19 minutes after being discharged from the hospital. Nurses can be forced to protest their employers failing to provide them with basic personal protective equipment. The Centers for Disease Control and Prevention could fail completely at developing a test for the virus. All of that is irrelevant.

What matters is that the Trump administration will pay any price, bear any burden, meet any hardship to keep big corporations alive and profitable. That is, from the GOP’s perspective, the sole legitimate function of the U.S. government. And given their ferocious commitment and the government’s financial firepower, they have a plausible shot at success.

So get ready for further triumphalist tweets from Trump anytime the stock market goes up. You may be reading them while picking up sanitized food containers from a soup kitchen, or auctioning off the wreckage of your bankrupt small business, or attending a funeral via Zoom. Or you may just hazily hear them being celebrated on Fox while intubated and sedated.

None of that will matter, from the perspective of the stock market. What we should all see clearly now is that it can giddily thrive, even as America disintegrates around it.

The post Why the Stock Market Is Healthy as Americans Die From Coronavirus appeared first on The Intercept.

11 Apr 04:42

COVID 19 and breach of contract

Tom Roche

posted 2140 10 Apr 2020 (MT)

> As usual, your W 8 Apr 2020 program

> https://www.abc.net.au/radionational/programs/latenightlive/covid-19-contracts-_-john-eldridge/12127178

> has a link to download the program's audio. Unusually, the link

> https://abcmedia.akamaized.net/rn/podcast/2020/04/lnl_20200408_2220.mp3

> downloads a 17k file, which plays for ~1 sec. (Note this should be also be apparent from the caption for the download link, which is currently, and correctly, 'Download 0.02 MB'.) Even more unusually, this has been the case *since* W 8 Apr 2020--and, as I write, it is past 0430 S 11 Apr 2020.

> Please fix the audio file backing the download link.

What does the virus mean for contracts and the law of obligations?
10 Apr 01:42

271 - Biden Lied, Voters Died with Malaika Jabali, Tiffany Caban, and Adam Johnson,

Tom Roche

alas very skippable

271 - Biden Lied, Voters Died with Malaika Jabali, Tiffany Caban, and Adam Johnson, by Katie Halper
09 Apr 13:52

An amputee walks into a nudist colony...

Tom Roche

rerun

From the Icebreakers Comedy Festival in Niagara-on-the-Lake 2019, Courtney Gilmour admits she's jealous of bald guys and Nick Reynoldson shares a creative, if not politically incorrect way - to avoid fights
08 Apr 21:25

The End Of Bernie’s Campaign & Wisconsin Voting Issues

08 Apr 14:07

The genius of Artemisia

Tom Roche

great talk, but audio missing 22:14-22:25 :-(

Renaissance historian Catherine Fletcher explores the remarkable life and art of the acclaimed 17th-century Italian painter Artemisia Gentileschi, whose work was due to be celebrated with a major National Gallery exhibition this month. Historyextra.com/podcast

 

See acast.com/privacy for privacy and opt-out information.

05 Apr 18:56

Ep 157 Crisis of Confidence in Ukraine feat Mark Sleboda

Tom Roche

excellent and comprehensive

Guest: Mark Sleboda. We talk about recent events in Ukraine and what has developed into a crisis of confidence for Ukrainian President Zelensky. It resulted in a reshuffling in Zelensky’s cabinet, a no confidence vote in the Rada and no progress on bringing the civil conflict to an end, threats from the ultranationalist factions and strong opposition to Zelensky’s neoliberal economic policy proposals. Recent polls have also shown a larger lack of confidence in the legitimacy of the post-Maidan government overall. We also talk about the Ukrainian oligarch Kolomoisky and the Biden / Burisma Affair. 

Mark is an International Affairs & Security Analyst, a US Navy veteran, a university lecturer and a foreign policy realist.

FOLLOW Mark on Twitter @MarkSleboda1 and on Facebook, look for his appearances on RT, Sputnik and other international channels. 

Around the Empire is listener supported, independent media. Pitch in at Patreon: patreon.com/aroundtheempire or paypal.me/aroundtheempirepod. Find all links at aroundtheempire.com

SUBSCRIBE on YouTube. FOLLOW @aroundtheempire and @joanneleon.  SUBSCRIBE/FOLLOW on iTunes, iHeart, Spotify, Google Play, Facebook or on your preferred podcast app.

Recorded on March 10, 2020. Music by Fluorescent Grey.

Reference Links:

  1. Ukraine shake-up throws future of reforms into doubt, Financial Times
  2. Ukraine’s Zelensky Fires His Cabinet, New York Times

 

05 Apr 18:56

Ep 158 Conflict Between Russia and Turkey in Syria feat Mark Sleboda

Tom Roche

excellent and comprehensive

Guest: Mark Sleboda. We talk about the recent conflicts between Russia and Turkey in Syria. Negotiations resulted in a Sochi 2.0 Agreement, also called the Moscow Memorandum which settled the issue for the time being but none of the underlying problems were solved so it’s likely a temporary solution. We also discussed the overall situation in Syria and Turkish President Erdogan’s predicament and predictions for his future.

Mark is an International Affairs & Security Analyst, a US Navy veteran, a university lecturer and a foreign policy realist.

FOLLOW Mark on Twitter @MarkSleboda1 and on Facebook, look for his appearances on RT, Sputnik and other international channels. 

Around the Empire is listener supported, independent media. Pitch in at Patreon: patreon.com/aroundtheempire or paypal.me/aroundtheempirepod. Find all links at aroundtheempire.com

SUBSCRIBE on YouTube. FOLLOW @aroundtheempire and @joanneleon.  SUBSCRIBE/FOLLOW on iTunes, iHeart, Spotify, Google Play, Facebook or on your preferred podcast app.

Recorded on March 10, 2020. Music by Fluorescent Grey.

 

03 Apr 21:48

Behind the News, 4/2/20

Behind the News, 4/2/20 - guests: Dania Rajendra and Lauren Kaori Gurley on Amazon/WF/Instacart walkouts; J.W. Mason on WWII planning as a model for a Green New Deal - Doug Henwood
30 Mar 14:52

Will Evo Morales go quietly from Bolivia

Tom Roche

truly bad ... Jon Lee Anderson does US empire concern-trolling

Will former President Morales accept that his time as leader is over?
27 Mar 22:56

Mike Zamansky: Using Emacs Episode 68 - Tramp and org-publish

by Mike Zamansky
Tom Roche

actually mostly about styling org-mode->html with CSS, see video in linked page

I maintain a couple of small simple web sites. One provides information about my undergraduate honors CS program and another that isn't live yet is a FAQ for my CS teacher certification program. Traditionally I would use ssh to connect to the host machine, fire up Emacs and edit the html files to update the sites. I always forget that with Emacs we can do better. One way is with Tramp Mode.
27 Mar 22:52

Bryan Murdock: How To Retroactively Annex Files Already in a Git Repo

by Bryan
Tom Roche

mis- and using `git annex` to manage {BLOBs, large binary files}


UPDATE: With current versions of git, I no longer recommend git annex or git LFS unless you really need to store your large files on a separate server from your git repository. Just add your large files to git like any other file and when you clone, you can avoid downloading the full repository history with git clone --filter=blob:none and use git as normal.

Table of Contents

How To Retroactively Annex Files Already in a Git Repo

In my last post I talked about how surprisingly easy it is to use git annex to manage your large binary files (or even small ones). In this post, I'm going to show how hard it is to go back and fix the mistake you made when you decided not to learn and use git annex at the start of your project. Learn from my mistake!

When I started developing the website for my business, I figured that editing history in git is easy, and I could just check in binary files (like the images) for now and fix it later. Well, it was starting to get a little sluggish, and I had some bigger binary files that I wanted to start keeping with the website code, so I figured the time had come. Once I decided on git annex, it was time to go edit that history.

First Tries: filter-branch, filter-repo

There is a very old page of instructions for doing this using git filter-branch. The first thing I noticed when I tried that was this message from git:

WARNING: git-filter-branch has a glut of gotchas generating mangled history
         rewrites.  Hit Ctrl-C before proceeding to abort, then use an
         alternative filtering tool such as 'git filter-repo'
         (https://github.com/newren/git-filter-repo/) instead.  See the
         filter-branch manual page for more details; to squelch this warning,
         set FILTER_BRANCH_SQUELCH_WARNING=1.

Yikes! A warning like that from a tool (git) that is already known for its gotchas is one I decided to take seriously. Besides, I'm always down to try the new hotness, so I started reading about git-filter-repo. The more I read and experimented, even dug into the source code, the more I came to understand that it could not do what I needed, sadly. Maybe someone will read this and correct me.

Success with git rebase –interactive

Not seeing a nice pre-built tool or command that could do this for me, I set out to manually edit the repository history using good ol' git rebase --interactive. First, I had to find the all the binary files that are in the repo (not just the ones in the current revision). Here's how I did it:

# The --stat=1000 is so it doesn't truncate anything
git log --stat=1000 | grep Bin | sort | uniq > binary-files

Note the comment. Isn't it cute that git log truncates long lines even when stdout is not connected to your terminal? There are lots of little annoying gotchas like that throughout this process. Makes me miss mercurial, but don't worry, I will try not to mention mercurial again.

Now, you'll still have duplicates in binary-files because the other stuff that git log --stat spits out on each line. I personally used some emacs commands to remove everything but the filename from each line of the binary-files file, and then did a sort and uniq again.

Next, I had to find each commit that modified any of these binary files. Here's how I did that:

for file in $(cat binary-files); do
    git log --pretty=oneline --follow -- $file >> commits;
 done

Then I did another sort and uniq on that. Luckily there were only about 15 commits. Phew.

Next I tried to find the earliest commit in the list I had, but that was a pain (don't…mention…mercurial…), so I just ran git rebase --interactive and gave it one of the first commits I made in the repository. I actually used emacs magit to start the rebase, but the surgery required throughout the process made me drop to the command-line for most of it. magit did make it really easy to mark the 15 commits from my commits file with an e though.

OK, once the rebase got rolling I ran into a few different scenarios. Commits that added a new binary file, commits that deleted binary files, commits that modified binary files, and a commit that moved binary files.

Added binary files

When a binary file was added, git would act like I have always seen rebase interactive work, it would show the normal thing:

Stopped at 53fc550...  some commit message here
You can amend the commit now, with

  git commit --amend 

Once you are satisfied with your changes, run

  git rebase --continue

In that case I did this:

git show --stat=1000 # to see binary (Bin) files
git rm --cached <the-binary-files>
git add <the-binary-files> # git annex will annex them
git commit --amend
git rebase --continue

Easy peasy, as long as you have set up annex like my previous post explains so that annexing happens automatically.

Deleted binary files

When a binary file was deleted, git would throw up a message like this up:

$ git rebase --continue
[detached HEAD 130bcc4] banner on each page now
 21 files changed, 190 insertions(+), 42 deletions(-)
 create mode 100644 msd/webshop/static/webshop/img/common/adi-goldstein-EUsVwEOsblE-unsplash.jpg
 create mode 100644 msd/webshop/static/webshop/img/common/alexandre-debieve-FO7JIlwjOtU-unsplash.jpg
 delete mode 100644 msd/webshop/static/webshop/img/common/file-icons.png
 create mode 100644 msd/webshop/static/webshop/img/common/kevin-ku-w7ZyuGYNpRQ-unsplash.jpg
 create mode 100644 msd/webshop/static/webshop/img/common/levi-saunders-1nz-KjRdg-s-unsplash.jpg
 create mode 100644 msd/webshop/static/webshop/img/common/max-duzij-qAjJk-un3BI-unsplash.jpg
 create mode 100644 msd/webshop/static/webshop/img/common/nick-fewings-ZJAnGFg-rM4-unsplash.jpg
 create mode 100644 msd/webshop/static/webshop/img/common/umberto-jXd2FSvcRr8-unsplash.jpg
 create mode 100644 msd/webshop/static/webshop/img/common/yogesh-phuyal-mjwGKmwkDDA-unsplash.jpg
CONFLICT (modify/delete): msd/webshop/static/webshop/img/common/nick-fewings-ZJAnGFg-rM4-unsplash.jpg deleted in 90d71fb... refactored banners in pricing.css to reduce code duplication and modified in HEAD. Version HEAD of msd/webshop/static/webshop/img/common/nick-fewings-ZJAnGFg-rM4-unsplash.jpg left in tree.
error: could not apply 90d71fb... refactored banners in pricing.css to reduce code duplication
Resolve all conflicts manually, mark them as resolved with
"git add/rm <conflicted_files>", then run "git rebase --continue".
You can instead skip this commit: run "git rebase --skip".
To abort and get back to the state before "git rebase", run "git rebase --abort".
Could not apply 90d71fb... refactored banners in pricing.css to reduce code duplication

I guess in this case it was that I had added some new files too, so the message was extra verbose. The key message in all that was: "msd/webshop/static/webshop/img/common/nick-fewings-ZJAnGFg-rM4-unsplash.jpg deleted…" Here's what you do in this case:

git rm msd/webshop/static/webshop/img/common/nick-fewings-ZJAnGFg-rM4-unsplash.jpg
git diff --stat=1000 --staged # to find full paths for any Bin files
git restore --staged <binary-files>
git add <binary-files>
git diff --stat --staged # just to double check there are no Bin files now
git rebase --continue

Looks so simple (heh), but it took me a decent amount of web searching and experimentation to figure it out. All for you, dear reader, all for you.

Modified binary files

Here's one where I resized several images, git helpfully uttered:

$ git rebase --continue
[detached HEAD 7dfb28c] refactored banners in pricing.css to reduce code duplication
 4 files changed, 28 insertions(+), 75 deletions(-)
 create mode 100644 msd/webshop/static/webshop/img/common/connor-betts-QK6Iwzd5MhE-unsplash.jpg
 delete mode 100644 msd/webshop/static/webshop/img/common/nick-fewings-ZJAnGFg-rM4-unsplash.jpg
warning: Cannot merge binary files: msd/webshop/static/webshop/img/common/yogesh-phuyal-mjwGKmwkDDA-unsplash.jpg (HEAD vs. a90710f... scaled images down to max width of 1920 pixels)
warning: Cannot merge binary files: msd/webshop/static/webshop/img/common/umberto-jXd2FSvcRr8-unsplash.jpg (HEAD vs. a90710f... scaled images down to max width of 1920 pixels)
warning: Cannot merge binary files: msd/webshop/static/webshop/img/common/max-duzij-qAjJk-un3BI-unsplash.jpg (HEAD vs. a90710f... scaled images down to max width of 1920 pixels)
warning: Cannot merge binary files: msd/webshop/static/webshop/img/common/levi-saunders-1nz-KjRdg-s-unsplash.jpg (HEAD vs. a90710f... scaled images down to max width of 1920 pixels)
warning: Cannot merge binary files: msd/webshop/static/webshop/img/common/kevin-ku-w7ZyuGYNpRQ-unsplash.jpg (HEAD vs. a90710f... scaled images down to max width of 1920 pixels)
warning: Cannot merge binary files: msd/webshop/static/webshop/img/common/connor-betts-QK6Iwzd5MhE-unsplash.jpg (HEAD vs. a90710f... scaled images down to max width of 1920 pixels)
warning: Cannot merge binary files: msd/webshop/static/webshop/img/common/alexandre-debieve-FO7JIlwjOtU-unsplash.jpg (HEAD vs. a90710f... scaled images down to max width of 1920 pixels)
warning: Cannot merge binary files: msd/webshop/static/webshop/img/common/adi-goldstein-EUsVwEOsblE-unsplash.jpg (HEAD vs. a90710f... scaled images down to max width of 1920 pixels)
Auto-merging msd/webshop/static/webshop/img/common/yogesh-phuyal-mjwGKmwkDDA-unsplash.jpg
CONFLICT (content): Merge conflict in msd/webshop/static/webshop/img/common/yogesh-phuyal-mjwGKmwkDDA-unsplash.jpg
Auto-merging msd/webshop/static/webshop/img/common/umberto-jXd2FSvcRr8-unsplash.jpg
CONFLICT (content): Merge conflict in msd/webshop/static/webshop/img/common/umberto-jXd2FSvcRr8-unsplash.jpg
Auto-merging msd/webshop/static/webshop/img/common/max-duzij-qAjJk-un3BI-unsplash.jpg
CONFLICT (content): Merge conflict in msd/webshop/static/webshop/img/common/max-duzij-qAjJk-un3BI-unsplash.jpg
Auto-merging msd/webshop/static/webshop/img/common/levi-saunders-1nz-KjRdg-s-unsplash.jpg
CONFLICT (content): Merge conflict in msd/webshop/static/webshop/img/common/levi-saunders-1nz-KjRdg-s-unsplash.jpg
Auto-merging msd/webshop/static/webshop/img/common/kevin-ku-w7ZyuGYNpRQ-unsplash.jpg
CONFLICT (content): Merge conflict in msd/webshop/static/webshop/img/common/kevin-ku-w7ZyuGYNpRQ-unsplash.jpg
Auto-merging msd/webshop/static/webshop/img/common/connor-betts-QK6Iwzd5MhE-unsplash.jpg
CONFLICT (content): Merge conflict in msd/webshop/static/webshop/img/common/connor-betts-QK6Iwzd5MhE-unsplash.jpg
Auto-merging msd/webshop/static/webshop/img/common/alexandre-debieve-FO7JIlwjOtU-unsplash.jpg
CONFLICT (content): Merge conflict in msd/webshop/static/webshop/img/common/alexandre-debieve-FO7JIlwjOtU-unsplash.jpg
Auto-merging msd/webshop/static/webshop/img/common/adi-goldstein-EUsVwEOsblE-unsplash.jpg
CONFLICT (content): Merge conflict in msd/webshop/static/webshop/img/common/adi-goldstein-EUsVwEOsblE-unsplash.jpg
error: could not apply a90710f... scaled images down to max width of 1920 pixels
Resolve all conflicts manually, mark them as resolved with
"git add/rm <conflicted_files>", then run "git rebase --continue".
You can instead skip this commit: run "git rebase --skip".
To abort and get back to the state before "git rebase", run "git rebase --abort".
Could not apply a90710f... scaled images down to max width of 1920 pixels

The trick to fixing this is to notice which commit it's trying to let you edit, which is in the last line of that message, and then checkout that version of each of the unmerged binary files it mentions, like so:

git status # to get the names of the unmerged binary files
git checkout a90710f <filenames>

Now you can do the same thing you did for the deleted file:

git restore --staged <filenames>
git add <filenames>
git diff --stat --staged # just to double check there are no Bin files now
git rebase --continue

Moved binary files

When I ran git log --follow to find all the commits that modified binary files, it flagged one where I had moved them. I'm not sure I actually had to edit that commit and I wonder if I would not have had this weird situation if I had not edited it. But for completeness, here's what I saw. Git rebase stopped to let me edit the commit and git annex printed out this message for every file that was moved:

git-annex: git status will show <filename> to be modified, since content availability has changed and git-annex was unable to update the index. This is only a cosmetic problem affecting git status; git add, git commit, etc won't be affected. To fix the git status display, you can run: git update-index -q --refresh <filename>

Sounds…quite weird. But git rebase would not continue until I did run the suggested command:

git update-index -q --refresh <filenames>
git rebase --continue

Dealing with Tags

Once the rebase was done I noticed that the tags I had all still pointed to the original commits. Oops. A quick internet search led me to this post about rebasing and moving tags to the new commits (written by a former co-worker, it just so happens). Too bad I didn't look for that before I rebased. I thought about redoing the whole rebase, but in the end I just wrote my own quick python script (using snippets from Nacho's) to take care of my specific situation. Here it is:

#! /usr/bin/env python
from subprocess import run, PIPE

tags = run(['git', 'show-ref', '--tags'],
           stdout=PIPE).stdout.decode('utf-8').splitlines()

tags_with_comments = {}
for tag in tags:
    tag_hash, tag_name = tag.split(' ')
    tag_name = tag_name.split('/')[-1]
    comment = run(['git', '--no-pager', 'show', '-s',
                   '--format=%s', tag_hash],
                  stdout=PIPE).stdout.decode('utf-8').splitlines()[-1]
    print(f'{tag_name}: {comment}')
    tags_with_comments[tag_name] = comment

commits = run(['git', 'log', '--oneline'],
              stdout=PIPE).stdout.decode('utf-8').splitlines()

for tag_name in tags_with_comments:
    for c in commits:
        commit_hash = c.split(' ')[0]
        comment = c.split(' ')[1:]
        comment = ' '.join(comment)
        if comment == tags_with_comments[tag_name]:
            run(['git', 'tag', '--force', tag_name, commit_hash])

Clean Up and Results

Well, with all that done, it was time to see how it all turned out. My original git repo was sitting at about 1.4 GB. This new repo was…3 GB!? Something wasn't right. Here are some steps I took to clean it up after making sure there weren't any old branches or remotes laying around:

git clean -fdx
git annex fsck
git fsck
git reflog expire --verbose --expire=0 --all
git gc --prune=0

The git clean command showed that I had a weird leftover .git directory in another directory somehow, so I deleted that. I don't think the fsck commands really did anything, but the gc definitely did. Size was now down to 985 MB. Much better. Wait a minute, what if I did a git gc on the original repo? It's size went down to 984 MB. Oh shoot. I guess it makes sense though, if both git and git annex are storing full versions of each binary file they would end up the same size. The real win is the faster git operations, especially clones.

A local git clone now happens in the blink of an eye, and its size is only 153 MB. Now, that's a little unfair because it doesn't have any of the binary files. After a git annex get to get the binary files for the current checkout it goes up to 943 MB. Not a huge savings, but it only gets better as time goes on and more edits happen. Right? This was all worth it, wasn't it?!

Let me know in the comments if this is helpful, hurtful, or if I did this totally wrong.

27 Mar 22:49

Mike Zamansky: Using Emacs 70 Org Protocol

by Mike Zamansky
Tom Roche

> We can use org-protocol to link between a browser and Emacs.

note also he's moved his blog to a themed github.io

I spent part of today cleaning up my Emacs workflow. Specifically, how I capture emails and links into org-mode I already wrote about how I used org-capture (here and here). It's pretty clean and easy but there was one thing that always nagged at me. When I capture from mu4e within Emacs by hitting C-c m it's set up to automatically populate the capture template with a link to the email labelled with the email's subject.
27 Mar 02:05

The Untold Story Of Saudi Crown Prince MBS

Tom Roche

manages to almost completely miss major issues like Yemen war and Israeli alliance, and completely ignore huge issues like Saudi poverty and questionable oil reserves

'New York Times' Beirut Bureau Chief Ben Hubbard says Saudi Arabia's Crown Prince Mohammed bin Salman is full of contradictions: He ended a ban on women driving, but his agents also carried out the murder of journalist Jamal Khashoggi. Hubbard's book, 'MBS,' tells the story of the enigmatic leader. Hubbard says MBS could rule the country for the next 50 years.

Also, Maureen Corrigan reviews 'Writers & Lovers' by Lily King.
27 Mar 02:03

The Case For Abolishing The Electoral College

Tom Roche

correct position, though all-too-{NPR, NYT}-y

Jesse Wegman, author of 'Let the People Pick the President,' says the Electoral College's winner-take-all rule is not mandated by the Constitution: "There's nothing keeping us from changing it." Wegman talks about how winner-take-all came to be, attempts to change it, and how the Electoral College disproportionately affects people of color.