File: diff-gencontrol

package info (click to toggle)
linux 6.17.13-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,735,112 kB
  • sloc: ansic: 26,688,265; asm: 271,225; sh: 147,407; python: 75,980; makefile: 57,304; perl: 36,943; xml: 19,562; cpp: 5,899; yacc: 4,909; lex: 2,943; awk: 1,556; sed: 29; ruby: 25
file content (32 lines) | stat: -rwxr-xr-x 833 bytes parent folder | download | duplicates (14)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash
set -euE

REF_BASE=${1:-debian/latest}

REPO=$(git rev-parse --show-toplevel)
COMMIT_BASE=$(git merge-base --fork-point "$REF_BASE")
COMMIT_NEW=$(git stash create)

TMP=$(mktemp -d)
trap "rm -rf '$TMP'" EXIT

function git {
  command git -c advice.detachedHead=false -c init.defaultBranch=main -C "$TMP" "$@"
}

git init -q
git remote add origin "$REPO"
git fetch -q --depth 1 origin $COMMIT_BASE:base $COMMIT_NEW:new

git checkout -q base
echo "Running gencontrol on ${COMMIT_BASE}"
( cd "$TMP"; ./debian/bin/gencontrol.py )
git stash push -q --all

git checkout -q new
echo "Running gencontrol on uncommited changes"
( cd "$TMP"; ./debian/bin/gencontrol.py )
git stash push -q --all

# ^3 is the commit with untracked files
git diff stash@{1}^3 stash@{0}^3 -- . ':(exclude)debian/lib/python/debian_linux/__pycache__/*'