git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Owen Taylor <otaylor@redhat.com>
To: Daniel Barkalow <barkalow@iabervon.org>
Cc: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org
Subject: Re: Patches for git-push --confirm and --show-subjects
Date: Mon, 14 Sep 2009 19:18:14 -0400	[thread overview]
Message-ID: <1252970294.11581.71.camel@localhost.localdomain> (raw)
In-Reply-To: <alpine.LNX.2.00.0909141745410.14907@iabervon.org>

On Mon, 2009-09-14 at 18:21 -0400, Daniel Barkalow wrote:
> On Sun, 13 Sep 2009, Owen Taylor wrote:

[...]
> I think the classification logic should move to match_refs(), assuming you 
> mean the ref->nonfastforward and ref->deletion stuff. It would probably 
> also be worth having a bit for "already up to date". (Note that 
> cmd_send_pack() calls match_refs(), so there wouldn't have to be 
> duplication between the legacy cmd_send_pack() code path and the 
> transport_push() codepath if the code moved into match_refs()).
[...]
> >  - You add another vfunc to the transport - '->get_capabilities' or
> >    something - that encapsulates server_supports("delete-refs").
> 
> I think it would be better to have a vfunc that takes refs with the 
> classification bits set and sets the statuses based on the idea that we're 
> not going to lose any races and the remote won't reject our change for 
> some reason we don't know about. There's a potentially large and varied 
> set of restrictions on what the other side is willing to accept, and I 
> think it would be better to put that on the other side of the vfunc, 
> rather than having the main transport code know that "delete-refs" means 
> that you can delete refs, "nonfastforward" means you can force a 
> non-fast-forward, something means you can create files named "CVS", etc.

match_refs seems like a reasonable place to put this logic, but I'm not
sure I completely follow what you are proposing in terms of
transport-specific customization.

match_refs() is called from a couple of places where there is no
'transport' (cmd_send_pack() and http-push.c) so it can't itself call
into the transport code.

Are you thinking of a virtual function that would be a "second pass"
after the main logic done is done by match_refs; so ->check_refs()
virtual function?

How would the 'bit for "already up to date"' differ from
REF_STATUS_UPTODATE. ?

> I think a pre-push hook would be popular; I know I'd like to have a hook 
> that makes sure that I signed off anything I'm pushing (when the server 
> might check that *somebody* did, but wouldn't know that this push is 
> supposed to be me), and I'd like a hook that checks that I've referenced 
> an issue in an issue tracker for each commit that I'm pushing (but only 
> when I go to push it).

If I can figure out the rest of it, I'll look at adding a hook on top as
a sweetener :-)

- Owen

  reply	other threads:[~2009-09-14 23:18 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-13 23:31 Patches for git-push --confirm and --show-subjects Owen Taylor
2009-09-13 23:31 ` [PATCH 1/4] push: add --confirm option to ask before sending updates Owen Taylor
2009-09-13 23:31   ` [PATCH 2/4] push: allow configuring default for --confirm Owen Taylor
2009-09-13 23:31     ` [PATCH 3/4] push: add --show-subjects option to show commit synopsis Owen Taylor
2009-09-13 23:31       ` [PATCH 4/4] push: allow configuring default for --show-subjects Owen Taylor
2009-09-14  0:47 ` Patches for git-push --confirm and --show-subjects Junio C Hamano
2009-09-14  0:53   ` Junio C Hamano
2009-09-14  2:35   ` Owen Taylor
2009-09-14 22:21     ` Daniel Barkalow
2009-09-14 23:18       ` Owen Taylor [this message]
2009-09-15  0:46         ` Junio C Hamano
2009-09-15  2:38           ` Owen Taylor
2009-09-15  5:50             ` Junio C Hamano
2009-09-15 11:50               ` Owen Taylor
2009-09-15  0:55         ` Daniel Barkalow

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=1252970294.11581.71.camel@localhost.localdomain \
    --to=otaylor@redhat.com \
    --cc=barkalow@iabervon.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /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).