diff options
author | Brian Norris <computersforpeace@gmail.com> | 2014-06-11 18:54:59 -0700 |
---|---|---|
committer | Jeremy Kerr <jk@ozlabs.org> | 2014-07-24 17:22:53 +0800 |
commit | f49c72da5545f2da49dd83d9ec54fe232cf60360 (patch) | |
tree | 75b6b3f98c8e5290758e8acde0e114cf0c6d91ca /tools | |
parent | 0a502d0cf5b0daced5869130b1003d2002d547ab (diff) | |
download | patchwork-f49c72da5545f2da49dd83d9ec54fe232cf60360.tar patchwork-f49c72da5545f2da49dd83d9ec54fe232cf60360.tar.gz |
post-receive: exclude commits from the patch update step
When merging upstream work related to other projects into your own
project repository, you probably don't want to check for (and try to
update) the status on every change-set in the merge. So add a list of
references (branches, tags, commits, etc.) whose commits should be
ignored in the patch update step.
This could be used, for example, to set:
EXCLUDE="refs/heads/upstream"
Then when you're ready to merge in new upstream code, you first update
the 'upstream' branch before pushing your own.
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/post-receive.hook | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/tools/post-receive.hook b/tools/post-receive.hook index 4fb741d..a38522e 100755 --- a/tools/post-receive.hook +++ b/tools/post-receive.hook @@ -8,6 +8,12 @@ set -eu #TODO: the state map should really live in the repo's git-config STATE_MAP="refs/heads/master:Accepted" +# +# ignore all commits already present in these refs +# e.g., +# EXCLUDE="refs/heads/upstream refs/heads/other-project" +# +EXCLUDE="" PWDIR=/srv/patchwork/apps/patchwork @@ -39,7 +45,8 @@ set_patch_state() update_patches() { local cnt; cnt=0 - for rev in $(git rev-list --no-merges --reverse ${1}..${2}); do + for rev in $(git rev-parse --not ${EXCLUDE} | + git rev-list --stdin --no-merges --reverse ${1}..${2}); do if [ "$do_exit" = 1 ]; then echo "I: exiting..." >&2 break |