Sunday, January 24, 2016

Cleanup Merged Github Branches

For big projects with multiple contributors where nobody is really cracking the whip on Github maintenance, there is a tendency for the branch count to just keep climbing.  I have seen cases where it tops 100 branches, and it becomes quite painful to clean up.  In cases like that, I have developed the following method for handling it:

First, you need local copies of all the remote branches.  This is not as easy as just doing a fetch origin, as that just pulls over an underlying awareness of the fact that the branches exist.  You do not actually create local copies of all those branches.

So we run the following command:

for remote in `git branch -r`; do git branch --track ${remote#origin/} $remote; done

This creates local copies of all the branches including one called HEAD, which is not a real branch and is dangerous.  So let’s get rid of that by renaming it  to something else and then deleting it.

git branch -m HEAD bogusBranch
git branch –D bogusBranch

We now want to delete all the branches that are already merged.  We can get a list of them by running:

git branch --merged master | grep -v master

If we like the list, we now delete them from the origin:

git branch --merged master | grep -v master |  xargs -n 1 git push --delete origin

And we now delete the same list locally:

git branch --merged master | grep -v master |  xargs -n 1 git branch -D 

And we have now cleaned up our repository by removing everything that has already been merged to master. 

If something is not on the merged list, and we want to know what changes are not merged, we get a list of un-merged commits from that branch:

git cherry -v master <unmergedBranchName>

Now we checkout that local branch:

git checkout unmergedBranchName

And we do a whatchanged to see what the difference is:

git whatchanged -m -n 1 -p <SHA of target commit>


Samsung LNT5271F Horizontal Line Issue

This is a blog about a failed attempt to fix a Samsung LNT5271F 52-inch LCD TV.  It developed problems with horizontal lines on the screen.  If the TV warms up sufficiently (about half an hour), it goes away.  The lines look like this:

I swapped the electrolytic caps on the power board because people in various forums were saying that was a potential solution.  I was not feeling good about that.  It seems tantamount to sacrificing a chicken over it, but it is cheap, so I gave it a shot first.  It did nothing.

I then swapped the T-Con board which set me back about $100.  I ordered it from:

There are many places that have the board cheaper—some of them much cheaper, but they were all out of stock.

I have since heard that horizontal lines are almost never caused by the T-Con board.  But I did not become aware of that until I had already ordered the part.  It is a bit of a delicate operation to swap it because of the LCD panel connectors, and because it is not at all obvious how those connectors work.  But at the end of the day, I was able to do it without issue.  Unfortunately, it had no effect on the problem.  The horizontal lines remain, and they still go away after half an hour.

The TCON board LCD connectors look like:

They open by folding them downwards.  In the picture, the right one is open.  Notice also the black horizontal line on the connector, which just lines up with where the top of that connector is going to be once we close it.  You should not be able to see any of that black line if the connector is securely fastened against a properly positioned wire.

I think the issue is likely the LCD controller, and it’s just come to the point that it is a better bet to just buy a new television.  I’ll suffer with the thirty minutes of horizontal lines for now until OLED come up to the point where the OLED TVs are better priced.  In the meantime, I have another 32” LCD TV next to the bigger one I use for gaming.  I have a dual 4-port HDMI switch attached to both TV’s, so it is a small matter to route the cable box to the smaller TV if it is really critical.

So the point of this blog is if you have a problem similar to what I am showing in the above photo, you are probably better off just giving up on the TV rather than wasting $150 and a good bit of time tearing down and reassembling this TV a couple times over.