diff options
author | Ben Hutchings <ben@decadent.org.uk> | 2019-12-05 10:43:00 +0000 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2019-12-05 10:43:00 +0000 |
commit | feb8fe98d4653057b8a260a64df75fa4ac330eb3 (patch) | |
tree | 8c3b6336fb07d4cc17d381cb7cefa0cb32296b3b | |
parent | 433f0b076f664fbfca27ac272a24715089f72a95 (diff) | |
download | linux-stable-queue-feb8fe98d4653057b8a260a64df75fa4ac330eb3.tar.gz |
scripts: Add script to look up commits referenced in Fixes
I've been using (an earlier version of) this for a while, so it's
about time to clean it up and publish it.
-rwxr-xr-x | scripts/find-commits | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/scripts/find-commits b/scripts/find-commits new file mode 100755 index 00000000..dccc439c --- /dev/null +++ b/scripts/find-commits @@ -0,0 +1,32 @@ +#!/bin/bash -eu + +SCRIPTS="$(dirname "$0")" +. "$SCRIPTS"/lsq-defs + +find_commit() { + local full_hash upstream base_ver queue + + if full_hash="$(git rev-parse "$1")" && [ "$full_hash" ]; then + if upstream="$(git describe --contains --match 'v*' "$full_hash" 2>/dev/null)"; then + echo "upstream: ${upstream%%[~^]*}" + else + echo "upstream: not yet released" + fi + for base_ver in $STABLE_BASE_VERSIONS; do + git check-in-stable "$full_hash" "$base_ver" | sed 's/^/'"$base_ver"': /' + queue="$(get_queue $base_ver)" + (cd "$queue" && grep -rl "$full_hash" | sed 's/^/'"$base_ver"': queued: /') + done + fi + echo --- +} + +if [ $# -eq 0 ]; then + while read hash; do + find_commit "$hash" + done +else + for hash in "$@"; do + find_commit "$hash" + done +fi |