This file contains hidden or 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
#!/bin/bash | |
# Call it with incremental_patches.sh patch1 patch2 patch3 | |
# It will modify each patch so that it first applies all the previous | |
# ones, then the patch itself | |
LAST= | |
for i in "$@" ; do | |
echo $i $LAST | |
if [ "x$LAST" != "x" ] ; then |
This file contains hidden or 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
# See docs in http://git-annex.branchable.com/internals/hashing/ and implementation in http://sources.debian.net/src/git-annex/5.20140227/Locations.hs/?hl=408#L408 | |
import hashlib | |
import struct | |
def hashdirlower(key): | |
hasher = hashlib.md5() | |
hasher.update(key) | |
digest = hasher.hexdigest() | |
return "%s/%s/" % (digest[:3], digest[3:6]) |