diff options
| author | Carlos Maiolino <[email protected]> | 2026-05-02 14:09:27 +0200 |
|---|---|---|
| committer | Carlos Maiolino <[email protected]> | 2026-05-02 14:09:27 +0200 |
| commit | 296c6b9ee85209c0ce375717e30686545baea107 (patch) | |
| tree | f0da71650e8f58ca528589ad4e39476732fa5b88 | |
| parent | b2e1a1cb259e482720430ff9898d2e564ee73d0f (diff) | |
24 files changed, 866 insertions, 16 deletions
diff --git a/DEPRECATED b/DEPRECATED new file mode 100644 index 0000000..cb258db --- /dev/null +++ b/DEPRECATED @@ -0,0 +1 @@ +move it to workstation.git @@ -0,0 +1 @@ +Scripts for several purposes diff --git a/bin/fetch_mail.sh b/bin/fetch_mail.sh new file mode 100755 index 0000000..2f10567 --- /dev/null +++ b/bin/fetch_mail.sh @@ -0,0 +1,16 @@ +#!/bin/bash +set -x +MAIL_DIR=/home/cem/Mail + +sync_toxic() { + local TOXIC_MAIL=$MAIL_DIR/toxiclabs + local TOXIC_NOTMUCH_CONFIG=$TOXIC_MAIL/notmuch-config + local TOXIC_MBSYNC_CONFIG=$TOXIC_MAIL/mbsyncrc + local TOXIC_NM_TAGS=$TOXIC_MAIL/tags.conf + + mbsync --config=$TOXIC_MBSYNC_CONFIG -q -a toxiclabs + notmuch --config=$TOXIC_NOTMUCH_CONFIG new + notmuch --config=$TOXIC_NOTMUCH_CONFIG tag --input=$TOXIC_NM_TAGS +} + +sync_toxic diff --git a/bin/korgmail b/bin/korgmail index 3741930..d045804 100755 --- a/bin/korgmail +++ b/bin/korgmail @@ -1,5 +1,5 @@ #!/bin/bash -MAIL_DIR=/home/cmaiolino/Mail/kernel +MAIL_DIR=/home/cmaiolino/Mail/Kernel export NOTMUCH_CONFIG=$MAIL_DIR/notmuch-config -neomutt -F ~/.mutt/muttrc-kernel +neomutt -F ~/.mutt/muttrc-Kernel @@ -1,7 +1,7 @@ #!/bin/bash MUTT=`which neomutt` -MUTTRC="~/.mutt/muttrc-local" +MUTTRC="~/.mutt/muttrc-redhat" $MUTT -F $MUTTRC diff --git a/bin/sync_mail.sh b/bin/sync_mail.sh index b718b9a..2bf04c5 100755 --- a/bin/sync_mail.sh +++ b/bin/sync_mail.sh @@ -2,9 +2,22 @@ MBSYNC=`which mbsync` NOTMUCH=`which notmuch` -MUTT_DIR=/home/cmaiolino/.mutt -MAIL_DIR=/home/cmaiolino/Mail +MUTT_DIR=/home/cem/.mutt +MAIL_DIR=/home/cem/Mail +sync_toxic() { + local TOXIC_MAIL=$MAIL_DIR/toxiclabs + local MBSYNC_CONFIG=$TOXIC_MAIL/mbsyncrc + local NOTMUCH_TAGS=$TOXIC_MAIL/toxic_nmtag.conf + local TOXIC_MUTTRC=$MUTT_DIR/muttrc-toxiclabs + local TOXIC_NM_CONFIG=$TOXIC_MAIL/notmuch-config + local TOXIC_NM_TAGS=$TOXIC_MAIL/toxic_nmtag.conf + + mbsync --config=$MBSYNC_CONFIG -a -q + + notmuch --config=$KORG_NM_CONFIG new + notmuch --config=$KORG_NM_CONFIG tag --input=$KORG_NM_TAGS +} sync_redhat() { local RH_MAIL=$MAIL_DIR/redhat local MBSYNC_CONFIG=$RH_MAIL/mbsyncrc @@ -14,7 +27,7 @@ sync_redhat() { } sync_korg() { - local KORG_MAIL=$MAIL_DIR/kernel + local KORG_MAIL=$MAIL_DIR/Kernel local MBSYNC_CONFIG=$KORG_MAIL/mbsyncrc local NOTMUCH_TAGS=$KORG_MAIL/kernel_nmtag.conf local KORG_MUTTRC=$MUTT_DIR/muttrc-kernel @@ -29,3 +42,4 @@ sync_korg() { sync_redhat sync_korg +sync_toxic diff --git a/bin/toxicmail b/bin/toxicmail new file mode 100755 index 0000000..00189b4 --- /dev/null +++ b/bin/toxicmail @@ -0,0 +1,5 @@ +#!/bin/bash + +#MAIL_DIR=/home/cmaiolino/Mail/toxiclabs +#export NOTMUCH_CONFIG=$MAIL_DIR/notmuch-config +neomutt -F ~/.mutt/muttrc-toxiclabs diff --git a/bin/work_setup.sh b/bin/work_setup.sh index d54e777..15f50e9 100755 --- a/bin/work_setup.sh +++ b/bin/work_setup.sh @@ -1,9 +1,20 @@ #!/bin/bash -tmux new-session -s "WORKSPACE" -d -n "WORKSPACE" 'rhmail' -tmux split-window -t WORKSPACE -v 'ikhal' -tmux split-window -t WORKSPACE -h -tmux split-window -t WORKSPACE -h 'weechat' +tmux new-session -s "WORKSPACE" -d -n "WORKDSPACE" 'ikhal' tmux split-window -t WORKSPACE -v -tmux select-layout -t WORKSPACE "77ad,343x61,0,0{156x61,0,0,4,186x61,157,0[186x30,157,0{93x30,157,0,6,92x30,251,0,9},186x30,157,31{93x30,157,31,8,92x30,251,31,10}]}" +tmux select-pane -t 1 +tmux split-window -t WORKSPACE -h 'emacs ~/Nextcloud/ORG/GTD.org' +tmux select-pane -t 3 +tmux split-window -t WORKSPACE -h 'weechat' +tmux select-layout -t WORKSPACE "4432,223x61,0,0{111x61,0,0[111x30,0,0,0,111x30,0,31,6],111x61,112,0[111x30,112,0,4,111x30,112,31,5]}" +tmux select-pane -t 1 'ikhal' +#tmux split-window -t WORKSPACE -h -n "IRC" +#tmux select-window -t "CALENDAR" +#tmux split-window -t WORKSPACE -n "TODO" -v 'emacs ~/Nextcloud/ORG/GTD.org' +#tmux select-window -t "IRC" +#tmux split-window -t WORKSPACE -h 'vim ~/Nextcloud/vimwiki/index.wiki' +#tmux split-window -t WORKSPACE -v 'weechat' +#tmux select-layout -t WORKSPACE "5e76,343x64,0,0{171x64,0,0,0,171x64,172,0,1}" +#tmux select-layout -t WORKSPACE "a201,343x63,0,0{171x63,0,0,13,171x63,172,0[171x31,172,0,14,171x31,172,32{85x31,172,32,15,85x31,258,32,16}]}" +#tmux select-layout -t WORKSPACE "77ad,343x61,0,0{156x61,0,0,4,186x61,157,0[186x30,157,0{93x30,157,0,6,92x30,251,0,9},186x30,157,31{93x30,157,31,8,92x30,251,31,10}]}" tmux attach diff --git a/git-announce.tar.gz b/git-announce.tar.gz Binary files differnew file mode 100644 index 0000000..8abd2b5 --- /dev/null +++ b/git-announce.tar.gz diff --git a/git_contributors.py b/git_contributors.py new file mode 100644 index 0000000..91a7f6a --- /dev/null +++ b/git_contributors.py @@ -0,0 +1,68 @@ +#!/usr/bin/python3 + +# List all contributors to a series of git commits. +# Copyright(C) 2022 Darrick J. Wong, All Rights Reserved. +# Licensed under GPL 2.0 or later + +import re +import subprocess +import io +import sys +import argparse + +DEBUG = False + +def backtick(args): + '''Generator function that yields lines of a program's stdout.''' + if DEBUG: + print(' '.join(args)) + p = subprocess.Popen(args, stdout = subprocess.PIPE) + for line in io.TextIOWrapper(p.stdout, encoding="utf-8"): + yield line.strip() + +def get_developers(revspec): + """Return the address list generated from signed-off-by and + acked-by lines in the message. + """ + addr_list = ['[email protected]', '[email protected]'] + tags = '%s|%s|%s|%s|%s|%s|%s|%s' % ( + 'signed-off-by', + 'acked-by', + 'cc', + 'reviewed-by', + 'reported-by', + 'tested-by', + 'suggested-by', + 'reported-and-tested-by') + regex1 = r'^(%s):\s+(.+)$' % tags + regex2 = r'^(%s):\s+.+<(.+)>$' % tags + + r1 = re.compile(regex1, re.I) + r2 = re.compile(regex2, re.I) + + for output in backtick(['git', 'log', '--pretty=medium', revspec]): + m = r2.match(output) + if m: + addr_list.append(m.expand(r'\g<2>')) + continue + m = r1.match(output) + if m: + addr_list.append(m.expand(r'\g<2>')) + + return set(addr_list) + +def main(): + parser = argparse.ArgumentParser(description = "List email addresses of contributors to a series of git commits.") + parser.add_argument("revisions", nargs = 1, \ + help = "git revisions to process.") + parser.add_argument("--delimiter", type = str, default = '\n', \ + help = "Separate each email address with this string.") + args = parser.parse_args() + + contributors = get_developers(args.revisions[0]) + + print(args.delimiter.join(sorted(contributors))) + return 0 + +if __name__ == '__main__': + sys.exit(main()) diff --git a/maintainer/mutt-hooks/b4-shazam.sh b/maintainer/mutt-hooks/b4-shazam.sh index 4920658..478a276 100755 --- a/maintainer/mutt-hooks/b4-shazam.sh +++ b/maintainer/mutt-hooks/b4-shazam.sh @@ -1,6 +1,6 @@ #!/bin/bash -REPO_DIR=/home/cem/Source/MAINTAINER/xfs-linux +REPO_DIR=/home/cem/Source/MAINTAINER/$1 FORMAIL=$(which formail) B4=$(which b4) @@ -11,6 +11,10 @@ _die() { check_env() { + if [ -z $1 ]; then + _die "You must specify a branch" + fi + if [ ! -d $REPO_DIR ]; then _die "Linux repo does not exist" fi @@ -41,7 +45,7 @@ shazam_message() { echo "Message/Series $MSG_ID applied" } -check_env +check_env $1 MSG="" diff --git a/maintainer/pr-create.sh b/maintainer/pr-create.sh index 62721b0..36387b7 100755 --- a/maintainer/pr-create.sh +++ b/maintainer/pr-create.sh @@ -21,7 +21,7 @@ SUBJECT="" # Email tool NEOMUTT=$(which neomutt) -MUTT_CONFIG="$HOME/.mutt/muttrc-Kernel" +MUTT_CONFIG="$HOME/.mutt/muttrc-kernel" #temp files PULL_FILE=$(mktemp) @@ -116,11 +116,11 @@ TYPE=$(echo $TAG | sed 's/xfs-//' | awk '{split($0, a, "-"); print a[1]}') VER=$(echo $TAG | sed 's/xfs-//' | awk '{split($0, a, "-"); print a[2]}') RC=$(echo $TAG | sed 's/xfs-//' | awk '{split($0, a, "-"); print a[3]}') -if [ $TYPE = "merge" ] && [ $RC ]; then +if [ "$TYPE" = "merge" ] && [ "$RC" ]; then _die "Can't have a -RC tag with a merge tag" fi -if [ $TYPE = "fixes" ] && [ -z $RC ]; then +if [ "$TYPE" = "fixes" ] && [ -z "$RC" ]; then _die "A Fixes tag requires a -RC version" fi diff --git a/maintainer_old/checkpatch.awk b/maintainer_old/checkpatch.awk new file mode 100755 index 0000000..fd363e3 --- /dev/null +++ b/maintainer_old/checkpatch.awk @@ -0,0 +1,251 @@ +#!/usr/bin/awk + +# Scan a patch for correctness, according to XFS/iomap rules. +# +# Pass the commit id as the variable "commit_id" and the git log --oneline +# output as "oneline" for report generation. + +function getval(key) { + realkey = sprintf("%s: ", key) + keylen = length(realkey) + + if (substr($0, 0, keylen) != realkey) + return 0 + return substr($0, keylen + 1) +} + +function is_me(val, my_signature, dead_signature) +{ + if (val == my_signature) + return 1 + if (dead_signature != 0 && val == dead_signature) + return 1 + return 0 +} + +function commit_error(why) +{ + if (!commit_errored) + printf("%s\n", oneline) > "/dev/stderr" + + printf(" - %s\n", why) > "/dev/stderr" + commit_errored = 1 +} + +function commit_error_end(why) +{ + if (commit_errored) + printf("\n") > "/dev/stderr" +} + +function prog_error(why) +{ + printf("%s: %s\n", commit_id, why) > "/dev/stderr" +} + +BEGIN { + ret = 0 + commit_errored = 0 + + if (length(commit_id) == 0) { + printf("Commit id not supplied.") > "/dev/stderr" + ret = 2 + exit + } + + if (length(oneline) == 0) { + prog_error("Commit oneline not supplied.") + ret = 2 + exit + } + + if (("git config user.name" | getline name) < 0) { + prog_error("%s: Can't get git user.name.") + ret = 2 + exit + } + + if (("git config user.email" | getline email) < 0) { + prog_error("%s: Can't get git user.email.") + ret = 2 + exit + } + + if (("git config core.abbrev" | getline abbrev_len) < 0) { + prog_error("%s: Can't get git core.abbrev.") + ret = 2 + exit + } + + if (abbrev_len <= 0) + abbrev_len = 12 + + ("git config user.deadname" | getline dead_name) + ("git config user.deademail" | getline dead_email) + + if (length(dead_name) > 0 && length(dead_email) == 0) { + dead_email = email + } + if (length(dead_email) > 0 && length(dead_name) == 0) { + dead_name = name + } + + if (("git config --type bool user.devtree" | getline dev_tree) < 0) { + dev_tree = "false" + } + dev_tree = (dev_tree == "true") + + my_signature = sprintf("%s <%s>", name, email) + if (length(dead_email) > 0) + dead_signature = sprintf("%s <%s>", dead_name, dead_email) + else + dead_signature = 0; + you_are_author = 0 + has_other_review = 0 + has_self_review = 0 + has_self_signoff = 0 + has_committer_signoff = 0 + bad_commit = 0 + in_header = 1 + in_body = 0 + subject = 0 + committer_signature = 0 + committer_name = 0 + author_signature = 0 + author_name = 0 + merge = 0 +} + +{ + # Trim leading and trailing whitespace so that we can pick up tags that + # are in the commit message. + gsub(/^[[:space:]]+|[[:space:]]+$/, "", $0) + + if (debug) + printf(":%s:%s:%s:\n", in_header, $1, $0) + + if (in_header && $0 == "") { + in_header = 0 + in_body = 1 + } else if (in_body && subject == 0) { + # Pick up the subject line for error reporting + subject = $0 + if (debug) + printf("subj:%s:%s:\n", $0, subject) + } else if ((val = getval("Merge")) != 0) { + # We don't process merge commits + merge = 1 + if (debug) + printf("Merge:%s:%s:\n", $0, val); + nextfile + } else if ((val = getval("Author")) != 0) { + # Pick up the author header + author_signature = val + author_name = gensub(/^[[:space:]]*(.+) <.*$/, "\\1", "g", + author_signature); + if (debug) + printf("author:%s:%s:\n", val, author_signature); + if (is_me(val, my_signature, dead_signature)) + you_are_author = 1 + } else if ((val = getval("Commit")) != 0) { + # Pick up the committer header + committer_signature = val; + committer_name = gensub(/^[[:space:]]*(.+) <.*$/, "\\1", "g", + committer_signature); + if (debug) + printf("committer:%s:%s:\n", val, committer_name); + } else if ((val = getval("Signed-off-by")) != 0) { + # Pick up signoffs + sob_name = gensub(/^[[:space:]]*(.+) <.*$/, "\\1", "g", val); + if (is_me(val, my_signature, dead_signature)) + has_self_signoff = 1 + if (val == author_signature || sob_name == author_name) + has_author_signoff = 1 + if (val == committer_signature || sob_name == committer_name) + has_committer_signoff = 1 + } else if ((val = getval("Reviewed-by")) != 0) { + # Pick up reviews + if (is_me(val, my_signature, dead_signature)) + has_self_review = 1 + else + has_other_review = 1 + } else if ((val = getval("Fixes")) != 0) { + # Fixes tags must be of a certain length and exist in the git + # history. + split(val, cols) + fixes_id = cols[1] + if (debug) + printf("fixes:%s:\n", fixes_id) + if (length(fixes_id) < abbrev_len) { + msg = sprintf("Fixes tag commit \"%s\" needs to be longer.", fixes_id) + commit_error(msg) + bad_commit = 1 + } + + cmd = sprintf("git log -n 1 \"%s\" >/dev/null 2>&1", fixes_id) + if (system(cmd) != 0) { + msg = sprintf("Fixes tag commit \"%s\" does not exist.", fixes_id) + commit_error(msg) + bad_commit = 1 + } + } else if ($0 ~ /scanned for virus detection/) { + commit_error("Email virus scanner garbage in commit message.") + bad_commit = 1 + } +} +END { + if (ret != 0 || merge != 0) + exit ret + + if (subject == 0) { + commit_error("Patch subject not found.") + ret = 1 + } + + if (bad_commit) + ret = 1 + + if (you_are_author) { + # If you wrote the patch, you must have your own signoff and a + # review by someone else (if this isn't your development tree). + # You can't review your own patches. + if (!has_self_signoff) { + commit_error("Your patch needs your signoff.") + ret = 1 + } + if (!has_other_review && !dev_tree) { + commit_error("Your patch needs review by someone else.") + ret = 1 + } + if (has_self_review) { + commit_error("You cannot review your own patch.") + ret = 1 + } + } else { + # If you did not write the patch, it must have a signoff from + # the author, a review by you, and a signoff by you unless the + # author is the committer. + if (!has_author_signoff) { + commit_error("Patch needs to be signed off by the author.") + ret = 1 + } + if (!has_self_review) { + commit_error("Patch needs your review.") + ret = 1 + } + if (!has_committer_signoff && !has_self_signoff) { + commit_error("Patch needs your (or the committer's) signoff.") + has_committer_signoff = 1 + ret = 1 + } + } + + # All commits must have a signoff from the committer. + if (!has_committer_signoff) { + commit_error("This patch needs to be signed off by the committer.") + ret = 1 + } + + commit_error_end() + exit ret +} diff --git a/maintainer_old/checkpatch/checkpatch.py b/maintainer_old/checkpatch/checkpatch.py new file mode 100755 index 0000000..d169872 --- /dev/null +++ b/maintainer_old/checkpatch/checkpatch.py @@ -0,0 +1,8 @@ +#!/usr/bin/python3 + +from pygit2 import * + +repo = Repository("./") +for commit in repo.walk(repo.head.target): + print(commit.committer) + input() diff --git a/maintainer_old/checkpatch/checkpatch.sh b/maintainer_old/checkpatch/checkpatch.sh new file mode 100755 index 0000000..e0eb6a4 --- /dev/null +++ b/maintainer_old/checkpatch/checkpatch.sh @@ -0,0 +1,52 @@ +#!/bin/bash + +check_fixes() { + local TAG=$(echo $1 | sed -e 's/^[ ]*//' | sed 's/^[F,f]ixes://') + local HASH=$(echo $TAG | awk '{print $1}') + + git log -1 --format='%s' $HASH &> /dev/null + + if [ $? -ne 0 ]; then + echo "Patch $HASH" + echo "$TAG" + echo "...does not exist" + exit 1 + fi + + local BROKEN_SUB=$(git log -1 --format='%s' $HASH) + + local SUB=$(echo $TAG | awk 'gsub($1, "")'| \ + sed -e 's/^[ ]*//' | \ + sed -e 's/^(//' | \ + sed -e 's/)$//' |\ + sed -e 's/^"//' | \ + sed -e 's/"$//') + + + if [ "$SUB" != "$BROKEN_SUB" ]; then + echo "Broken patch does not match Fixes tag:" + echo "PATCH: $HASH" + else + echo "Strings match" + fi + +} + +check_patch() { + local PATCH=$1 + local COMMIT_MSG=$(git log -1 $PATCH) + + local HAS_FIXES=`echo "$COMMIT_MSG" |grep -i fixes:` + + if [ -n "$HAS_FIXES" ]; then + check_fixes "$HAS_FIXES" + fi +} + +LAST=$1 + +PATCHES=$(for i in `git log --oneline --no-merges $LAST.. | awk '{print $1}'`; do echo $i; done) + +for i in $PATCHES; do + check_patch $i +done diff --git a/maintainer_old/djwong-git b/maintainer_old/djwong-git new file mode 100755 index 0000000..3f1d80c --- /dev/null +++ b/maintainer_old/djwong-git @@ -0,0 +1,41 @@ +#!/bin/bash + +# Support routines for git commands + +commit_range_from_arg() { + local arg="$1" + + if [ -z "${arg}" ]; then + # If we didn't get a commit range argument and this is a + # tracking branch, pick all the commits since this branch + # deviated. + base="$(git branch-remote 2>/dev/null)" + if [ -n "${base}" ]; then + echo "${base}..HEAD" + return 0 + fi + + return 1 + fi + + # If the argument already has a range in it, we're done. + if echo "${arg}" | grep -q '\.\.'; then + echo "${arg}" + return 0 + fi + + + # If the argument is a tracking branch, pick all the commits since that + # branch deviated. + base="$(git branch-remote "${arg}" 2>/dev/null)" + if [ -n "${base}" ]; then + echo "${base}..${arg}" + return 0 + fi + + # If we didn't get something that looks like a range, only select one + # commit because git rev-list run against a non-range lists everything + # from whatever it finds all the way back to the beginning. + echo "${arg}^1..${arg}" + return 0 +} diff --git a/maintainer_old/git-announce b/maintainer_old/git-announce new file mode 100755 index 0000000..65f3fb5 --- /dev/null +++ b/maintainer_old/git-announce @@ -0,0 +1,170 @@ +#!/bin/bash + +# Announce a git branch + +die() { + echo "$@" >> /dev/stderr + exit 1 +} + +helpme() { + die "Usage: $0 [oldref] [newref] [remote] [branch] [--force] [--cc] [--review] [--tag tag]" +} + +# Note: getopt requires -o '' or else it won't process positional arguments +# correctly! +TEMP=$(getopt -o '' --long 'cc,force,debug,review,tag:' -n "$0" -- "$@") +test $? -eq 0 || helpme + +eval set -- "$TEMP" +unset TEMP + +force=0 +debug=0 +cc= +verb="announce" +tags=() +while true; do + case "$1" in + '--force') force=1; shift; continue;; + '--debug') debug=1; shift; continue;; + '--cc') cc=1; shift; continue;; + '--review') verb="review"; shift; continue;; + '--tag') tags+=("$2"); shift; shift; continue;; + '--') shift; break;; + *) helpme;; + esac +done + +oldref="$1" +newref="$2" +remote="$3" +branch="$4" + +if [ -z "${oldref}" ]; then + oldref="$(git branch-remote)" || exit 1 +fi +true "${newref:=HEAD}" +true "${remote:=korg}" +true "${branch:=for-next}" + +code_submit_tgt="$(git config user.codeSubmissionTarget)" +test -n "${code_submit_tgt}" || \ + die "${PWD}: code submission target not configured." + +# Does the oldref exist? +git rev-list -n 0 "${oldref}" > /dev/null 2>&1 || \ + die "${oldref}: starting git reference not found." + +# Make sure there's a series of commits between oldref and newref. +nr_commits="$(git rev-list "${oldref}..${newref}" | wc -l)" +# echo "${oldref}..${newref}; nr_commits = $nr_commits" > /dev/stderr +test "${nr_commits}" -gt 0 || \ + die "${oldref}..${newref}: Must have at least one commit." + +# Figure out the short name and the url of the remote repo. +git ls-remote "${remote}" > /dev/null 2>&1 || die "${remote}: remote repo unknown." +repo="$(basename "$(git remote get-url "${remote}")" | sed -e 's/\.git//g')" +origin_url="$(git remote get-url "${remote}")" + +# Figure out the commit id for the newref (or the commit the tag points +# to, if it's a tag). +longid="$(git rev-list -n 1 "${newref}")" +shortid="$(git rev-parse --short "${longid}")" +test -n "${longid}" || die "${newref}: ending git reference not found." + +filter_commit() { + local commit_id="$1" + + sed -e 's@refs/heads/@@g' | \ + awk -v commit="${commit_id}" \ + 'BEGIN{ret=1;}{if ($1 == commit) {print $2; ret=0; exit;}}END{exit(ret);}' +} + +# Let's see if the default branch has the referenced commit? +branch="$(git ls-remote "${remote}" "refs/heads/${branch}" | \ + filter_commit "${longid}")" +# Nope. Let's see if any of them have it. +test -z "${branch}" && branch="$(git ls-remote --heads "${remote}" | \ + filter_commit "${longid}")" +test -n "${branch}" || die "${newref}: couldn't find a remote branch with this reference." + +# Check each commit for RVB and SOB. +git checkpatch "${oldref}..${newref}" +test $? -ne 0 && test "${force}" -eq 0 && exit 1 + +if [ -n "${cc}" ]; then + echo "Cc: $(git contributors --delimiter ', ' "${oldref}..${newref}")" +fi + +# Compute the ANNOUNCE tag contents. +announce="[ANNOUNCE" +for ((i = 0; i < ${#tags[@]}; i++)); do + announce="${announce} ${tags[i]}" +done +announce="${announce}]" + +# Ok, emit announcement message. +review_message() { + cat << ENDL +Subject: ${announce} ${repo}: ${branch} updated to ${shortid} + +Hi folks, + +The ${branch} branch of the ${repo} repository at: + + ${origin_url} + +has just been updated for your review. + +This code snapshot has been rebased against recent upstream, freshly +QA'd, and is ready for people to examine. For veteran readers, the new +snapshot can be diffed against the previous snapshot; and for new +readers, this is a reasonable place to begin reading. For the best +experience, it is recommended to pull this branch and walk the commits +instead of trying to read any patch deluge. + +The new head of the ${branch} branch is commit: + +ENDL +} + +announce_message() { + cat << ENDL +Subject: ${announce} ${repo}: ${branch} updated to ${shortid} + +Hi folks, + +The ${branch} branch of the ${repo} repository at: + + ${origin_url} + +has just been updated. + +Patches often get missed, so please check if your outstanding patches +were in this update. If they have not been in this update, please +resubmit them to ${code_submit_tgt} so they can be picked up in +the next update. + +The new head of the ${branch} branch is commit: + +ENDL +} + +"${verb}_message" + +git log --oneline -n 1 "${oldref}..${newref}" | cat - + +echo +if [ "${nr_commits}" -eq 1 ]; then + echo "${nr_commits} new commit:" +else + echo "${nr_commits} new commits:" +fi +echo + +git shortlog --format="[%h] %s" "${oldref}..${newref}" fs/xfs Documentation/ | cat - + +echo Code Diffstat: +echo +git diff --stat --summary -C -M "${oldref}..${newref}" fs/xfs Documentation/ | cat - diff --git a/maintainer_old/git-checkpatch b/maintainer_old/git-checkpatch new file mode 100755 index 0000000..0a34125 --- /dev/null +++ b/maintainer_old/git-checkpatch @@ -0,0 +1,36 @@ +#!/bin/bash + +ldir=/home/cmaiolino/Source/tools/maintainer +source $ldir/djwong-git + +# Run the checkpatch script on every commit in the list. + +if [ "$#" -gt 1 ] || [ "$1" = "--help" ]; then + echo "Usage: $0 <commit range>" 1>&2 + exit 1 +fi +commit_range="$(commit_range_from_arg "$1")" || exit 1 + +readarray -t commits < <(git rev-list --reverse --no-merges "${commit_range}") +if [ "${#commits[@]}" -eq 0 ]; then + echo 'No commits?' + exit 1 +fi + +debug=1 +test -n "${DBG}" && debug=1 +bad=0 +for commit_id in "${commits[@]}"; do + range="${commit_id}^1..${commit_id}" + oneline="$(git log --oneline "${range}")" + + # Dump commit in full format so we get committer + git log --format=full "${range}" | \ + awk -f "$ldir/checkpatch.awk" \ + -v "commit_id=${commit_id}" \ + -v "debug=${debug}" \ + -v "oneline=${oneline}" + test $? -eq 0 || bad=1 +done + +test "${bad}" -eq 0 diff --git a/maintainer_old/pr-create.sh b/maintainer_old/pr-create.sh new file mode 100755 index 0000000..948c441 --- /dev/null +++ b/maintainer_old/pr-create.sh @@ -0,0 +1,106 @@ +#!/bin/bash + +# pr-create: +# +# Create a Pull Request and send it to Linus Torvalds +# +# This script does: +# +# - Create a signed tag +# - push the branch and the tag to xfs-linux repository +# - Generate a list of patches in short-form +# - Craft a PR and email to Linus. +# + +REMOTE="xfs-linux" +BRANCH="$1" +TGT_BRANCH="linus/master" +TAG="$2" +TAG_MESSAGE="Signed-off-by: Carlos Maiolino <[email protected]>" +RECIPIENT="[email protected]" + +# Sending email global vars +usage() { + echo "usage: pr-create <branch> <tag>" +} + +die() { + echo "${1}... Exiting" + exit 1 +} + +git_verify_branch() { + local CUR_BRANCH=`git branch --show-current` + + if [ "${CUR_BRANCH}" != "${BRANCH}" ]; then + echo "Different branch is checked out..." + echo "... Attempting to checkout branch ${BRANCH}" + + git checkout -q ${BRANCH} 2> /dev/null + + if [ $? -ne 0 ]; then + return 1 + else + # Reset status to the old branch + git checkout -q ${CUR_BRANCH} 2> /dev/null + fi + fi +} + +git_create_tag() { + git tag -s ${TAG} -m "${TAG_MESSAGE}" +} + +push_branch() { + git push ${REMOTE} ${BRANCH}:${BRANCH} +} + +push_tag() { + git push ${REMOTE} ${TAG} +} + +git_craft_pr() { + local MSG=`git request-pull ${TGT_BRANCH} ${REMOTE} ${TAG}` + echo -e "$MSG" +} + +craft_message() { + + local MSG=$(git_craft_pr) + cat << ENDL +Hello Linus, + +Could you please pull patches included in the tag below? + +An attempt merge against your current TOT has been successful. + +Thanks, +Carlos + +${MSG} + +ENDL + +} + +generate_email() { + local MUTT_CONFIG="$HOME/.mutt/muttrc-Kernel" + neomutt -F ${MUTT_CONFIG} -s "$1" -i "$2" ${RECIPIENT} +} + +if [ -z "${BRANCH}" ] || [ -z "${TAG}" ]; then + usage +fi + +git_verify_branch + +if [ $? -ne 0 ]; then + die "Couldn't verify branch" +fi + +MAIL_MSG=$(mktemp) + +craft_message > $MAIL_MSG + +SUBJ="[GIT PULL] XFS: New code for for v6.18" +generate_email "$SUBJ" $MAIL_MSG diff --git a/bin/xfs-release.sh b/maintainer_old/xfs-release.sh index 105c4a6..105c4a6 100755 --- a/bin/xfs-release.sh +++ b/maintainer_old/xfs-release.sh diff --git a/bin/xfsdump_release.sh b/maintainer_old/xfsdump_release.sh index 42fc2ac..42fc2ac 100755 --- a/bin/xfsdump_release.sh +++ b/maintainer_old/xfsdump_release.sh diff --git a/bin/xfsprogs-summary.sh b/maintainer_old/xfsprogs-summary.sh index ca82955..ca82955 100755 --- a/bin/xfsprogs-summary.sh +++ b/maintainer_old/xfsprogs-summary.sh diff --git a/bin/xfsprogs_release.sh b/maintainer_old/xfsprogs_release.sh index 104adc8..104adc8 100755 --- a/bin/xfsprogs_release.sh +++ b/maintainer_old/xfsprogs_release.sh diff --git a/xfsprogs-eric-notes.txt b/xfsprogs-eric-notes.txt new file mode 100644 index 0000000..7c725cb --- /dev/null +++ b/xfsprogs-eric-notes.txt @@ -0,0 +1,66 @@ +foo +https://korg.wiki.kernel.org/userdoc/kup + +$ git remote add korg [email protected]:pub/scm/fs/xfs/xfsprogs-dev.git + +adds that remote so we can push as "korg" + +$ git push -f korg master:for-next + +-f forces the update into for-next + +to push my for-next to for-next -- for-next:for-next + +*** might need guilt/$BRANCH not just $BRANCH *** + +Modify files for new version! + +VERSION +configure.ac +debian/changelog <-- for -rc as well! +doc/CHANGES + +vim VERSION configure.ac debian/changelog doc/CHANGES + +changelog entry: + + xfsprogs: Release v4.16.0 + + Update all the necessary files for a 4.16.0 release. + + Signed-off-by: Eric Sandeen <[email protected]> + +signed tag: + +yum install pinentry +export GPG_TTY=`tty` +export LC_CTYPE="en_US.UTF-8" +export RELVER="4.14.0" +git tag -s -u [email protected] -m "Release v${RELVER}" v${RELVER} +/////// $ git push --tags korg for-next:master for-next:for-next + +# NEVER USE --tags or --follow-tags +$ git push origin <tag> + + +xfsprogs-summary.sh v${RELVER}.. + +Create the tarballs: +$ make dist + +For actual release, to sign tarball: +gpg -u [email protected] -a --detach-sign xfsprogs-${RELVER}.tar + + + +and to publish it: +$ mv xfsprogs-${RELVER}.tar.asc xfsprogs-${RELVER}.tar.sign +$ gzip xfsprogs-${RELVER}.tar +$ kup put xfsprogs-${RELVER}.tar.gz xfsprogs-${RELVER}.tar.sign pub/linux/utils/fs/xfs/xfsprogs/xfsprogs-${RELVER}.tar.gz + +where: + +# cat ~/.kuprc +host = [email protected] +subcmd = kup-server + |
