From: David Kastrup <dak@gnu•org>
To: Patrick Donnelly <batrick@batbytes•com>
Cc: Git <git@vger•kernel.org>
Subject: Re: reject "backwards" merges
Date: Sat, 13 Dec 2014 10:47:29 +0100 [thread overview]
Message-ID: <877fxvdgpa.fsf@fencepost.gnu.org> (raw)
In-Reply-To: <CACh33FqHindeksHv7wcgu983oBSbm5G0ZswrQdTAz5tqgZdgjQ@mail.gmail.com> (Patrick Donnelly's message of "Fri, 12 Dec 2014 13:40:29 -0500")
Patrick Donnelly <batrick@batbytes•com> writes:
> Is there a way to reject pushes that change the history of
> first-parents, caused by a "backwards" merge? To clarify by example
> (using branches instead of separate repositories):
>
> Here the desired first parent (HEAD^) would be commit
> 9cb303e2578af305d688abf62570ef31f3f113da. Unfortunately, the incorrect
> merge reversed the line of parents. Is there a way to prevent this
> from happening (via git-config) other than fixing the human?
You'd have to do this in a push hook. Before pushing, Git does not
really have a way to figure out which kind of branch a merge will land
on.
Most "reversed merges" probably come into being by having a fast-forward
in a series of zig-zagged merges. Naturally the history before the
fast-forward can only be "the right way round" for one of the two
branches.
--
David Kastrup
prev parent reply other threads:[~2014-12-13 10:45 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-12 18:40 reject "backwards" merges Patrick Donnelly
2014-12-13 9:47 ` David Kastrup [this message]
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=877fxvdgpa.fsf@fencepost.gnu.org \
--to=dak@gnu$(echo .)org \
--cc=batrick@batbytes$(echo .)com \
--cc=git@vger$(echo .)kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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