Patchwork [1/3] Fix post-receive hook to not update the previously pushed commit

login
register
mail settings
Submitter Carl Worth
Date Dec. 11, 2013, 6:46 p.m.
Message ID <1386787588-2074-1-git-send-email-cworth@cworth.org>
Download mbox | patch
Permalink /patch/300287/
State Accepted
Headers show

Comments

Carl Worth - Dec. 11, 2013, 6:46 p.m.
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.
---
 tools/post-receive.hook | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Jeremy Kerr - Jan. 28, 2014, 1:01 p.m.
Hi Carl,

> 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.

Thanks for the series; I've applied it all, plus the fix for the 
post-receive hook.

Are you okay with me adding your signed-off-by line to all four patches?

Cheers,

Jeremy
Carl Worth - Jan. 28, 2014, 5:02 p.m.
Jeremy Kerr <jk@ozlabs.org> writes:
> Thanks for the series; I've applied it all, plus the fix for the 
> post-receive hook.

Fantastic.

> Are you okay with me adding your signed-off-by line to all four
> patches?

Yes, please.

-Carl

Patch

diff --git a/tools/post-receive.hook b/tools/post-receive.hook
index ee3345f..b2b89a2 100755
--- a/tools/post-receive.hook
+++ b/tools/post-receive.hook
@@ -39,7 +39,7 @@  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-list --no-merges --reverse ${1}..${2}); do
     if [ "$do_exit" = 1 ]; then
       echo "I: exiting..." >&2
       break