From: Theodore Tso <tytso@mit.edu>
To: "Shawn O. Pearce" <spearce@spearce.org>
Cc: Junio C Hamano <junkio@cox.net>, git <git@vger.kernel.org>
Subject: Re: git push to a non-bare repository
Date: Sun, 18 Mar 2007 22:47:44 -0400 [thread overview]
Message-ID: <20070319024744.GD11371@thunk.org> (raw)
In-Reply-To: <20070319022143.GF20658@spearce.org>
On Sun, Mar 18, 2007 at 10:21:43PM -0400, Shawn O. Pearce wrote:
> Junio C Hamano <junkio@cox.net> wrote:
> > Theodore Tso <tytso@mit.edu> writes:
> >
> > > Is it at all possible to figure out <commit-id-before-the-push>? It
> > > seems the answer is no, and I suspect that's a bug.
> >
> > Doesn't update hook get pre- and post- commit object name?
>
> Yes, and the same is true in the new post-receive hook.
In my comments, I was observing that *after* the push had succeeded,
there was no way to find the commit-id-before-the-push, since neither
the reflog nor ORIG_HEAD is getting updated. Is there a good reason
why not? Would you accept a patch which caused the reflog and
possibly ORIG_HEAD to be updated on the remote side of the push?
When I was talking about a hook to enforce the BitKeeper semantics,
the question is whether we have enough to enforce the following:
* Only accept the push if it will result in a fast-forward
merge (and if not, tell the user to do a git pull, merge
locally, and then redo the git push)
* Only accept the push if there are no locally modified files
that would be affected when the working directory is
updated to reflect the new HEAD
I don't think there's any easy way to determine if these two criteria
would be met besides trying to actually do the merge, and if it fails
atomically back out to the original starting point, right? Or am I
missing something painfully obvious?
Since one of the applications where I might want to do something like
this is a push a web site being maintained by git (where I don't want
any the result of the interim attempted to merge to accidentally get
seen by the web server), probably in order to do this right I'd have
to have the hook script do a cp -rl of the repository+working tree to
some scratch space, try to do the merge and update of the working
tree, and if it succeeds, allow it to happen for real in the "live"
tree, and if not, fail the merge. This seems awfully kludgy; is there
some other way?
- Ted
next prev parent reply other threads:[~2007-03-19 2:48 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-18 17:31 git push to a non-bare repository Matthieu Moy
2007-03-18 19:47 ` Junio C Hamano
2007-03-18 21:51 ` Sam Vilain
2007-03-18 22:01 ` Jakub Narebski
2007-03-18 22:18 ` Junio C Hamano
2007-03-19 2:00 ` Theodore Tso
2007-03-19 1:55 ` Junio C Hamano
2007-03-19 2:21 ` Shawn O. Pearce
2007-03-19 2:47 ` Theodore Tso [this message]
2007-03-19 2:56 ` Shawn O. Pearce
2007-03-19 3:21 ` Theodore Tso
2007-03-19 3:53 ` Shawn O. Pearce
2007-03-19 4:08 ` Nicolas Pitre
2007-03-19 6:25 ` Theodore Tso
2007-03-19 6:44 ` Junio C Hamano
2007-03-19 15:20 ` Nicolas Pitre
2007-03-19 15:16 ` Nicolas Pitre
2007-03-19 23:58 ` Sam Vilain
2007-03-20 0:49 ` Junio C Hamano
2007-03-20 0:54 ` Junio C Hamano
2007-03-19 3:33 ` Theodore Tso
2007-03-19 3:47 ` Shawn O. Pearce
2007-03-19 4:14 ` Junio C Hamano
2007-03-19 9:19 ` Matthieu Moy
2007-03-19 10:01 ` Jakub Narebski
2007-03-21 17:20 ` Neil Schemenauer
2007-03-19 12:44 ` Sergio Callegari
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=20070319024744.GD11371@thunk.org \
--to=tytso@mit.edu \
--cc=git@vger.kernel.org \
--cc=junkio@cox.net \
--cc=spearce@spearce.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).