diff options
author | Daniel Borkmann <daniel@iogearbox.net> | 2019-10-17 01:22:49 +0200 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2019-10-17 01:22:49 +0200 |
commit | fdf5eb450f8203fc80a167ba7417e82b01f94ada (patch) | |
tree | 20dade2351ff155164bc47606dfd5f274868c8a9 | |
parent | 6e3d70047978e020d48ef8850135ae3a3d1122f8 (diff) | |
download | pw-fdf5eb450f8203fc80a167ba7417e82b01f94ada.tar.gz |
pw: auto-derive the merge base in pw-pull if -s not specified
Add similar logic which we had in our old, non-public pw-pull script.
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
-rw-r--r-- | README | 8 | ||||
-rwxr-xr-x | pw-pull | 7 |
2 files changed, 14 insertions, 1 deletions
@@ -168,6 +168,14 @@ and the scripts would need to be adapted for other subsystems. Currently the -t option only accepts: bpf, bpf-next +The -s option is optional and if not specified then pw-pull will determine +the merge base automatically. In order for this to work, it requires that +there is a net (for -t bpf) or net-next (for -t bpf-next) remote in the +repository. To generate the PR, simply do: + + $ pw-pull -t bpf + PR: pr-bpf-2019-09-26.patch + The resulting file is then edited to describe the changes that the pull-request contains. It's then sent out same way as other patches through git-send-email: @@ -24,13 +24,18 @@ while true; do * ) break ;; esac done -[ -z "$since" ] && usage [ -z "$tree" ] && usage case $tree in bpf-next ) remote=(net-next git://git.kernel.org/pub/scm/linux/kernel/git/bpf/$tree.git) ;; bpf ) remote=(net git://git.kernel.org/pub/scm/linux/kernel/git/bpf/$tree.git) ;; * ) usage ;; esac +if [ -z "$since" ]; then + git fetch ${remote[0]} + branch=$(git rev-parse --abbrev-ref HEAD) + since=$(git merge-base $branch ${remote[0]}/master) +fi +[ -z "$since" ] && usage old=$(git log $since -n 1 --format=%ct) new=$(git log HEAD -n 1 --format=%ct) |