File: generate-commit-counts.sh

package info (click to toggle)
darktable 4.2.1-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 52,960 kB
  • sloc: ansic: 329,632; cpp: 90,717; xml: 18,803; lisp: 12,673; sh: 3,478; javascript: 3,264; perl: 1,888; python: 1,082; ruby: 972; makefile: 536; asm: 46; sql: 38; awk: 21
file content (41 lines) | stat: -rwxr-xr-x 1,013 bytes parent folder | download
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
33
34
35
36
37
38
39
40
41
#!/bin/bash

unset CDPATH

if [[ -z $1 ]]; then
    echo "usage: $0 <ref-previous-release"
    echo ""
    echo "   the ref is generally the branch point of the current release."
    echo "   for example release-4.1.0"
    exit 1
fi

REF=$1

#  For darktable

DT=$(git log --no-merges --oneline $REF..HEAD | wc -l)

echo darktable $DT

#  For rawspeed

#  get darktable submodule commits
DRSFIRST=$(git log --no-merges --oneline $REF..HEAD src/external/rawspeed |
               tail -1 | cut -d' ' -f1)
DRSLAST=$(git log --no-merges --oneline $REF..HEAD src/external/rawspeed |
              head -1 | cut -d' ' -f1)

#  get corresponding commits in rawspspeed
RSFIRST=$(git show $DRSFIRST -- src/external/rawspeed |
              grep '^-Subproject' | cut -d' ' -f3)

RSLAST=$(git show $DRSLAST -- src/external/rawspeed |
              grep '^+Subproject' | cut -d' ' -f3)

cd src/external/rawspeed
RS=$(git log --no-merges --oneline $RSFIRST..$RSLAST | wc -l)

echo rawspeed $RS

echo Total: $(expr $DT + $RS)