Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: git/git
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 480e78595e
Choose a base ref
...
head repository: git/git
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 508fd8e8ba
Choose a head ref
  • 10 commits
  • 52 files changed
  • 3 contributors

Commits on Jun 24, 2020

  1. fmt-merge-msg: stop treating master specially

    In the context of many projects renaming their primary branch names away
    from `master`, Git wants to stop treating the `master` branch specially.
    
    Let's start with `git fmt-merge-msg`.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    dscho authored and gitster committed Jun 24, 2020
    Configuration menu
    Copy the full SHA
    489947c View commit details
    Browse the repository at this point in the history
  2. send-pack/transport-helper: avoid mentioning a particular branch

    When trying to push all matching branches, but none match, we offer a
    message suggesting to push the `master` branch.
    
    However, we want to step away from making that branch any more special
    than any other branch, so let's reword that message to mention no branch
    in particular.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    dscho authored and gitster committed Jun 24, 2020
    Configuration menu
    Copy the full SHA
    4d04658 View commit details
    Browse the repository at this point in the history
  3. submodule: fall back to remote's HEAD for missing remote.<name>.branch

    When `remote.<name>.branch` is not configured, `git submodule update`
    currently falls back to using the branch name `master`. A much better
    idea, however, is to use the remote `HEAD`: on all Git servers running
    reasonably recent Git versions, the symref `HEAD` points to the main
    branch.
    
    Note: t7419 demonstrates that there _might_ be use cases out there that
    _expect_ `git submodule update --remote` to update submodules to the
    remote `master` branch even if the remote `HEAD` points to another
    branch. Arguably, this patch makes the behavior more intuitive, but
    there is a slight possibility that this might cause regressions in
    obscure setups.
    
    Even so, it should be okay to fix this behavior without anything like a
    longer transition period:
    
    - The `git submodule update --remote` command is not really common.
    
    - Current Git's behavior when running this command is outright
      confusing, unless the remote repository's current branch _is_ `master`
      (in which case the proposed behavior matches the old behavior).
    
    - If a user encounters a regression due to the changed behavior, the fix
      is actually trivial: setting `submodule.<name>.branch` to `master`
      will reinstate the old behavior.
    
    Helped-by: Philippe Blain <levraiphilippeblain@gmail.com>
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    dscho authored and gitster committed Jun 24, 2020
    Configuration menu
    Copy the full SHA
    f0a96e8 View commit details
    Browse the repository at this point in the history
  4. docs: add missing diamond brackets

    There were a couple of instances in our manual pages that had an
    opening diamond bracket without a corresponding closing one.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    dscho authored and gitster committed Jun 24, 2020
    2 Configuration menu
    Copy the full SHA
    6069ecc View commit details
    Browse the repository at this point in the history
  5. init: allow specifying the initial branch name for the new repository

    There is a growing number of projects and companies desiring to change
    the main branch name of their repositories (see e.g.
    https://twitter.com/mislav/status/1270388510684598272 for background on
    this).
    
    To change that branch name for new repositories, currently the only way
    to do that automatically is by copying all of Git's template directory,
    then hard-coding the desired default branch name into the `.git/HEAD`
    file, and then configuring `init.templateDir` to point to those copied
    template files.
    
    To make this process much less cumbersome, let's introduce a new option:
    `--initial-branch=<branch-name>`.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    dscho authored and gitster committed Jun 24, 2020
    Configuration menu
    Copy the full SHA
    32ba12d View commit details
    Browse the repository at this point in the history
  6. init: allow setting the default for the initial branch name via the c…

    …onfig
    
    We just introduced the command-line option
    `--initial-branch=<branch-name>` to allow initializing a new repository
    with a different initial branch than the hard-coded one.
    
    To allow users to override the initial branch name more permanently
    (i.e. without having to specify the name manually for each and every
    `git init` invocation), let's introduce the `init.defaultBranch` config
    setting.
    
    Helped-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    Helped-by: Derrick Stolee <dstolee@microsoft.com>
    Signed-off-by: Don Goodman-Wilson <don@goodman-wilson.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    Don Goodman-Wilson authored and gitster committed Jun 24, 2020
    Configuration menu
    Copy the full SHA
    8747ebb View commit details
    Browse the repository at this point in the history
  7. clone: use configured default branch name when appropriate

    When cloning a repository without any branches, Git chooses a default
    branch name for the as-yet unborn branch.
    
    As part of the implicit initialization of the local repository, Git just
    learned to respect `init.defaultBranch` to choose a different initial
    branch name. We now really want that branch name to be used as a
    fall-back.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    dscho authored and gitster committed Jun 24, 2020
    Configuration menu
    Copy the full SHA
    0cc1b47 View commit details
    Browse the repository at this point in the history
  8. remote: use the configured default branch name when appropriate

    When guessing the default branch name of a remote, and there are no refs
    to guess from, we want to go with the preference specified by the user
    for the fall-back, i.e. the default name to be used for the initial
    branch of new repositories (because as far as the user is concerned, a
    remote that has no branches yet is a new repository).
    
    At the same time, when talking to an older Git server that does not
    report a symref for `HEAD` (but instead reports a commit hash), let's
    try to guess the configured default branch name first. If it does not
    match the reported commit hash, let's fall back to `master` as before.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    dscho authored and gitster committed Jun 24, 2020
    Configuration menu
    Copy the full SHA
    a471214 View commit details
    Browse the repository at this point in the history
  9. testsvn: respect init.defaultBranch

    The default name of the initial branch in new repositories can now be
    configured. The `testsvn` remote helper translates the remote Subversion
    repository's branch name `trunk` to the hard-coded name `master`.
    Clearly, the intention was to make the name align with Git's defaults.
    
    So while we are not talking about a newly-created repository in the
    `testsvn` context, it is a newly-created _Git_ repository, si it _still_
    makes sense to use the overridden default name for the initial branch
    whenever users configured it.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    dscho authored and gitster committed Jun 24, 2020
    Configuration menu
    Copy the full SHA
    0068f21 View commit details
    Browse the repository at this point in the history

Commits on Jun 30, 2020

  1. contrib: subtree: adjust test to change in fmt-merge-msg

    We're starting to stop treating `master' specially in fmt-merge-msg.
    Adjust the test to reflect that change.
    
    Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    sgn authored and gitster committed Jun 30, 2020
    Configuration menu
    Copy the full SHA
    508fd8e View commit details
    Browse the repository at this point in the history
Loading