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

2014-04-26 Thread Felipe Contreras
Junio C Hamano wrote: > Felipe Contreras 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

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

2014-04-26 Thread Junio C Hamano
Felipe Contreras 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 example. Your lack of imagi

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

2014-04-24 Thread Felipe Contreras
Stephen Leake wrote: > Felipe Contreras 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 comp

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

2014-04-24 Thread Stephen Leake
Felipe Contreras 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 workspace > >

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

2014-04-23 Thread Felipe Contreras
Junio C Hamano wrote: > Felipe Contreras 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 com

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

2014-04-23 Thread Felipe Contreras
Junio C Hamano wrote: > Felipe Contreras writes: > > > Junio C Hamano wrote: > >> Felipe Contreras 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

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

2014-04-23 Thread Junio C Hamano
Felipe Contreras 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 workspace > >

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

2014-04-23 Thread Junio C Hamano
Felipe Contreras writes: > Junio C Hamano wrote: >> Felipe Contreras 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 t

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

2014-04-23 Thread Felipe Contreras
Junio C Hamano wrote: > Felipe Contreras 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 commit message and to abs

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

2014-04-23 Thread Felipe Contreras
Stephen Leake wrote: > Felipe Contreras writes: > > > Stephen Leake wrote: > >> Felipe Contreras 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 "p

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

2014-04-23 Thread Stephen Leake
Felipe Contreras writes: > Stephen Leake wrote: >> Felipe Contreras 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 b

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 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 a b

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

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

2014-04-22 Thread Felipe Contreras
Stephen Leake wrote: > Felipe Contreras 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 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 > >>

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 "ru

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

2014-04-22 Thread Stephen Leake
Felipe Contreras 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 do

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 a

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

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

2014-04-21 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

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 par

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/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 { >

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

2014-04-21 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 <<-\\EO

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

2014-04-21 Thread Junio C Hamano
Felipe Contreras 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 make a new mistake to add n

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

2014-04-21 Thread Felipe Contreras
Junio C Hamano wrote: > Ilya Bobyr 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 d

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 \$@

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

2014-04-21 Thread Junio C Hamano
Ilya Bobyr 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 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 t

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

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 th

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

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 abo

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 @@ > > +#!/b

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 th

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 par

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-

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, addi

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

2014-04-21 Thread Eric Sunshine
On Sun, Apr 20, 2014 at 10: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