git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* disallowing non-trivial merges on integration branches
@ 2010-12-15 18:27 Adam Monsen
  2010-12-15 22:04 ` Vallon, Justin
  0 siblings, 1 reply; 2+ messages in thread
From: Adam Monsen @ 2010-12-15 18:27 UTC (permalink / raw)
  To: git

Does anyone have or want to help with a hook script to prevent trivial merges?

Here's some context:

I'm using the phrase "trivial merge" to refer to a merge without conflicts, 
like, when two distinct files are edited.

In the Mifos project, the "head" repo at sf.net--for all intents and purposes--
is the authoritative place to find Mifos source code. At my request, many of the 
devs pushing to "head" have started using rebase more often than merge when 
their local copy of a branch diverges from the corresponding remote[1] (for 
example, I commit to my "master", but must fetch then merge or rebase before 
pushing to origin/master). Liberal use of rebase has really cleaned up our 
version history graph... it's much easier to see what was pushed and when, and 
the progression of patches. Trivial merges just don't add anything helpful to 
the commit history graph, IMHO. Non-trivial merges are of course still allowed. 
Rebasing commits extant in the "head" repo at sf.net is disallowed.

I've been working on a hook script[2] to disallow trivial merges to further 
enforce our policy. Well, really I'm just working on the test suite[3], another 
guy (also named Adam, coincidentally) is working on the hook script.

A blocking bug with the hook script (might be a design flaw) is that it prevents 
non-trivial merges.

Wanna help fix it?

I don't understand the hook script... is it doing something that makes sense?

This was my first time writing a test harness in Bash script. Kinda fun, 
actually. Git certainly lends well to scripting, and it feels intentional. Good 
stuff.

References (links) from the above email:
1. http://article.gmane.org/gmane.comp.finance.mifos.devel/9597
2. http://stackoverflow.com/questions/4138285
3. https://gist.github.com/737842

^ permalink raw reply	[flat|nested] 2+ messages in thread

* RE: disallowing non-trivial merges on integration branches
  2010-12-15 18:27 disallowing non-trivial merges on integration branches Adam Monsen
@ 2010-12-15 22:04 ` Vallon, Justin
  0 siblings, 0 replies; 2+ messages in thread
From: Vallon, Justin @ 2010-12-15 22:04 UTC (permalink / raw)
  To: 'Adam Monsen', git@vger.kernel.org

My two cents:

* Rebase is evil (grab your pitchforks!).

* One thing that I have found is that if you fetch/merge --no-ff in the authoritative repo, then you actually end up with a better graph.  Why?  If you allow fast-forward to the contributor, then in the case of a trivial merge on the contributor branch, the contributor will have merged master *into* the contributor branch, making the contributor the left-parent, and the master the right-parent.  If you 'merge --no-ff', then you insure that in the merge on master, the left-parent is master, and the right-parent is your contributor.  Then, you should be able to follow left-parents to trace your mainline.  Not sure if that would help your gitk graph.

* It sounds like you have a problem following the merges.  Maybe the grapher needs to be enhanced?

-- 
-Justin


-----Original Message-----
From: git-owner@vger.kernel.org [mailto:git-owner@vger.kernel.org] On Behalf Of Adam Monsen
Sent: Wednesday, December 15, 2010 1:27 PM
To: git@vger.kernel.org
Subject: disallowing non-trivial merges on integration branches

Does anyone have or want to help with a hook script to prevent trivial merges?

Here's some context:

I'm using the phrase "trivial merge" to refer to a merge without conflicts, 
like, when two distinct files are edited.

In the Mifos project, the "head" repo at sf.net--for all intents and purposes--
is the authoritative place to find Mifos source code. At my request, many of the 
devs pushing to "head" have started using rebase more often than merge when 
their local copy of a branch diverges from the corresponding remote[1] (for 
example, I commit to my "master", but must fetch then merge or rebase before 
pushing to origin/master). Liberal use of rebase has really cleaned up our 
version history graph... it's much easier to see what was pushed and when, and 
the progression of patches. Trivial merges just don't add anything helpful to 
the commit history graph, IMHO. Non-trivial merges are of course still allowed. 
Rebasing commits extant in the "head" repo at sf.net is disallowed.

I've been working on a hook script[2] to disallow trivial merges to further 
enforce our policy. Well, really I'm just working on the test suite[3], another 
guy (also named Adam, coincidentally) is working on the hook script.

A blocking bug with the hook script (might be a design flaw) is that it prevents 
non-trivial merges.

Wanna help fix it?

I don't understand the hook script... is it doing something that makes sense?

This was my first time writing a test harness in Bash script. Kinda fun, 
actually. Git certainly lends well to scripting, and it feels intentional. Good 
stuff.

References (links) from the above email:
1. http://article.gmane.org/gmane.comp.finance.mifos.devel/9597
2. http://stackoverflow.com/questions/4138285
3. https://gist.github.com/737842


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-12-15 22:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-15 18:27 disallowing non-trivial merges on integration branches Adam Monsen
2010-12-15 22:04 ` Vallon, Justin

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).