File: patch-cherry-pick

package info (click to toggle)
ghostscript 10.05.1~dfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 93,508 kB
  • sloc: ansic: 908,895; python: 7,676; cpp: 6,534; cs: 6,457; sh: 6,168; java: 4,028; perl: 2,373; tcl: 1,639; makefile: 529; awk: 66; yacc: 18
file content (31 lines) | stat: -rwxr-xr-x 749 bytes parent folder | download | duplicates (11)
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
#!/bin/sh
# Copyright 2018  Jonas Smedegaard <dr@jones.dk>
# Description: helper script to cherry-pick upstream patches
#
# This program is free software;
# you can redistribute it and/or modify it
# under the terms of the GNU General Public License
# as published by the Free Software Foundation;
# either version 3, or (at your option) any later version.

set -eu

TREEISH=$1
FORK=${2:-}

#DATEFORMAT='format:%Y%m%d'
DATEFORMAT='iso-strict'

if [ -n "$FORK" ]; then
	PREFIX="debian/patches/$FORK/"
	mkdir -p "debian/patches/$FORK"
else
	PREFIX="debian/patches/0"
fi

export PREFIX

git log --right-only --no-merges \
	--pretty='%h %ad' --date="$DATEFORMAT" \
	"$TREEISH" \
	| perl -ane '`git log -p $F[0]^..$F[0] > $ENV{PREFIX}$F[1]~$F[0].patch`'