git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Felipe Contreras <felipe.contreras@gmail.com>
To: Junio C Hamano <gitster@pobox.com>,
	Felipe Contreras <felipe.contreras@gmail.com>
Cc: Stephen Leake <stephen_leake@stephe-leake.org>, git@vger.kernel.org
Subject: Re: [RTC/PATCH] Add 'update-branch' hook
Date: Wed, 23 Apr 2014 20:11:23 -0500	[thread overview]
Message-ID: <535864bbc3a84_3c7abff3107b@nysa.notmuch> (raw)
In-Reply-To: <xmqqoazrwtsc.fsf@gitster.dls.corp.google.com>

Junio C Hamano wrote:
> Felipe Contreras <felipe.contreras@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 workspace
> >
> > And it won't be in 'post-update-branch' either.
> >
> >  % git checkout master
> >  % git branch feature-a stable
> >  <- update-branch hook will be called here
> >
> > The hook will get 'feature-a' as the first argument, but the code in the
> > workspace would correspond to 'master'; the checked out branch (pre or post).
> 
> The whole point of a pre- hook is to run _before_ the externally
> observable state changes due to the operation.
> 
> If Stephen has a separate build-tree that fetches from the branch
> every time the tip of the branch changes in this repository to
> produce build artifacts for the branch to be shared in his network,
> perhaps via NFS or something.  "git fetch" that will be run from
> that build-tree repository will *not* see the tip of the branch, and
> running such a hook will not be possible from a pre-update-branch
> hook.
> 
> We can certainly argue that such a hook could instead push to the
> build-tree repository using the commit object name,

Exactly, it could do that.

> but I tend to think such an argument is merely sidestepping the real issue.

So you grant that there is no reason anybody can think of why we would ever
want a post-update-branch?

> Some hooks do want to observe the state _after_ the operation [*1*], while
> some hooks can do without seeing exactly the state after the operation.

Yes, and when the operation is updating a branch, nobody can think of why we
would want the former.

> So while I am generally not very supportive towards post-anything
> hook, I would reject a claim that says "pre-anything can be used
> without inventing post-anything---do the same thing and allow the
> operation and you are done".  That is not simply true.

Let's make a bet, we go for 'pre-update-branch' and five years from now, if
there's no 'post-update-branch', you will publicly accept thta I was right.

Deal?

-- 
Felipe Contreras

  reply	other threads:[~2014-04-24  1:21 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-21  2:23 [RTC/PATCH] Add 'update-branch' hook Felipe Contreras
2014-04-21  7:25 ` Eric Sunshine
2014-04-21 20:02 ` Ilya Bobyr
2014-04-21 20:49   ` Felipe Contreras
2014-04-21 21:15     ` Ilya Bobyr
2014-04-21 21:17       ` Felipe Contreras
2014-04-21 21:39         ` Ilya Bobyr
2014-04-21 21:36           ` Felipe Contreras
2014-04-22 14:43             ` Stephen Leake
2014-04-22 16:31               ` Felipe Contreras
2014-04-22 17:09                 ` Ilya Bobyr
2014-04-22 17:28                   ` Felipe Contreras
2014-04-23  7:49                 ` Stephen Leake
2014-04-23  9:07                   ` Felipe Contreras
2014-04-23 22:44                     ` Junio C Hamano
2014-04-24  1:11                       ` Felipe Contreras [this message]
2014-04-26 17:38                         ` Junio C Hamano
2014-04-26 19:28                           ` Felipe Contreras
2014-04-24 14:26                     ` Stephen Leake
2014-04-24 18:08                       ` Felipe Contreras
2014-04-21 21:52           ` Junio C Hamano
2014-04-21 22:26             ` Felipe Contreras
2014-04-21 23:00               ` Junio C Hamano
2014-04-23 21:30                 ` Felipe Contreras
2014-04-23 22:15                   ` Junio C Hamano
2014-04-24  1:00                     ` Felipe Contreras
2014-04-22  6:41     ` Ilya Bobyr
2014-04-22 16:30       ` Felipe Contreras
2014-04-21 21:17 ` Ilya Bobyr
2014-04-21 21:15   ` Felipe Contreras
2014-04-21 21:36     ` Ilya Bobyr
2014-04-21 21:35       ` Felipe Contreras
     [not found]         ` <CADcHDF+XcWEkvyP3tL4ibicnaMVJpixUZu1Ces0BXWkzPGsodw@mail.gmail.com>
2014-04-21 22:24           ` Felipe Contreras
2014-04-22  6:05             ` Ilya Bobyr
2014-04-22  6:45               ` Felipe Contreras
2014-04-22  7:00                 ` Ilya Bobyr
2014-04-22  6:56                   ` Felipe Contreras
2014-04-22  6:35 ` Ilya Bobyr
2014-04-22 16:27   ` Felipe Contreras

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=535864bbc3a84_3c7abff3107b@nysa.notmuch \
    --to=felipe.contreras@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=stephen_leake@stephe-leake.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).