Re: [RTC/PATCH] Add 'update-branch' hook

2014-04-26 Thread Junio C Hamano
Felipe Contreras felipe.contre...@gmail.com writes: So you grant that there is no reason anybody can think of why we would ever want a post-update-branch? No, it only shows that you (and I) are not imaginative enough (and/or we didn't bother spending enough brain cycles) to come up with an

Re: [RTC/PATCH] Add 'update-branch' hook

2014-04-26 Thread Felipe Contreras
Junio C Hamano wrote: Felipe Contreras felipe.contre...@gmail.com writes: So you grant that there is no reason anybody can think of why we would ever want a post-update-branch? No, it only shows that you (and I) are not imaginative enough (and/or we didn't bother spending enough brain

Re: [RTC/PATCH] Add 'update-branch' hook

2014-04-24 Thread Stephen Leake
Felipe Contreras felipe.contre...@gmail.com writes: I have a branch which should always be recompiled on update; post-update-branch would be a good place for that. And why would pre-update-branch not serve that purpose? Because the code that needs to be compiled is not yet in the

Re: [RTC/PATCH] Add 'update-branch' hook

2014-04-24 Thread Felipe Contreras
Stephen Leake wrote: Felipe Contreras felipe.contre...@gmail.com writes: I have a branch which should always be recompiled on update; post-update-branch would be a good place for that. And why would pre-update-branch not serve that purpose? Because the code that needs to be

Re: [RTC/PATCH] Add 'update-branch' hook

2014-04-23 Thread Stephen Leake
Felipe Contreras felipe.contre...@gmail.com writes: Stephen Leake wrote: Felipe Contreras felipe.contre...@gmail.com writes: Ilya Bobyr wrote: On 4/21/2014 2:17 PM, Felipe Contreras wrote: Ilya Bobyr wrote: Also, most have names that start with either pre- or post-. It seems

Re: [RTC/PATCH] Add 'update-branch' hook

2014-04-23 Thread Felipe Contreras
Stephen Leake wrote: Felipe Contreras felipe.contre...@gmail.com writes: Stephen Leake wrote: Felipe Contreras felipe.contre...@gmail.com writes: Ilya Bobyr wrote: On 4/21/2014 2:17 PM, Felipe Contreras wrote: Ilya Bobyr wrote: Also, most have names that start with

Re: [RTC/PATCH] Add 'update-branch' hook

2014-04-23 Thread Felipe Contreras
Junio C Hamano wrote: Felipe Contreras felipe.contre...@gmail.com writes: ... there are _already_ hooks without pre/post. Like commit-msg? Yes, it would have been nicer if it were named verify-commit-message or something. No it wouldn't. I can use the commit-msg hook to change the

Re: [RTC/PATCH] Add 'update-branch' hook

2014-04-23 Thread Junio C Hamano
Felipe Contreras felipe.contre...@gmail.com writes: Junio C Hamano wrote: Felipe Contreras felipe.contre...@gmail.com writes: ... there are _already_ hooks without pre/post. Like commit-msg? Yes, it would have been nicer if it were named verify-commit-message or something. No it

Re: [RTC/PATCH] Add 'update-branch' hook

2014-04-23 Thread Junio C Hamano
Felipe Contreras felipe.contre...@gmail.com writes: I have a branch which should always be recompiled on update; post-update-branch would be a good place for that. And why would pre-update-branch not serve that purpose? Because the code that needs to be compiled is not yet in the

Re: [RTC/PATCH] Add 'update-branch' hook

2014-04-23 Thread Felipe Contreras
Junio C Hamano wrote: Felipe Contreras felipe.contre...@gmail.com writes: Junio C Hamano wrote: Felipe Contreras felipe.contre...@gmail.com writes: ... there are _already_ hooks without pre/post. Like commit-msg? Yes, it would have been nicer if it were named

Re: [RTC/PATCH] Add 'update-branch' hook

2014-04-23 Thread Felipe Contreras
Junio C Hamano wrote: Felipe Contreras felipe.contre...@gmail.com writes: I have a branch which should always be recompiled on update; post-update-branch would be a good place for that. And why would pre-update-branch not serve that purpose? Because the code that needs to be

Re: [RTC/PATCH] Add 'update-branch' hook

2014-04-22 Thread Ilya Bobyr
On 4/21/2014 3:24 PM, Felipe Contreras wrote: Ilya Bobyr wrote: On Mon, Apr 21, 2014 at 2:35 PM, Felipe Contreras felipe.contre...@gmail.com wrote: Ilya Bobyr wrote: test_expect_success 'setup' mkdir -p .git/hooks cat .git/hooks/update-branch -\\EOF #!/bin/sh

Re: [RTC/PATCH] Add 'update-branch' hook

2014-04-22 Thread Ilya Bobyr
On 4/20/2014 7:23 PM, Felipe Contreras wrote: [...] diff --git a/branch.c b/branch.c index 660097b..c2058d1 100644 --- a/branch.c +++ b/branch.c @@ -4,6 +4,7 @@ #include refs.h #include remote.h #include commit.h +#include run-command.h struct tracking { struct refspec

Re: [RTC/PATCH] Add 'update-branch' hook

2014-04-22 Thread Ilya Bobyr
On 4/21/2014 1:49 PM, Felipe Contreras wrote: Ilya Bobyr wrote: On 4/20/2014 7:23 PM, Felipe Contreras wrote: This hook is invoked whenever a branch is updated, either when a branch is created or updated with 'git branch', or when it's rebased with 'git rebase'. It receives two parameters;

Re: [RTC/PATCH] Add 'update-branch' hook

2014-04-22 Thread Felipe Contreras
Ilya Bobyr wrote: On 4/21/2014 3:24 PM, Felipe Contreras wrote: Ilya Bobyr wrote: On Mon, Apr 21, 2014 at 2:35 PM, Felipe Contreras felipe.contre...@gmail.com wrote: Ilya Bobyr wrote: test_expect_success 'setup' mkdir -p .git/hooks cat .git/hooks/update-branch -\\EOF

Re: [RTC/PATCH] Add 'update-branch' hook

2014-04-22 Thread Ilya Bobyr
On 4/21/2014 11:45 PM, Felipe Contreras wrote: [...] This is how it is suggested by t/README and how it is done in the other test suites. I can not see how your case is different, but I might be missing something. Let's take a cursoy look at `git grep -l 'EOF' t`. [...] So the point is

Re: [RTC/PATCH] Add 'update-branch' hook

2014-04-22 Thread Felipe Contreras
Ilya Bobyr wrote: On 4/21/2014 11:45 PM, Felipe Contreras wrote: [...] This is how it is suggested by t/README and how it is done in the other test suites. I can not see how your case is different, but I might be missing something. Let's take a cursoy look at `git grep -l 'EOF' t`.

Re: [RTC/PATCH] Add 'update-branch' hook

2014-04-22 Thread Stephen Leake
Felipe Contreras felipe.contre...@gmail.com writes: Ilya Bobyr wrote: On 4/21/2014 2:17 PM, Felipe Contreras wrote: Ilya Bobyr wrote: Also, most have names that start with either pre- or post-. It seems reasonable for both pre-update-branch and post-update-branch to exist. I don't

Re: [RTC/PATCH] Add 'update-branch' hook

2014-04-22 Thread Felipe Contreras
Ilya Bobyr wrote: On 4/20/2014 7:23 PM, Felipe Contreras wrote: [...] diff --git a/branch.c b/branch.c index 660097b..c2058d1 100644 --- a/branch.c +++ b/branch.c @@ -4,6 +4,7 @@ #include refs.h #include remote.h #include commit.h +#include run-command.h struct

Re: [RTC/PATCH] Add 'update-branch' hook

2014-04-22 Thread Felipe Contreras
Ilya Bobyr wrote: On 4/21/2014 1:49 PM, Felipe Contreras wrote: Ilya Bobyr wrote: On 4/20/2014 7:23 PM, Felipe Contreras wrote: This hook is invoked whenever a branch is updated, either when a branch is created or updated with 'git branch', or when it's rebased with 'git rebase'. It

Re: [RTC/PATCH] Add 'update-branch' hook

2014-04-22 Thread Felipe Contreras
Stephen Leake wrote: Felipe Contreras felipe.contre...@gmail.com writes: Ilya Bobyr wrote: On 4/21/2014 2:17 PM, Felipe Contreras wrote: Ilya Bobyr wrote: Also, most have names that start with either pre- or post-. It seems reasonable for both pre-update-branch and

Re: [RTC/PATCH] Add 'update-branch' hook

2014-04-22 Thread Ilya Bobyr
On 4/22/2014 9:31 AM, Felipe Contreras wrote: Stephen Leake wrote: Felipe Contreras felipe.contre...@gmail.com writes: Ilya Bobyr wrote: On 4/21/2014 2:17 PM, Felipe Contreras wrote: Ilya Bobyr wrote: Also, most have names that start with either pre- or post-. It seems reasonable for both

Re: [RTC/PATCH] Add 'update-branch' hook

2014-04-22 Thread Felipe Contreras
Ilya Bobyr wrote: On 4/22/2014 9:31 AM, Felipe Contreras wrote: Stephen Leake wrote: Felipe Contreras felipe.contre...@gmail.com writes: Yes, there a reason for the existance of those hooks. Now tell me why would anybody use post-update-branch instead of pre-update-branch? I have

Re: [RTC/PATCH] Add 'update-branch' hook

2014-04-21 Thread Eric Sunshine
On Sun, Apr 20, 2014 at 10:23 PM, Felipe Contreras felipe.contre...@gmail.com wrote: This hook is invoked whenever a branch is updated, either when a branch is created or updated with 'git branch', or when it's rebased with 'git rebase'. It receives two parameters; the name of the branch, and

Re: [RTC/PATCH] Add 'update-branch' hook

2014-04-21 Thread Ilya Bobyr
On 4/20/2014 7:23 PM, Felipe Contreras wrote: This hook is invoked whenever a branch is updated, either when a branch is created or updated with 'git branch', or when it's rebased with 'git rebase'. It receives two parameters; the name of the branch, and the SHA-1 of the latest commit,

Re: [RTC/PATCH] Add 'update-branch' hook

2014-04-21 Thread Felipe Contreras
Ilya Bobyr wrote: On 4/20/2014 7:23 PM, Felipe Contreras wrote: This hook is invoked whenever a branch is updated, either when a branch is created or updated with 'git branch', or when it's rebased with 'git rebase'. It receives two parameters; the name of the branch, and the SHA-1 of the

Re: [RTC/PATCH] Add 'update-branch' hook

2014-04-21 Thread Ilya Bobyr
On 4/21/2014 1:49 PM, Felipe Contreras wrote: Ilya Bobyr wrote: On 4/20/2014 7:23 PM, Felipe Contreras wrote: This hook is invoked whenever a branch is updated, either when a branch is created or updated with 'git branch', or when it's rebased with 'git rebase'. It receives two parameters;

Re: [RTC/PATCH] Add 'update-branch' hook

2014-04-21 Thread Ilya Bobyr
On 4/20/2014 7:23 PM, Felipe Contreras wrote: [...] diff --git a/t/t5408-update-branch-hook.sh b/t/t5408-update-branch-hook.sh new file mode 100755 index 000..d921c0e --- /dev/null +++ b/t/t5408-update-branch-hook.sh @@ -0,0 +1,39 @@ +#!/bin/sh + +test_description='Test the

Re: [RTC/PATCH] Add 'update-branch' hook

2014-04-21 Thread Felipe Contreras
Ilya Bobyr wrote: On 4/20/2014 7:23 PM, Felipe Contreras wrote: [...] diff --git a/t/t5408-update-branch-hook.sh b/t/t5408-update-branch-hook.sh new file mode 100755 index 000..d921c0e --- /dev/null +++ b/t/t5408-update-branch-hook.sh @@ -0,0 +1,39 @@ +#!/bin/sh +

Re: [RTC/PATCH] Add 'update-branch' hook

2014-04-21 Thread Felipe Contreras
Ilya Bobyr wrote: Also, most have names that start with either pre- or post-. It seems reasonable for both pre-update-branch and post-update-branch to exist. I don't see what would be the point in that. This one would be pre-update-branch, I guess. I was also wondering about git reset.

Re: [RTC/PATCH] Add 'update-branch' hook

2014-04-21 Thread Ilya Bobyr
On 4/21/2014 2:15 PM, Felipe Contreras wrote: Ilya Bobyr wrote: On 4/20/2014 7:23 PM, Felipe Contreras wrote: [...] diff --git a/t/t5408-update-branch-hook.sh b/t/t5408-update-branch-hook.sh new file mode 100755 index 000..d921c0e --- /dev/null +++ b/t/t5408-update-branch-hook.sh @@

Re: [RTC/PATCH] Add 'update-branch' hook

2014-04-21 Thread Ilya Bobyr
On 4/21/2014 2:17 PM, Felipe Contreras wrote: Ilya Bobyr wrote: Also, most have names that start with either pre- or post-. It seems reasonable for both pre-update-branch and post-update-branch to exist. I don't see what would be the point in that. Do you see the point in the other hooks

Re: [RTC/PATCH] Add 'update-branch' hook

2014-04-21 Thread Felipe Contreras
Ilya Bobyr wrote: On 4/21/2014 2:15 PM, Felipe Contreras wrote: Ilya Bobyr wrote: On 4/20/2014 7:23 PM, Felipe Contreras wrote: [...] diff --git a/t/t5408-update-branch-hook.sh b/t/t5408-update-branch-hook.sh new file mode 100755 index 000..d921c0e --- /dev/null +++

Re: [RTC/PATCH] Add 'update-branch' hook

2014-04-21 Thread Felipe Contreras
Ilya Bobyr wrote: On 4/21/2014 2:17 PM, Felipe Contreras wrote: Ilya Bobyr wrote: Also, most have names that start with either pre- or post-. It seems reasonable for both pre-update-branch and post-update-branch to exist. I don't see what would be the point in that. Do you see the

Re: [RTC/PATCH] Add 'update-branch' hook

2014-04-21 Thread Junio C Hamano
Ilya Bobyr ilya.bo...@gmail.com writes: On 4/21/2014 2:17 PM, Felipe Contreras wrote: Ilya Bobyr wrote: Also, most have names that start with either pre- or post-. It seems reasonable for both pre-update-branch and post-update-branch to exist. I don't see what would be the point in that.

Re: [RTC/PATCH] Add 'update-branch' hook

2014-04-21 Thread Felipe Contreras
Ilya Bobyr wrote: On Mon, Apr 21, 2014 at 2:35 PM, Felipe Contreras felipe.contre...@gmail.com wrote: Ilya Bobyr wrote: test_expect_success 'setup' mkdir -p .git/hooks cat .git/hooks/update-branch -\\EOF #!/bin/sh echo \$@ .git/update-branch.args

Re: [RTC/PATCH] Add 'update-branch' hook

2014-04-21 Thread Felipe Contreras
Junio C Hamano wrote: Ilya Bobyr ilya.bo...@gmail.com writes: On 4/21/2014 2:17 PM, Felipe Contreras wrote: Ilya Bobyr wrote: Also, most have names that start with either pre- or post-. It seems reasonable for both pre-update-branch and post-update-branch to exist. I don't see

Re: [RTC/PATCH] Add 'update-branch' hook

2014-04-21 Thread Junio C Hamano
Felipe Contreras felipe.contre...@gmail.com writes: ... there are _already_ hooks without pre/post. Like commit-msg? Yes, it would have been nicer if it were named verify-commit-message or something. Old mistakes are harder to change because of inertia. It is not a good excuse to knowingly