From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Andrew Ardill <andrew.ardill@gmail.com>,
"git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: Gated Merge?
Date: Fri, 12 Feb 2016 14:00:17 -0500 [thread overview]
Message-ID: <20160212190017.GA20801@sigill.intra.peff.net> (raw)
In-Reply-To: <xmqqr3ghvn6a.fsf@gitster.mtv.corp.google.com>
On Fri, Feb 12, 2016 at 09:44:13AM -0800, Junio C Hamano wrote:
> Andrew Ardill <andrew.ardill@gmail.com> writes:
>
> > What is the benefit in doing this in notes vs having the tests in the
> > working tree?
>
> Interesting. I have never thought of adding this information to the
> project history proper---I've viewed this as primarily an aid for
> keeping track of topics in-flight by an individual, i.e. something
> that the rest of the project do not want to even see.
After reading Andrew's message, I wondered if these are really any
different than regular tests at all.
Let's say I implement feature X on a topic branch, and I add a
regression test for it. Once that is merged, now we have that regression
test forever[1], and any future topic branches that get merged from
master must pass that test or be rejected.
If I update the interface for foo(), it is the same thing. We do not
write a specific test for it, but we expect that the compiler will catch
any callers of the old foo, because the new tree carries the updated
definition that will not work with them (and we often structure our
interface refactoring exactly to catch such things).
So let's go back to your FORMAT_PRINT example. The topic changes all of
the format-attributes into FORMAT_PRINTF, but we never add a "test" that
says "now there are no more bare format-attributes, and if there are, it
is a regression".
But I don't think this needs to have anything to do with merges in
particular, or rules like "when merging a branch that does not have me
in it". It is about saying "from here on out, the tree state should
match this property, and we can test it by running this script". And
then running "make code-lint-tests" becomes part of the acceptance
testing for a proposed topic merge, just like "make test" is already
(and likewise, people forking _new_ branches from master after the topic
is merged would make sure they do not fail the code-lint tests before
even submitting the topic).
-Peff
[1] Of course it doesn't _have_ to be forever. We sometimes modify or
back out tests as new situations come up, and we could do the same for
these sorts of code-lint tests.
next prev parent reply other threads:[~2016-02-12 19:00 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-11 22:06 Gated Merge? Junio C Hamano
2016-02-11 22:42 ` Andrew Ardill
2016-02-11 23:53 ` Stefan Beller
2016-02-12 17:44 ` Junio C Hamano
2016-02-12 19:00 ` Jeff King [this message]
2016-02-12 19:06 ` Junio C Hamano
2016-02-12 19:26 ` 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=20160212190017.GA20801@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=andrew.ardill@gmail.com \
--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).