aboutsummaryrefslogtreecommitdiff
path: root/tools/post-receive.hook
Commit message (Collapse)AuthorAge
* Remove pwclientStephen Finucane2019-06-17
| | | | | | | | | Let's start managing this via a separate project, which will allow the client to evolve separately from the server. No redirect is added for the old '/pwclient' URL as it seems wiser to return a HTTP 404 error code. Signed-off-by: Stephen Finucane <stephen@that.guru>
* Update license headerStephen Finucane2018-09-19
| | | | | | | | | | | | | The FSF has a new address since 2005 that hasn't been noted in any file except the COPYING file. Rather than fix these, simply remove the headers in favour of a SPDX license header. IANAL but the combination of the header and the COPYING file in source should resolve this issue. Note that copyright notices are retained. Signed-off-by: Stephen Finucane <stephen@that.guru> Closes: #210 Reviewed-by: Veronika Kabatova <vkabatov@redhat.com>
* post-receive.hook: Handle failure to find patch numberTom Rini2018-01-04
| | | | | | | | | | | When pwclient info -h fails to come up with the number for the change in question it will exit with a non-zero exit code. This failure will propagate upwards and exit the script there. Make our call to get_patch_id or in true so that our script here will see an empty id and we continue on with the list. Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Stephen Finucane <stephen@that.guru>
* trivial: Standardize variable naming in scriptsStephen Finucane2017-02-06
| | | | | | | Just so we can interact with them as expected. Signed-off-by: Stephen Finucane <stephen@that.guru> Reviewed-by: Daniel Axtens <dja@axtens.net>
* tools: Run scripts through shellcheckStephen Finucane2017-02-06
| | | | | | | This mostly results in the addition of quotes to prevent globbing. Signed-off-by: Stephen Finucane <stephen@that.guru> Reviewed-by: Daniel Axtens <dja@axtens.net>
* tools: Update to use 'hasher'Stephen Finucane2016-12-01
| | | | | | | | | | | The old 'parser' module used to extract diffs from their surrounding mbox fluff before hashing this. Seeing as this was only used in the context of an actual git repo, avoid all of that rigmarole by just using 'git diff', which produces a plain diff, rather than 'git show'. Signed-off-by: Stephen Finucane <stephen@that.guru> Tested-by: Tom Rini <trini@konsulko.com> Closes-bug: #63
* tools: Trivial formatting fixesStephen Finucane2016-12-01
| | | | | | | | | | | These tools are currently broken, but before beginning surgery let's clean things up. Use standard 4 spaces and the longer, but easier to read, if-else-fi syntax for comparison. Missing license headers are added for completeness sake. Signed-off-by: Stephen Finucane <stephen@that.guru> Tested-by: Tom Rini <trini@konsulko.com>
* post-receive: Use correct default installation pathSven Eckelmann2016-05-09
| | | | | | | | | The documentation recommends to use /opt/patchwork instead of /srv/patchwork since version 1.1. This change should be reflected in the PWDIR variable of the post-receive hook. Signed-off-by: Sven Eckelmann <sven@narfation.org> Reviewed-by: Stephen Finucane <stephen.finucane@intel.com>
* post-receive.hook: rename detectionJan Remmet2016-05-09
| | | | | | | | patches which descripes renamed files show different hashes with git show and pwclient. Use git show -C (Detect copies as well as renames.) Signed-off-by: Jan Remmet <j.remmet@phytec.de> Reviewed-by: Stephen Finucane <stephen.finucane@intel.com>
* Move to a more recent django project structureJeremy Kerr2015-05-27
| | | | | | | | | | This change updates patchwor to the newer project struture: we've moved the actual application out of the apps/ directory, and the patchwork-specific templates to under the patchwork application. This gives us the manage.py script in the top-level now. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* post-receive: exclude commits from the patch update stepBrian Norris2014-07-24
| | | | | | | | | | | | | | | | | | 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>
* post-receive: Fix error message when pushing to an unmapped branchCarl Worth2014-01-29
| | | | | | | | | | | | | | | | Previously, if STATE_MAP contained only refs/heads/master and a user pushed to a branch such as refs/heads/stable, the hook emitted a misleading error message: E: no mapping for refname refs/heads/master Fix this by correctly printing the reference being looked for, rather than the reference most recently found in STATE_MAP. Also, reword the message slightly to point the user to STATE_MAP and to use an actual word "branch" instead of the non-word "refname". Signed-off-by: Carl Worth <cworth@cworth.org> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Make the post-receive hook more efficient (using pwclient info, not view)Carl Worth2014-01-29
| | | | | | | | | | | | | | Older versions of patchwork shipped with a version of pwclient that had the view command, but not info command. Now that info exists, it's inefficient to use it to obtain the patchwork ID value, (since it requires the server to send the entire patch content in response to an XML RPC request). So be kind to the server by using info instead, (which has a small, fixed-length response). Signed-off-by: Carl Worth <cworth@cworth.org> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* tools/post-receive.hook: don't update the previously pushed commitCarl Worth2014-01-29
| | | | | | | | | | Previously, the post-receive hook would always examine one commit that had been previously pushed, (when the purpose of the hook is only to example newly-pushed commits). We fix this by simply dropping the '^' in the commit-range specification. Signed-off-by: Carl Worth <cworth@cworth.org> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* tools: Update license for post-receive hook.Jeremy Kerr2010-08-10
| | | | | | | Martin has allowed distribution under the GPL. http://lists.ozlabs.org/pipermail/patchwork/2010-June/000263.html Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* tools: Add a simple sample Git post-receive hookMartin Krafft2010-08-10
This patch adds a post-receive hook to lib/git, which can be used to update Patchwork following a push to the Git repository. Surely, it can be improved. One thing to do would be to export the state map to git-config somehow. Signed-off-by: martin f. krafft <madduck@madduck.net> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>