File: patch-cherry-pick

package info (click to toggle)
radicale 3.5.10-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 2,004 kB
  • sloc: python: 13,017; javascript: 1,144; sh: 269; xml: 93; makefile: 38; perl: 20
file content (31 lines) | stat: -rwxr-xr-x 749 bytes parent folder | download | duplicates (15)
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`'