Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6036533
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T05:56:18+00:00 2026-05-23T05:56:18+00:00

For a small software development I would like changes to follow a defined process,

  • 0

For a small software development I would like changes to follow a defined process, whereby an integration branch would contain only “complete” changes. The idea stems from a post on my blog about getting useful history logs from Mercurial. However this isn’t just about generating logs, but about a structured way of working.

In summary the idea is that a repository would have an “integration” branch which would not be directly developed on, instead any work would be carried out on another branch, and when complete would be merged into the integration branch – below is a rough example, with commit comments in braces:

  O   {Implemented new feature X}
  |\
  | O {...}
  | |
  | O {...}
  |/
  O   {Fixed bug 002}
  |\
  | O {...}
  |/
  O   {added tag "Release 1.0"}
  |
  O   {Fixed bug 001}
  |\
  | O {...}
  |/
  O  -- integration branch
 /
O  -- default branch

The “integration” branch would only allow being merged-to and tagged.

This is similar to how we do development at work (on a server-based non-DVCS system), where you make changes on your work branch, and when complete (and reviewed, tested, …) you merge those changes into an integration branch, for formal test and release.

Anyway, my question is – how would I enforce the policy of making changes only on a work branch, while on the integration branch we only allow merging or tagging?

My initial thought is to add a hook on pre-commit (not precommit or pretxncommit, as I believe these get fired when you, for example, create a tag). The hook would check that, if you were on the integration branch, there are two parents, meaning this is the result of a merge, and fail if that wasn’t the case.

However as I understand it, the hooks are not copied when you clone a repository. As this would be a project-specific setting it shouldn’t be set at the user-level. So how would I stop a user from cloning the repository (thus losing the hooks), making changes directly on the integration branch, and then pushing?

hg clone main_repo
hg update integration_branch
(make changes without starting a new branch)
hg commit -m "I made some changes"
hg push

Also, how could I enforce this when using a system such as Bitbucket?

Alternatively, is this not the correct approach to a workflow when using a DVCS?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T05:56:19+00:00Added an answer on May 23, 2026 at 5:56 am

    I think you said you want a “structured way of working”, and so I wonder if what you are looking for instead, is code lieutenants. That means that the door is locked from the inside, and only the lieutenant opens it, and code hits the central repo, only when the lieutenant pulls it in. Code that has been through your approval process is pulled into a central or authoritative repository, which is a “structured way of working”.

    By talking about denying write to a branch only in a repo, instead of denying write to the entire central repo, It sounds to me almost like you’re asking how can you take away the DVCS’s #1 great attribute, which (a) that there is not just one copy, and that each copy can have its own read/write access rules, one of those copies is the central one if you like it to be so, and (b) that commits are separate from inflicting them on anyone else. A commit is a local working copy action. It is not until these commits hit the authoritative repository, either the central one, or the one managed by your code lietenant, that you have even made a real change, under this controlled process, using DVCS.

    Or are you thinking that users shouldn’t even commit into their own working DVCS local instances, without making branches?

    In short, you could say, each local machine’s working copy IS A BRANCH, an invisible branch, not inflicted on anyone, or even named, until it is polled by the lieutenant who will do the code review, and integration test the entire changeset, which is functionally equivalent to what you might have called a “feature branch” in a CVCS. Those invisible branches are all writeable, and the central repo (not a branch, separate REPO) is read only by virtue of how it is set up; users can sync from it, but not push to it, except the lieutenant who pulls new changes into it. Fundamentally stable, but still everybody can get work done.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to know how can I set up a development environment at
My company releases a small software product for which I've recently been taking over
I have a small JS function that does Ajax for me and another like
I have a small local network. Only one of the machines is available to
What resources do you know dedicated to software development in C for PIC microcontrollers?
I am a beginner at software development and web site development. I love using
Context: I work at a small software company that has traditionally done research-type work,
We work with a small development team and a system engineer who deploys the
We're a small software company that has been using CVS and SVN for version
I'm developing certain scripts and small software packages which I also package as debian

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.