git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] "master" should be treated no differently from any other branch

From
Junio C Hamano <junkio@cox.net>
Date
Dec 15, 2006, 21:55 UTC
Message-ID
<7vbqm4omdd.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<458179B4.7020408@brefemail.com>
Jerome Lovy <t2a2e9z8ncbs9qg@brefemail.com> writes:
Show 16 quoted lines
> Johannes Schindelin wrote:
>> On Thu, 14 Dec 2006, Andy Parkins wrote:
>>
>>> "master" shouldn't get special treatment; making different log
>>> messages based on the name of the branch is bad form.  What if a
>>> user likes "my/master" or "my/head" as their master branch?
>>
>> I do not agree. There is usually a principal branch, where you
>> collect the topics, and you do want to treat that special. As for
>> the name: better have a convention here than configurability. You
>> would not want "git" to be called "guitar" for some users, just
>> because they happen to like that name more, either, right?
>
> because I like the pattern framework described in the book "Software
> Configuration Management Patterns", I like to use "mainline" instead
> of "master", for example.

Tough. Like it or not, 'master' has been the name of the default branch since very early days of git (May 30, 2005).

I think you guys are barking up the wrong tree. I do not agree it is wrong to treat the principal branch (or branches, such as my 'master' and 'maint', or Jeff's 'ALL' and 'upstream') in a different way from other branches.

Quite the opposite. It is a wonderful thing for something like fmt-merge-message.

The recommended workflow when you have topic branches is to cook new things in the topics and merge them into principal branches, and never merge the other way or across topics unless you absolutely need to (i.e. the topic's evolution depends on something new in your principal branches or another topic). So merging into your principal branch is a normal event and giving short message makes tons of sense, while merging into a topic is an abnormal situation that warrants "into this-topic" along with an explanation why that unusual cross merge was needed.

What we could improve is to allow people to use different names other than 'master' for their principal branches, to help use of words like 'mainline' and 'upstream'. We can have a new configuration under "branch.*" namespace to mark branches that tells fmt-merge-msg to drop "into branch" part from its output.

When you have more than one principal branches, it may be useful be able to tell which principal branch was merged into with a particular merge, and in such a situation, you may want your config to tell fmt-merge-msg not to drop "into branch" for any branch.

On this "master is not special" topic, I would accept the 'status' patch that always makes it to say "on this branch" for all branches, but this is not because 'master' is not special.

Committing on principal branches and committing on topic branches both happen as a normal event, and I think it is not unusual to have more than one principal branches in an advanced usage scenario. It is very prudent thing to remind the user what branch he is on, so that he can tell he is about to make a commit on a wrong branch.

Previous: Jerome LovyNext: Andy Parkins
Message 10 of 21 in “"master" should be treated no differently from any other branch”
  1. "master" should be treated no differently from any other branchAndy Parkins, Dec 14, 2006
  2. Johannes SchindelinDec 14, 2006
  3. Han-Wen NienhuysDec 14, 2006
  4. Johannes SchindelinDec 14, 2006
  5. Han-Wen NienhuysDec 14, 2006
  6. Johannes SchindelinDec 14, 2006
  7. Jakub NarebskiDec 15, 2006
  8. Nicolas PitreDec 14, 2006
  9. Jerome LovyDec 14, 2006
  10. Junio C HamanoDec 15, 2006
  11. Andy ParkinsDec 14, 2006
  12. Andy ParkinsDec 14, 2006
  13. Johannes SchindelinDec 14, 2006
  14. John W. LinvilleDec 14, 2006
  15. Robin RosenbergDec 14, 2006
  16. Junio C HamanoDec 14, 2006
  17. Andy ParkinsDec 14, 2006
  18. Junio C HamanoDec 14, 2006
  19. Andy ParkinsDec 14, 2006
  20. Shawn PearceDec 14, 2006
  21. Jakub NarebskiDec 15, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.