Jump to content

User:Tim Landscheidt

From Wikitech

#REDIRECTw:de:Benutzer:Tim.landscheidt
This page is a soft redirect.


Emacs TRAMP configuration for Tools

'(tramp-default-proxies-alist
   (quote
    (("\\.\\(\\(eqiad\\|pmtpa\\).wmflabs\\|wmflabs\\.org\\)\\'" "\\`\\(mwvagrant\\|root\\|tools\\(beta\\)?\\..*\\)\\'" "/ssh:%h:"))))

/sudo:tools.checkwiki@tools-login.wmflabs.org:.bashrc will connect to tools-login.wmflabs.org (with account chosen by ~/.ssh/config) and then sudo to tools.checkwiki.

gerrit-done

#!/bin/bash

if [ $# != 1 ]; then
    echo Usage: $0 BRANCH
    exit 1
fi

changeidline="$(git show -s --format=%B "$1" | grep '^Change-Id: ')"

if ! masterbranch="$(git config -f "$(git rev-parse --show-cdup).gitreview" --get gerrit.defaultbranch)"; then
    masterbranch=master
fi

mergedsha1="$(git log --format=format:%H --grep "^$changeidline\$" "$masterbranch")"

diff -u <(git log -p "$masterbranch".."$1") <(git show "$mergedsha1")
read -p "Delete branch $1? "
if [ "$REPLY" = y ]; then
    git branch -D "$1"
fi

git-rebase-all

#!/bin/sh

git update

if ! masterbranch="$(git config -f "$(git rev-parse --show-cdup).gitreview" --get gerrit.defaultbranch)"; then
    masterbranch=master
fi

# Set colour sequences.
if git config --get-colorbool color.rebase-all; then
    git_color_merged_branches="$(git config --get-color color.rebase-all.merged-branches "green")"
    git_color_failed_rebases="$(git config --get-color color.rebase-all.failed-rebases "red")"
    git_color_reset="$(git config --get-color '' "reset")"
fi

failed_rebases=
eval "$(git for-each-ref --format 'tmpout="$(mktemp)"
if [ %(refname:short) != $masterbranch ] && ! git rebase $masterbranch %(refname:short) > "$tmpout" 2>&1; then
    cat "$tmpout"
    git rebase --abort
    failed_rebases="${failed_rebases}"${git_color_failed_rebases}%(refname:short)"${git_color_reset}
"
elif [ "x$1" = "x-v" ]; then
    cat "$tmpout"
fi
rm -f "$tmpout"
' --shell refs/heads)"

git checkout -q $masterbranch

if [ -n "$failed_rebases" ]; then
    echo
    echo 'Failed rebases for branches:'
    echo -n "$failed_rebases"
fi

if [ -n "$(git branch --merged | sed -ne 's/^  //p;')" ]; then
    echo
    echo "Branches merged in $masterbranch:"
    git branch --merged | sed -ne "s/^  \(.*\)\$/${git_color_merged_branches}\\1${git_color_reset}/p;"
fi

git-rebase-and-gerrit

#!/bin/sh

set -e

if [ $# -ne 1 ]; then
    echo "Usage: $0 BRANCH"
    exit 1
fi

if ! masterbranch="$(git config -f "$(git rev-parse --show-cdup).gitreview" --get gerrit.defaultbranch)"; then
    masterbranch=master
fi

git update
git rebase "$masterbranch" "$1"
git log --format=%B "$masterbranch..$1" | sed -ne 's/^Change-Id: \(.*\)$/https:\/\/gerrit.wikimedia.org\/r\/r\/\1/p;' | xargs -r firefox

git-update

#!/bin/sh

set -e

if [ $# != 0 ]; then
    echo Usage: $0
    exit 1
fi

if ! masterbranch="$(git config -f "$(git rev-parse --show-cdup).gitreview" --get gerrit.defaultbranch)"; then
    masterbranch=master
fi

git checkout "$masterbranch"
oldhead="$(git rev-parse HEAD)"
git pull

if [ "$(git rev-parse HEAD)" != "$oldhead" ]; then
    git submodule update --
    if [ "x$(git config -f "$(git rev-parse --show-cdup).gitreview" --get gerrit.project)" = "xoperations/puppet.git" ]; then
        GIT_PAGER='less -ip dynamicproxy\|grid\|lab\|landscheidt\|tool' git log -p "$oldhead"..
    else
        git log -p "$oldhead"..
    fi
fi