This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -urN htop-1.0.3-orig/CRT.c htop-1.0.3/CRT.c | |
--- htop-1.0.3-orig/CRT.c 2014-11-04 14:10:29.500604247 +0100 | |
+++ htop-1.0.3/CRT.c 2014-11-04 14:11:01.916663508 +0100 | |
@@ -60,6 +60,9 @@ | |
UPTIME, | |
BATTERY, | |
TASKS_RUNNING, | |
+ TEMPERATURE_COOL, | |
+ TEMPERATURE_MEDIUM, | |
+ TEMPERATURE_HOT, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Upgraded a dependency in a Git repository to an incompatible version but due to insufficient testing didn't notice until several commits later. I *could* have just done a simple revert but was bored and figured out how to wipe it from history completely (usual disclaimer, rewriting history in a repository you have shared with anybody else is not a nice idea). | |
To fix it: | |
* Put a copy of the original folder (i.e., the one you actually want) in a separate location. | |
* Run the command in the script file below. This runs through each commit (so it could be very slow for a large repo), and checks if the new folder is present. If so, it deletes it and copies in the original. The tree-filter takes care of the Git add & rm commands as needed. The --prune-empty argument tells it to get rid of any empty commits (i.e., the one you committed the change in). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import fcntl | |
import os | |
import struct | |
import sys | |
import termios | |
def window_size(fd): | |
"""Try to get the size of a terminal window. | |
:param fd: The file descriptor of the terminal window. |