From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: Steven Grimm <koreth@midwinter.com>, git@vger.kernel.org
Subject: Re: [PATCH v4] Allow update hooks to update refs on their own.
Date: Sun, 02 Dec 2007 19:45:23 -0800 [thread overview]
Message-ID: <7vr6i4qw4s.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <7vlk8csetl.fsf@gitster.siamese.dyndns.org> (Junio C. Hamano's message of "Sun, 02 Dec 2007 18:16:22 -0800")
Junio C Hamano <gitster@pobox.com> writes:
> Jeff King <peff@peff.net> writes:
>
>> ..., but an
>> "ok, but btw I changed your commit" status from receive-pack seems like
>> it would be useful, for two reasons:
>>
>> - it can be displayed differently, so the user is reminded to do a
>> fetch afterwards
>> - we can avoid updating the tracking ref, which makes it less likely
>> to result in a non-fast forward fetch next time. For example,
>> consider:
>>
>> 1. The remote master and my origin/master are at A.
>> 2. I make a commit B on top of A.
>> 3. I push B to remote, who rewrites it to B' on top of A. At the
>> same time, I move my origin/master to B.
>> 4. I fetch, and get non-ff going from B to B'.
>>
>> If I had never written anything to my origin/master, it would be a
>> fast forward. And obviously git handles it just fine, but it is more
>> useful to the user during the next fetch to see A..B rather than
>> B'...B.
>
> Sensible argument. I stand corrected.
Having said that, I think the workflow that this "letting update hook
munge" patch supports has a bit more implications for the people who
interact with it. The pusher will need to force fetch the result, but
after that he needs to discard his own commit and replace it with
whatever the hook did. The question is how much to discard, and how to
reconstruct the changes since the last push that was made on top of the
commit that was pushed.
Maybe the push pushed out a string of five pearls and the hook may have
rewritten only the tip, or all of them. You may have built a few
commits on top since then. If what you pushed out contained merges and
the hook rewrote it, you would need to potentially replay such a merge
that was rewritten by the hook.
This is all the same with a workflow that deals with a branch that is
advertised to constantly rewound and rebased, and the common approach is
to use "fetch + rebase" (see recent discussion between Nico and Bruce).
So this patch is not creating a new problem (iow, I am not mentioning
this as the reason to reject this patch), but I thought I should bring
it up so that people know what they are doing.
next prev parent reply other threads:[~2007-12-03 3:45 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-27 21:17 [PATCH] Allow update hooks to update refs on their own Steven Grimm
2007-11-27 21:21 ` Jakub Narebski
2007-11-27 21:23 ` Steven Grimm
2007-11-28 1:19 ` Junio C Hamano
2007-11-28 2:40 ` Steven Grimm
2007-11-28 3:25 ` Daniel Barkalow
2007-11-28 3:49 ` Junio C Hamano
2007-11-28 5:20 ` Steven Grimm
2007-11-28 16:10 ` Jeff King
2007-11-28 19:00 ` Junio C Hamano
2007-11-28 19:41 ` Steven Grimm
2007-11-28 19:49 ` Jeff King
2007-11-28 20:16 ` Steven Grimm
2007-11-28 20:22 ` Jeff King
2007-11-28 22:01 ` Junio C Hamano
2007-11-28 22:14 ` [PATCH v3] " Steven Grimm
2007-11-28 23:03 ` Jeff King
2007-11-28 23:42 ` Junio C Hamano
2007-11-29 6:44 ` Steven Grimm
2007-11-30 1:06 ` Junio C Hamano
2007-12-02 21:22 ` [PATCH v4] " Steven Grimm
2007-12-02 21:56 ` Junio C Hamano
2007-12-03 2:13 ` Jeff King
2007-12-03 2:16 ` Junio C Hamano
2007-12-03 3:45 ` Junio C Hamano [this message]
2007-12-05 22:14 ` Steven Grimm
2007-12-05 22:19 ` Junio C Hamano
2007-12-05 22:29 ` Junio C Hamano
2007-12-06 5:57 ` Jeff King
2007-12-06 6:30 ` Junio C Hamano
2007-12-06 6:36 ` Jeff King
2007-12-06 7:50 ` Steven Grimm
2007-12-03 4:01 ` Shawn O. Pearce
2007-12-03 5:25 ` Junio C Hamano
2007-12-04 1:55 ` Shawn O. Pearce
2007-12-03 11:47 ` Johannes Schindelin
2007-12-04 1:51 ` Shawn O. Pearce
2007-12-04 2:12 ` Johannes Schindelin
2007-12-04 2:20 ` Shawn O. Pearce
2007-12-04 2:25 ` Johannes Schindelin
2007-12-04 2:33 ` Steven Grimm
2007-12-04 2:34 ` Shawn O. Pearce
2007-11-28 21:49 ` [PATCH] " Junio C Hamano
2007-11-28 22:37 ` Jeff King
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=7vr6i4qw4s.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=koreth@midwinter.com \
--cc=peff@peff.net \
/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).