Permalink
Commits on Feb 22, 2017
  1. Merge branch 'rl/remote-allow-missing-branch-name-merge' into next

    "git remote rm X", when a branch has remote X configured as the
    value of its branch.*.remote, tried to remove branch.*.remote and
    branch.*.merge and failed if either is unset.
    
    * rl/remote-allow-missing-branch-name-merge:
      remote: ignore failure to remove missing branch.<name>.merge
    gitster committed Feb 22, 2017
  2. Merge branch 'bc/worktree-doc-fix-detached' into next

    Doc update.
    
    * bc/worktree-doc-fix-detached:
      Documentation: correctly spell git worktree --detach
    gitster committed Feb 22, 2017
  3. Merge branch 'rt/align-add-i-help-text' into next

    Doc update.
    
    * rt/align-add-i-help-text:
      git add -i: replace \t with blanks in the help message
    gitster committed Feb 22, 2017
  4. Merge branch 'bc/blame-doc-fix' into next

    Doc update.
    
    * bc/blame-doc-fix:
      Documentation: use brackets for optional arguments
    gitster committed Feb 22, 2017
  5. git add -i: replace \t with blanks in the help message

    Within the help message of 'git add -i', the 'diff' command uses one
    tab character and blanks to create the space between the name and the
    description while the others use blanks only.  So if the tab size is
    not at 4 characters, this description will not be in range.
    Replace the tab character with blanks.
    
    Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    ralfth committed with gitster Feb 22, 2017
  6. Documentation: use brackets for optional arguments

    The documentation for git blame used vertical bars for optional
    arguments to -M and -C, which is unusual and potentially confusing.
    Since most man pages use brackets for optional items, and that's
    consistent with how we document the same options for git diff and
    friends, use brackets here, too.
    
    Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    bk2204 committed with gitster Feb 22, 2017
  7. Documentation: correctly spell git worktree --detach

    The option is “--detach”, but we accidentally spelled it “--detached” at
    one point in the man page.
    
    Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
    Reported-by: Casey Rodarmor <casey@rodarmor.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    bk2204 committed with gitster Feb 22, 2017
  8. Merge branch 'jc/config-case-cmdline' into next

    * jc/config-case-cmdline:
      config: squelch stupid compiler
    gitster committed Feb 22, 2017
Commits on Feb 21, 2017
  1. config: squelch stupid compiler

    Some compilers do not realize that *cp is always '.' when the loop
    to find the last dot begins, and instead gives a useless warning
    that says last_dot may be uninitialized.
    
    Squelch it by being a bit more explicit if stupid.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    gitster committed Feb 21, 2017
  2. remote: ignore failure to remove missing branch.<name>.merge

    It is not all too unusual for a branch to use "branch.<name>.remote"
    without "branch.<name>.merge".  You may be using the 'push.default'
    configuration set to 'current', for example, and do
    
        $ git checkout -b side colleague/side
        $ git config branch.side.remote colleague
    
    However, "git remote rm" to remove the remote used in such a manner
    fails with
    
        "fatal: could not unset 'branch.<name>.merge'"
    
    because it assumes that a branch that has .remote defined must also
    have .merge defined.  Detect the "cannot unset because it is not set
    to begin with" case and ignore it.
    
    Signed-off-by: Ross Lagerwall <rosslagerwall@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    rosslagerwall committed with gitster Feb 18, 2017
  3. Merge branch 'sk/parse-remote-cleanup' into next

    Code clean-up.
    
    * sk/parse-remote-cleanup:
      Revert "parse-remote: remove reference to unused op_prep"
    gitster committed Feb 21, 2017
  4. Merge branch 'jc/config-case-cmdline' into next

    The code to parse "git -c VAR=VAL cmd" and set configuration
    variable for the duration of cmd had two small bugs, which have
    been fixed.
    
    * jc/config-case-cmdline:
      config: reject invalid VAR in 'git -c VAR=VAL command'
      config: preserve <subsection> case for one-shot config on the command line
    gitster committed Feb 21, 2017
  5. Merge branch 'vn/xdiff-func-context' into next

    "git diff -W" has been taught to handle the case where a new
    function is added at the end of the file better.
    
    * vn/xdiff-func-context:
      xdiff -W: relax end-of-file function detection
    gitster committed Feb 21, 2017
  6. Merge branch 'km/delete-ref-reflog-message' into next

    "git update-ref -d" and other operations to delete references did
    not leave any entry in HEAD's reflog when the reference being
    deleted was the current branch.  This is not a problem in practice
    because you do not want to delete the branch you are currently on,
    but caused renaming of the current branch to something else not to
    be logged in a useful way.
    
    * km/delete-ref-reflog-message:
      branch: record creation of renamed branch in HEAD's log
      rename_ref: replace empty message in HEAD's log
      update-ref: pass reflog message to delete_ref()
      delete_ref: accept a reflog message argument
    gitster committed Feb 21, 2017
  7. Merge branch 'dr/doc-check-ref-format-normalize' into next

    Doc update.
    
    * dr/doc-check-ref-format-normalize:
      git-check-ref-format: clarify documentation for --normalize
    gitster committed Feb 21, 2017
  8. Merge branch 'gp/document-dotfiles-in-templates-are-not-copied' into …

    …next
    
    Doc update.
    
    * gp/document-dotfiles-in-templates-are-not-copied:
      init: document dotfiles exclusion on template copy
    gitster committed Feb 21, 2017
  9. Merge branch 'jk/tempfile-ferror-fclose-confusion' into next

    A caller of tempfile API that uses stdio interface to write to
    files may ignore errors while writing, which is detected when
    tempfile is closed (with a call to ferror()).  By that time, the
    original errno that may have told us what went wrong is likely to
    be long gone and was overwritten by an irrelevant value.
    close_tempfile() now resets errno to EIO to make errno at least
    predictable.
    
    * jk/tempfile-ferror-fclose-confusion:
      tempfile: set errno to a known value before calling ferror()
    gitster committed Feb 21, 2017
  10. Merge branch 'lt/oneline-decoration-at-end' into next

    The output from "git log --oneline --decorate" has been updated to
    show the extra information at the end of the line, not near the
    front.
    
    * lt/oneline-decoration-at-end:
      log: fix regression to "--source" when "--decorate" was updated
    gitster committed Feb 21, 2017
  11. config: reject invalid VAR in 'git -c VAR=VAL command'

    The parsing of one-shot assignments of configuration variables that
    come from the command line historically was quite loose and allowed
    anything to pass.
    
    The configuration variable names that come from files are validated
    in git_config_parse_source(), which uses get_base_var() that grabs
    the <section> (and subsection) while making sure that <section>
    consists of iskeychar() letters, the function itself that makes sure
    that the first letter in <variable> is isalpha(), and get_value()
    that grabs the remainder of the <variable> name while making sure
    that it consists of iskeychar() letters.
    
    Perform an equivalent check in canonicalize_config_variable_name()
    to catch invalid configuration variable names that come from the
    command line.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    gitster committed Feb 21, 2017
  12. Revert "parse-remote: remove reference to unused op_prep"

    This reverts commit 1a7e780,
    because we have no way of knowing how many third-party scripts
    dot-source this scriptlet and rely on the current behaviour.
    
    Without first breaking them, that is.  Breaking them first and
    having to deal with fallout is not worth our effort.  The only thing
    leaving this otherwise unused parameter in may hurt is the
    performance, which does not matter in this error codepath.
    gitster committed Feb 21, 2017
  13. git-check-ref-format: clarify documentation for --normalize

    Use of 'iff' may be confusing to people not familiar with this term.
    
    Improving the --normalize option's documentation to remove the use of
    'iff', and clearly describe what happens when the condition is not met.
    
    Signed-off-by: Damien Regad <dregad@mantisbt.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    dregad committed with gitster Feb 19, 2017
  14. log: fix regression to "--source" when "--decorate" was updated

    Split out the logic to show "--source" from showing "--decorate"
    annotation into a separate show_source() helper.  Most of the time
    this is called immediately before show_decorations(), but the oneline
    output format is a special case that requires us to be able to show
    the decorations alone at the very end while showing the source before
    the message.
    
    This allows us to revert the change to t4202 in the previous step,
    which expected the regressed output for "--source".
    
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    torvalds committed with gitster Feb 11, 2017
  15. config: preserve <subsection> case for one-shot config on the command…

    … line
    
    The "git -c <var>=<val> cmd" mechanism is to pretend that a
    configuration variable <var> is set to <val> while the cmd is
    running.  The code to do so however downcased <var> in its entirety,
    which is wrong for a three-level <section>.<subsection>.<variable>.
    
    The <subsection> part needs to stay as-is.
    
    Reported-by: Lars Schneider <larsxschneider@gmail.com>
    Diagnosed-by: Jonathan Tan <jonathantanmy@google.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    gitster committed Feb 15, 2017
  16. Sync with master

    * master:
      git-svn: escape backslashes in refnames
    gitster committed Feb 21, 2017
  17. branch: record creation of renamed branch in HEAD's log

    Renaming the current branch adds an event to the current branch's log
    and to HEAD's log.  However, the logged entries differ.  The entry in
    the branch's log represents the entire renaming operation (the old and
    new hash are identical), whereas the entry in HEAD's log represents
    the deletion only (the new sha1 is null).
    
    Extend replace_each_worktree_head_symref(), whose only caller is
    branch_rename(), to take a reflog message argument.  This allows the
    creation of the new ref to be recorded in HEAD's log.  As a result,
    the renaming event is represented by two entries (a deletion and a
    creation entry) in HEAD's log.
    
    It's a bit unfortunate that the branch's log and HEAD's log now
    represent the renaming event in different ways.  Given that the
    renaming operation is not atomic, the two-entry form is a more
    accurate representation of the operation and is more useful for
    debugging purposes if a failure occurs between the deletion and
    creation events.  It would make sense to move the branch's log to the
    two-entry form, but this would involve changes to how the rename is
    carried out and to how the update flags and reflogs are processed for
    deletions, so it may not be worth the effort.
    
    Based-on-patch-by: Jeff King <peff@peff.net>
    Signed-off-by: Kyle Meyer <kyle@kyleam.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    kyleam committed with gitster Feb 21, 2017
  18. rename_ref: replace empty message in HEAD's log

    When the current branch is renamed, the deletion of the old ref is
    recorded in HEAD's log with an empty message.  Now that delete_ref()
    accepts a reflog message, provide a more descriptive message by
    passing along the log message that is given to rename_ref().
    
    The next step will be to extend HEAD's log to also include the second
    part of the rename, the creation of the new branch.
    
    Helped-by: Jeff King <peff@peff.net>
    Signed-off-by: Kyle Meyer <kyle@kyleam.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    kyleam committed with gitster Feb 21, 2017
  19. update-ref: pass reflog message to delete_ref()

    Now that delete_ref() accepts a reflog message, pass the user-provided
    message to delete_ref() rather than silently dropping it.
    
    Signed-off-by: Kyle Meyer <kyle@kyleam.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    kyleam committed with gitster Feb 21, 2017
  20. delete_ref: accept a reflog message argument

    When the current branch is renamed with 'git branch -m/-M' or deleted
    with 'git update-ref -m<msg> -d', the event is recorded in HEAD's log
    with an empty message.  In preparation for adding a more meaningful
    message to HEAD's log in these cases, update delete_ref() to take a
    message argument and pass it along to ref_transaction_delete().
    Modify all callers to pass NULL for the new message argument; no
    change in behavior is intended.
    
    Note that this is relevant for HEAD's log but not for the deleted
    ref's log, which is currently deleted along with the ref.  Even if it
    were not, an entry for the deletion wouldn't be present in the deleted
    ref's log.  files_transaction_commit() writes to the log if
    REF_NEEDS_COMMIT or REF_LOG_ONLY are set, but lock_ref_for_update()
    doesn't set REF_NEEDS_COMMIT for the deleted ref because REF_DELETING
    is set.  In contrast, the update for HEAD has REF_LOG_ONLY set by
    split_head_update(), resulting in the deletion being logged.
    
    Signed-off-by: Kyle Meyer <kyle@kyleam.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    kyleam committed with gitster Feb 21, 2017
  21. Merge branch 'svn-escape-backslash' of git://bogomips.org/git-svn

    * 'svn-escape-backslash' of git://bogomips.org/git-svn:
      git-svn: escape backslashes in refnames
    gitster committed Feb 21, 2017
Commits on Feb 17, 2017
  1. init: document dotfiles exclusion on template copy

    Not just . and .., but any path that begins with dot is not copied
    when copying the template directory to a new repository.  You can
    customize the template directory, copying some dotfiles might make
    sense, but it's actually a good thing not to, because you would not
    want to have your git directory copied in every git directory that
    is created should you decide to put your template directory under
    version control, for example.  Plus, it might be used as a feature
    by people who would want to exclude some files.
    
    Signed-off-by: Grégoire Paris <postmaster@greg0ire.fr>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    Grégoire Paris committed with gitster Feb 17, 2017
  2. Sync with Git 2.12-rc2

    gitster committed Feb 17, 2017
  3. Merge branch 'js/git-path-in-subdir' into next

    The "--git-path", "--git-common-dir", and "--shared-index-path"
    options of "git rev-parse" did not produce usable output.  They are
    now updated to show the path to the correct file, relative to where
    the caller is.
    
    * js/git-path-in-subdir:
      rev-parse: fix several options when running in a subdirectory
      rev-parse tests: add tests executed from a subdirectory
    gitster committed Feb 17, 2017
  4. Merge branch 'mm/two-more-xstrfmt' into next

    Code clean-up and a string truncation fix.
    
    * mm/two-more-xstrfmt:
      bisect_next_all: convert xsnprintf to xstrfmt
      stop_progress_msg: convert xsnprintf to xstrfmt
    gitster committed Feb 17, 2017
  5. tempfile: set errno to a known value before calling ferror()

    In close_tempfile(), we return an error if ferror()
    indicated a previous failure, or if fclose() failed. In the
    latter case, errno is set and it is useful for callers to
    report it.
    
    However, if _only_ ferror() triggers, then the value of
    errno is based on whatever syscall happened to last fail,
    which may not be related to our filehandle at all. A caller
    cannot tell the difference between the two cases, and may
    use "die_errno()" or similar to report a nonsense errno value.
    
    One solution would be to actually pass back separate return
    values for the two cases, so a caller can write a more
    appropriate message for each case. But that makes the
    interface clunky.
    
    Instead, let's just set errno to the generic EIO in this case.
    That's not as descriptive as we'd like, but at least it's
    predictable. So it's better than the status quo in all cases
    but one: when the last syscall really did involve a failure
    on our filehandle, we'll be wiping that out. But that's a
    fragile thing for us to rely on.
    
    In any case, we'll let the errno result from fclose() take
    precedence over our value, as we know that's recent and
    accurate (and many I/O errors will persist through the
    fclose anyway).
    
    Signed-off-by: Jeff King <peff@peff.net>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    peff committed with gitster Feb 17, 2017
  6. Git 2.12-rc2

    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    gitster committed Feb 17, 2017