Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TEST #14

Closed
wants to merge 334 commits into from
Closed

TEST #14

wants to merge 334 commits into from
This pull request is big! We’re only showing the most recent 250 commits.

Commits on Aug 17, 2020

  1. shallow.txt: document SHA-256 shallow format

    Similar to recent commits, document that we list object names rather
    than SHA-1s.
    
    Signed-off-by: Martin Ågren <martin.agren@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    Martin Ågren authored and gitster committed Aug 17, 2020
    Configuration menu
    Copy the full SHA
    8afa50a View commit details
    Browse the repository at this point in the history
  2. refspec: fix documentation referring to refspec_item

    In commit d27eb35 ("remote: move doc to remote.h and refspec.h")
    the documentation for the refspec structure was moved into refspec.h
    
    This documentation refers to elements of the refspec_item, not the
    struct refspec. Move the documentation slightly in order to align it
    with the structure it is actually referring to.
    
    Signed-off-by: Jacob Keller <jacob.keller@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    jacob-keller authored and gitster committed Aug 17, 2020
    Configuration menu
    Copy the full SHA
    0becfec View commit details
    Browse the repository at this point in the history
  3. refspec: make sure stack refspec_item variables are zeroed

    A couple of functions that used struct refspec_item did not zero out the
    structure memory. This can result in unexpected behavior, especially if
    additional parameters are ever added to refspec_item in the future. Use
    memset to ensure that unset structure members are zero.
    
    It may make sense to convert most of these uses of struct refspec_item
    to use either struct initializers or refspec_item_init_or_die. However,
    other similar code uses memset. Converting all of these uses has been
    left as a future exercise.
    
    Signed-off-by: Jacob Keller <jacob.keller@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    jacob-keller authored and gitster committed Aug 17, 2020
    Configuration menu
    Copy the full SHA
    95e7c38 View commit details
    Browse the repository at this point in the history
  4. Documentation: mark --object-format=sha256 as experimental

    After eff45da ("repository: enable SHA-256 support by default",
    2020-07-29), vanilla builds of Git enable the user to run, e.g.,
    
      git init --object-format=sha256
    
    and hack away. This can be a good way to gain experience with the
    SHA-256 world, e.g., to find bugs that
    
      GIT_TEST_DEFAULT_HASH=sha256 make test
    
    doesn't spot.
    
    But it really is a separate world: Such SHA-256 repos will live entirely
    separate from the (by now fairly large) set of SHA-1 repos. Interacting
    across the border is possible in principle, e.g., through "diff + apply"
    (or "format-patch + am"), but even that has its limitations: Applying a
    SHA-256 diff in a SHA-1 repo works in the simple case, but if you need
    to resort to `-3`, you're out of luck.
    
    Similarly, "push + pull" should work, but you really will be operating
    mostly offset from the rest of the world. That might be ok by the time
    you initialize your repository, and it might be ok for several months
    after that, but there might come a day when you're starting to regret
    your use of `git init --object-format=sha256` and have dug yourself into
    a fairly deep hole.
    
    There are currently topics in flight to document our data formats and
    protocols regarding SHA-256 and in some cases (midx and commit-graph),
    we're considering adjusting how the file formats indicate which object
    format to use.
    
    Wherever `--object-format` is mentioned in our documentation, let's make
    it clear that using it with "sha256" is experimental. If we later need
    to explain why we can't handle data we generated back in 2020, we can
    always point to this paragraph we're adding here.
    
    By "include::"-ing a small blurb, we should be able to be consistent
    throughout the documentation and can eventually gradually tone down the
    severity of this text. One day, we might even use it to start phasing
    out `--object-format=sha1`, but let's not get ahead of ourselves...
    
    There's also `extensions.objectFormat`, but it's only mentioned three
    times. Twice where we're adding this new disclaimer and in the third
    spot we already have a "do not edit" warning. From there, interested
    readers should eventually find this new one that we're adding here.
    
    Because `GIT_DEFAULT_HASH` provides another entry point to this
    functionality, document the experimental nature of it too.
    
    Signed-off-by: Martin Ågren <martin.agren@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    Martin Ågren authored and gitster committed Aug 17, 2020
    Configuration menu
    Copy the full SHA
    ff233d8 View commit details
    Browse the repository at this point in the history
  5. mingw: improve performance of mingw_unlink()

    Update mingw_unlink() to first try to delete the file with existing
    permissions before trying to force it.
    
    Windows throws an error when trying to delete a read-only file.  The
    mingw_unlink() compatibility wrapper always tries to _wchmod(666) the
    file before calling _wunlink() to avoid that error.  However, since
    most files in the worktree are already writable, this is usually
    wasted effort.
    
    Update mingw_unlink() to just call DeleteFileW() directly and if that
    succeeds return.  If that fails, fall back into the existing code path
    to update the permissions and use _wunlink() to get the existing
    error code mapping.
    
    Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    jeffhostetler authored and gitster committed Aug 17, 2020
    Configuration menu
    Copy the full SHA
    680e0b4 View commit details
    Browse the repository at this point in the history
  6. add -p: use ALLOC_GROW_BY instead of ALLOW_GROW

    This simplifies the code slightly, especially the third case where
    hunk_nr was incremented a few lines before ALLOC_GROW().
    
    Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    phillipwood authored and gitster committed Aug 17, 2020
    Configuration menu
    Copy the full SHA
    2ebe436 View commit details
    Browse the repository at this point in the history
  7. add -p: fix checking of user input

    When a file has been deleted the C version of add -p allows the user
    to edit a hunk even though 'e' is not in the list of allowed
    responses. (I think 'e' is disallowed because if the file is edited it
    is no longer a deletion and we're not set up to rewrite the diff
    header).
    
    The invalid response was allowed because the test that determines
    whether to display 'e' was not duplicated correctly in the code that
    processes the user's choice. Fix this by using flags that are set when
    constructing the prompt and checked when processing the user's choice
    rather than repeating the check itself.
    
    Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    phillipwood authored and gitster committed Aug 17, 2020
    Configuration menu
    Copy the full SHA
    ce91028 View commit details
    Browse the repository at this point in the history
  8. am: stop exporting GIT_COMMITTER_DATE

    The implementation of --committer-date-is-author-date exports
    GIT_COMMITTER_DATE to override the default committer date but does not
    reset GIT_COMMITTER_DATE in the environment after creating the commit
    so it is set in the environment of any hooks that get run. We're about
    to add the same functionality to the sequencer and do not want to have
    GIT_COMMITTER_DATE set when running hooks or exec commands so lets
    update commit_tree_extended() to take an explicit committer so we
    override the default date without setting GIT_COMMITTER_DATE in the
    environment.
    
    Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    phillipwood authored and gitster committed Aug 17, 2020
    Configuration menu
    Copy the full SHA
    e8cbe21 View commit details
    Browse the repository at this point in the history
  9. rebase -i: support --committer-date-is-author-date

    Rebase is implemented with two different backends - 'apply' and
    'merge' each of which support a different set of options. In
    particular the apply backend supports a number of options implemented
    by 'git am' that are not implemented in the merge backend. This means
    that the available options are different depending on which backend is
    used which is confusing. This patch adds support for the
    --committer-date-is-author-date option to the merge backend. This
    option uses the author date of the commit that is being rewritten as
    the committer date when the new commit is created.
    
    Original-patch-by: Rohit Ashiwal <rohit.ashiwal265@gmail.com>
    Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    phillipwood authored and gitster committed Aug 17, 2020
    Configuration menu
    Copy the full SHA
    7573cec View commit details
    Browse the repository at this point in the history
  10. config: drop git_config_get_string_const()

    As evidenced by the leak fixes in the previous commit, the "const" in
    git_config_get_string_const() clearly misleads people into thinking that
    it does not allocate a copy of the string. We can fix this by renaming
    it, but it's easier still to just drop it. Of the four remaining
    callers:
    
      - The one in git_config_parse_expiry() still needs to allocate, since
        that's what its callers expect. We can just use the non-const
        version and cast our pointer. Slightly ugly, but the damage is
        contained in one spot.
    
      - The two in apply are writing to global "const char *" variables, and
        need to continue allocating. We often mark these as const because we
        assign default string literals to them. But in this case we don't do
        that, so we can just declare them as real "char *" pointers and use
        the non-const version.
    
      - The call in checkout doesn't actually need a copy; it can just use
        the non-allocating "tmp" version of the function.
    
    The function is also mentioned in the MyFirstContribution document. We
    can swap that call out for the non-allocating "tmp" variant, which fits
    well in the example given.
    
    We'll drop the "configset" and "repo" variants, as well (which are
    unused).
    
    Note that this frees up the "const" name, so we could rename the "tmp"
    variant back to that. But let's give some time for topics in flight to
    adapt to the new code before doing so (if we do it too soon, the
    function semantics will change but the compiler won't alert us).
    
    Signed-off-by: Jeff King <peff@peff.net>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    peff authored and gitster committed Aug 17, 2020
    Configuration menu
    Copy the full SHA
    9a53219 View commit details
    Browse the repository at this point in the history
  11. config: fix leak in git_config_get_expiry_in_days()

    We use git_config_get_string() to retrieve the expiry value in a newly
    allocated string. But after parsing it, we never free it, leaking the
    memory.
    
    We could fix this with a free() obviously, but there's an even better
    solution: we can use the non-allocating "tmp" variant of the function;
    we only need it to be valid for the lifetime of our parse function.
    
    Signed-off-by: Jeff King <peff@peff.net>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    peff authored and gitster committed Aug 17, 2020
    Configuration menu
    Copy the full SHA
    1c89001 View commit details
    Browse the repository at this point in the history
  12. submodule--helper: fix leak of core.worktree value

    In the ensure_core_worktree() function, we load the core.worktree value
    of the submodule repository using repo_config_get_string(). This
    function copies the string, but we never free it, leaking the memory.
    
    We can instead use the "tmp" version of that function to avoid the
    allocation at all. We don't have to worry about lifetime issues, since
    we never even look at the value (we just want to know if it's set).
    
    Signed-off-by: Jeff King <peff@peff.net>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    peff authored and gitster committed Aug 17, 2020
    Configuration menu
    Copy the full SHA
    55fe225 View commit details
    Browse the repository at this point in the history
  13. t/README: document GIT_TEST_DEFAULT_HASH

    Helped-by: Eric Sunshine <sunshine@sunshineco.com>
    Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
    Reviewed-by: brian m. carlson <sandals@crustytoothpaste.net>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    derrickstolee authored and gitster committed Aug 17, 2020
    Configuration menu
    Copy the full SHA
    f3d66ec View commit details
    Browse the repository at this point in the history
  14. commit-graph: use the "hash version" byte

    The commit-graph format reserved a byte among the header of the file to
    store a "hash version". During the SHA-256 work, this was not modified
    because file formats are not necessarily intended to work across hash
    versions. If a repository has SHA-256 as its hash algorithm, it
    automatically up-shifts the lengths of object names in all necessary
    formats.
    
    However, since we have this byte available for adjusting the version, we
    can make the file formats more obviously incompatible instead of relying
    on other context from the repository.
    
    Update the oid_version() method in commit-graph.c to add a new value, 2,
    for sha-256. This automatically writes the new value in a SHA-256
    repository _and_ verifies the value is correct. This is a breaking
    change relative to the current 'master' branch since 092b677 (Merge
    branch 'bc/sha-256-cvs-svn-updates', 2020-08-13) but it is not breaking
    relative to any released version of Git.
    
    The test impact is relatively minor: the output of 'test-tool
    read-graph' lists the header information, so those instances of '1' need
    to be replaced with a variable determined by GIT_TEST_DEFAULT_HASH. A
    more careful test is added that specifically creates a repository of
    each type then swaps the commit-graph files. The important value here is
    that the "git log" command succeeds while writing a message to stderr.
    
    Helped-by: brian m. carlson <sandals@crustytoothpaste.net>
    Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
    Reviewed-by: brian m. carlson <sandals@crustytoothpaste.net>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    derrickstolee authored and gitster committed Aug 17, 2020
    Configuration menu
    Copy the full SHA
    665d70a View commit details
    Browse the repository at this point in the history
  15. multi-pack-index: use hash version byte

    Similar to the commit-graph format, the multi-pack-index format has a
    byte in the header intended to track the hash version used to write the
    file. This allows one to interpret the hash length without having the
    context of the repository config specifying the hash length. This was
    not modified as part of the SHA-256 work because the hash length was
    automatically up-shifted due to that config.
    
    Since we have this byte available, we can make the file formats more
    obviously incompatible instead of relying on other context from the
    repository.
    
    Add a new oid_version() method in midx.c similar to the one in
    commit-graph.c. This is specifically made separate from that
    implementation to avoid artificially linking the formats.
    
    The test impact requires a few more things than the corresponding change
    in the commit-graph format. Specifically, 'test-tool read-midx' was not
    writing anything about this header value to output. Since the value
    available in 'struct multi_pack_index' is hash_len instead of a version
    value, we output "20" or "32" instead of "1" or "2".
    
    Since we want a user to not have their Git commands fail if their
    multi-pack-index has the incorrect hash version compared to the
    repository's hash version, we relax the die() to an error() in
    load_multi_pack_index(). This has some effect on 'git multi-pack-index
    verify' as we need to check that a failed parse of a file that exists is
    actually a verify error. For that test that checks the hash version
    matches, we change the corrupted byte from "2" to "3" to ensure the test
    fails for both hash algorithms.
    
    Helped-by: brian m. carlson <sandals@crustytoothpaste.net>
    Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
    Reviewed-by: brian m. carlson <sandals@crustytoothpaste.net>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    derrickstolee authored and gitster committed Aug 17, 2020
    Configuration menu
    Copy the full SHA
    d960754 View commit details
    Browse the repository at this point in the history

Commits on Aug 18, 2020

  1. Merge branch 'ps/ref-transaction-hook'

    The logic to find the ref transaction hook script attempted to
    cache the path to the found hook without realizing that it needed
    to keep a copied value, as the API it used returned a transitory
    buffer space.  This has been corrected.
    
    * ps/ref-transaction-hook:
      t1416: avoid hard-coded sha1 ids
      refs: fix interleaving hook calls with reference-transaction hook
    gitster committed Aug 18, 2020
    Configuration menu
    Copy the full SHA
    5676db2 View commit details
    Browse the repository at this point in the history
  2. Merge branch 'dd/send-email-config'

    Stop when "sendmail.*" configuration variables are defined, which
    could be a mistaken attempt to define "sendemail.*" variables.
    
    * dd/send-email-config:
      git-send-email: die if sendmail.* config is set
    gitster committed Aug 18, 2020
    Configuration menu
    Copy the full SHA
    a00bda2 View commit details
    Browse the repository at this point in the history
  3. Merge branch 'hn/reftable-prep-part-2'

    Further preliminary change to refs API.
    
    * hn/reftable-prep-part-2:
      Make HEAD a PSEUDOREF rather than PER_WORKTREE.
      Modify pseudo refs through ref backend storage
      t1400: use git rev-parse for testing PSEUDOREF existence
    gitster committed Aug 18, 2020
    Configuration menu
    Copy the full SHA
    95c687b View commit details
    Browse the repository at this point in the history
  4. Merge branch 'pd/mergetool-nvimdiff'

    The existing backends for "git mergetool" based on variants of vim
    have been refactored and then support for "nvim" has been added.
    
    * pd/mergetool-nvimdiff:
      mergetools: add support for nvimdiff (neovim) family
      mergetool--lib: improve support for vimdiff-style tool variants
    gitster committed Aug 18, 2020
    Configuration menu
    Copy the full SHA
    873fa13 View commit details
    Browse the repository at this point in the history
  5. Merge branch 'jc/noop-with-static-inline'

    A no-op replacement function implemented as a C preprocessor macro
    does not perform as good a job as one implemented as a "static
    inline" function in catching errors in parameters; replace the
    former with the latter in <git-compat-util.h> header.
    
    * jc/noop-with-static-inline:
      compat-util: type-check parameters of no-op replacement functions
    gitster committed Aug 18, 2020
    Configuration menu
    Copy the full SHA
    a01dadb View commit details
    Browse the repository at this point in the history
  6. Merge branch 'jk/sideband-error-l10n'

    Mark error message for i18n.
    
    * jk/sideband-error-l10n:
      sideband: mark "remote error:" prefix for translation
    gitster committed Aug 18, 2020
    Configuration menu
    Copy the full SHA
    789279e View commit details
    Browse the repository at this point in the history
  7. Merge branch 'al/bisect-first-parent'

    "git bisect" learns the "--first-parent" option to find the first
    breakage along the first-parent chain.
    
    * al/bisect-first-parent:
      bisect: combine args passed to find_bisection()
      bisect: introduce first-parent flag
      cmd_bisect__helper: defer parsing no-checkout flag
      rev-list: allow bisect and first-parent flags
      t6030: modernize "git bisect run" tests
    gitster committed Aug 18, 2020
    Configuration menu
    Copy the full SHA
    47f0f94 View commit details
    Browse the repository at this point in the history
  8. Merge branch 'rp/apply-cached-with-i-t-a'

    Recent versions of "git diff-files" shows a diff between the index
    and the working tree for "intent-to-add" paths as a "new file"
    patch; "git apply --cached" should be able to take "git diff-files"
    and should act as an equivalent to "git add" for the path, but the
    command failed to do so for such a path.
    
    * rp/apply-cached-with-i-t-a:
      t4140: test apply with i-t-a paths
      apply: make i-t-a entries never match worktree
      apply: allow "new file" patches on i-t-a entries
    gitster committed Aug 18, 2020
    Configuration menu
    Copy the full SHA
    ca81676 View commit details
    Browse the repository at this point in the history
  9. Merge branch 'es/test-cmp-typocatcher'

    Test framework update.
    
    * es/test-cmp-typocatcher:
      test_cmp: diagnose incorrect arguments
    gitster committed Aug 18, 2020
    Configuration menu
    Copy the full SHA
    07f14d3 View commit details
    Browse the repository at this point in the history
  10. Merge branch 'ma/stop-progress-null-fix'

    NULL dereference fix.
    
    * ma/stop-progress-null-fix:
      progress: don't dereference before checking for NULL
    gitster committed Aug 18, 2020
    Configuration menu
    Copy the full SHA
    e6ec620 View commit details
    Browse the repository at this point in the history
  11. Merge branch 'jk/log-fp-implies-m'

    "git log --first-parent -p" showed patches only for single-parent
    commits on the first-parent chain; the "--first-parent" option has
    been made to imply "-m".  Use "--no-diff-merges" to restore the
    previous behaviour to omit patches for merge commits.
    
    * jk/log-fp-implies-m:
      doc/git-log: clarify handling of merge commit diffs
      doc/git-log: move "-t" into diff-options list
      doc/git-log: drop "-r" diff option
      doc/git-log: move "Diff Formatting" from rev-list-options
      log: enable "-m" automatically with "--first-parent"
      revision: add "--no-diff-merges" option to counteract "-m"
      log: drop "--cc implies -m" logic
    gitster committed Aug 18, 2020
    Configuration menu
    Copy the full SHA
    eca8c62 View commit details
    Browse the repository at this point in the history
  12. Merge branch 'so/log-diff-merges-opt'

    Earlier, to countermand the implicit "-m" option when the
    "--first-parent" option is used with "git log", we added the
    "--[no-]diff-merges" option in the jk/log-fp-implies-m topic.  To
    leave the door open to allow the "--diff-merges" option to take
    values that instructs how patches for merge commits should be
    computed (e.g. "cc"? "-p against first parent?"), redefine
    "--diff-merges" to take non-optional value, and implement "off"
    that means the same thing as "--no-diff-merges".
    
    * so/log-diff-merges-opt:
      t/t4013: add test for --diff-merges=off
      doc/git-log: describe --diff-merges=off
      revision: change "--diff-merges" option to require parameter
    gitster committed Aug 18, 2020
    Configuration menu
    Copy the full SHA
    a555b51 View commit details
    Browse the repository at this point in the history
  13. Eighth batch

    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    gitster committed Aug 18, 2020
    Configuration menu
    Copy the full SHA
    2befe97 View commit details
    Browse the repository at this point in the history
  14. contrib/subtree: fix "unsure" for --message in the document

    Revise the documentation and remove previous "unsure" after making sure
    that --message supports only 'add', 'merge', 'pull', and 'split --rejoin'.
    
    Signed-off-by: Danny Lin <danny0838@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    danny0838 authored and gitster committed Aug 18, 2020
    Configuration menu
    Copy the full SHA
    f99c0c9 View commit details
    Browse the repository at this point in the history
  15. contrib/subtree: document 'push' does not take '--squash'

    git subtree push does not support --squash, as previously illustrated in
    6ccc71a (contrib/subtree: there's no push --squash, 2015-05-07)
    
    Signed-off-by: Danny Lin <danny0838@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    danny0838 authored and gitster committed Aug 18, 2020
    Configuration menu
    Copy the full SHA
    ce820cb View commit details
    Browse the repository at this point in the history
  16. mem-pool: add convenience functions for strdup and strndup

    fast-import had a special mem_pool_strdup() convenience function that I
    want to be able to use from the new merge algorithm I am writing.  Move
    it from fast-import to mem-pool, and also add a mem_pool_strndup()
    while at it that I also want to use.
    
    Signed-off-by: Elijah Newren <newren@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    newren authored and gitster committed Aug 18, 2020
    Configuration menu
    Copy the full SHA
    a762c8c View commit details
    Browse the repository at this point in the history
  17. mem-pool: use more standard initialization and finalization

    A typical memory type, such as strbuf, hashmap, or string_list can be
    stored on the stack or embedded within another structure.  mem_pool
    cannot be, because of how mem_pool_init() and mem_pool_discard() are
    written.  mem_pool_init() does essentially the following (simplified
    for purposes of explanation here):
    
        void mem_pool_init(struct mem_pool **pool...)
        {
            *pool = xcalloc(1, sizeof(*pool));
    
    It seems weird to require that mem_pools can only be accessed through a
    pointer.  It also seems slightly dangerous: unlike strbuf_release() or
    strbuf_reset() or string_list_clear(), all of which put the data
    structure into a state where it can be re-used after the call,
    mem_pool_discard(pool) will leave pool pointing at free'd memory.
    read-cache (and split-index) are the only current users of mem_pools,
    and they haven't fallen into a use-after-free mistake here, but it seems
    likely to be problematic for future users especially since several of
    the current callers of mem_pool_init() will only call it when the
    mem_pool* is not already allocated (i.e. is NULL).
    
    This type of mechanism also prevents finding synchronization
    points where one can free existing memory and then resume more
    operations.  It would be natural at such points to run something like
        mem_pool_discard(pool...);
    and, if necessary,
        mem_pool_init(&pool...);
    and then carry on continuing to use the pool.  However, this fails badly
    if several objects had a copy of the value of pool from before these
    commands; in such a case, those objects won't get the updated value of
    pool that mem_pool_init() overwrites pool with and they'll all instead
    be reading and writing from free'd memory.
    
    Modify mem_pool_init()/mem_pool_discard() to behave more like
       strbuf_init()/strbuf_release()
    or
       string_list_init()/string_list_clear()
    In particular: (1) make mem_pool_init() just take a mem_pool* and have
    it only worry about allocating struct mp_blocks, not the struct mem_pool
    itself, (2) make mem_pool_discard() free the memory that the pool was
    responsible for, but leave it in a state where it can be used to
    allocate more memory afterward (without the need to call mem_pool_init()
    again).
    
    Signed-off-by: Elijah Newren <newren@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    newren authored and gitster committed Aug 18, 2020
    Configuration menu
    Copy the full SHA
    44c7e1a View commit details
    Browse the repository at this point in the history
  18. mem-pool: use consistent pool variable name

    About half the function declarations in mem-pool.h used 'struct mem_pool
    *pool', while the other half used 'struct mem_pool *mem_pool'.  Make the
    code a bit more consistent by just using 'pool' in preference to
    'mem_pool' everywhere.
    
    No behavioral changes included; this is just a mechanical rename (though
    a line or two was rewrapped as well).
    
    Signed-off-by: Elijah Newren <newren@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    newren authored and gitster committed Aug 18, 2020
    Configuration menu
    Copy the full SHA
    f87bf28 View commit details
    Browse the repository at this point in the history
  19. fetch: optionally allow disabling FETCH_HEAD update

    If you run fetch but record the result in remote-tracking branches,
    and either if you do nothing with the fetched refs (e.g. you are
    merely mirroring) or if you always work from the remote-tracking
    refs (e.g. you fetch and then merge origin/branchname separately),
    you can get away with having no FETCH_HEAD at all.
    
    Teach "git fetch" a command line option "--[no-]write-fetch-head".
    The default is to write FETCH_HEAD, and the option is primarily
    meant to be used with the "--no-" prefix to override this default,
    because there is no matching fetch.writeFetchHEAD configuration
    variable to flip the default to off (in which case, the positive
    form may become necessary to defeat it).
    
    Note that under "--dry-run" mode, FETCH_HEAD is never written;
    otherwise you'd see list of objects in the file that you do not
    actually have.  Passing `--write-fetch-head` does not force `git
    fetch` to write the file.
    
    Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    gitster committed Aug 18, 2020
    Configuration menu
    Copy the full SHA
    887952b View commit details
    Browse the repository at this point in the history
  20. negotiator/noop: add noop fetch negotiator

    Add a noop fetch negotiator. This is introduced to allow partial clones
    to skip the unneeded negotiation step when fetching missing objects
    using a "git fetch" subprocess. (The implementation of spawning a "git
    fetch" subprocess will be done in a subsequent patch.) But this can also
    be useful for end users, e.g. as a blunt fix for object corruption.
    
    Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    jonathantanmy authored and gitster committed Aug 18, 2020
    Configuration menu
    Copy the full SHA
    cbe566a View commit details
    Browse the repository at this point in the history
  21. fetch: allow refspecs specified through stdin

    In a subsequent patch, partial clones will be taught to fetch missing
    objects using a "git fetch" subprocess. Because the number of objects
    fetched may be too numerous to fit on the command line, teach "fetch" to
    accept refspecs passed through stdin.
    
    Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    jonathantanmy authored and gitster committed Aug 18, 2020
    Configuration menu
    Copy the full SHA
    2b713c2 View commit details
    Browse the repository at this point in the history
  22. fetch: avoid reading submodule config until needed

    In "fetch", there are two parameters submodule_fetch_jobs_config and
    recurse_submodules that can be set in a variety of ways: through
    .gitmodules, through .git/config, and through the command line.
    Currently "fetch" handles this by first reading .gitmodules, then
    reading .git/config (allowing it to overwrite existing values), then
    reading the command line (allowing it to overwrite existing values).
    
    Notice that we can avoid reading .gitmodules if .git/config and/or the
    command line already provides us with what we need. In addition, if
    recurse_submodules is found to be "no", we do not need the value of
    submodule_fetch_jobs_config.
    
    Avoiding reading .gitmodules is especially important when we use "git
    fetch" to perform lazy fetches in a partial clone because the
    .gitmodules file itself might need to be lazy fetched (and otherwise
    causing an infinite loop).
    
    In light of all this, avoid reading .gitmodules until necessary. When
    reading it, we may only need one of the two parameters it provides, so
    teach fetch_config_from_gitmodules() to support NULL arguments. With
    this patch, users (including Git itself when invoking "git fetch" to
    lazy-fetch) will be able to guarantee avoiding reading .gitmodules by
    passing --recurse-submodules=no.
    
    Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    jonathantanmy authored and gitster committed Aug 18, 2020
    Configuration menu
    Copy the full SHA
    e5b9421 View commit details
    Browse the repository at this point in the history
  23. fetch: only populate existing_refs if needed

    In "fetch", get_ref_map() iterates over all refs to populate
    "existing_refs" in order to populate peer_ref->old_oid in the returned
    refmap, even if the refmap has no peer_ref set - which is the case when
    only literal hashes (i.e. no refs by name) are fetched.
    
    Iterating over refs causes the targets of those refs to be checked for
    existence. Avoiding this is especially important when we use "git fetch"
    to perform lazy fetches in a partial clone because a target of such a
    ref may need to be itself lazy-fetched (and otherwise causing an
    infinite loop).
    
    Therefore, avoid populating "existing_refs" until necessary. With this
    patch, because Git lazy-fetches objects by literal hashes (to be done in
    a subsequent commit), it will then be able to guarantee avoiding reading
    targets of refs.
    
    Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    jonathantanmy authored and gitster committed Aug 18, 2020
    Configuration menu
    Copy the full SHA
    abcb7ee View commit details
    Browse the repository at this point in the history
  24. fetch-pack: do not lazy-fetch during ref iteration

    In order to determine negotiation tips, "fetch-pack" iterates over all
    refs and dereferences all annotated tags found. This causes the
    existence of targets of refs and annotated tags to be checked. Avoiding
    this is especially important when we use "git fetch" (which invokes
    "fetch-pack") to perform lazy fetches in a partial clone because a
    target of such a ref or annotated tag may need to be itself lazy-fetched
    (and otherwise causing an infinite loop).
    
    Therefore, teach "fetch-pack" not to lazy fetch whenever iterating over
    refs. This is done by using the raw form of ref iteration and by
    dereferencing tags ourselves.
    
    Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    jonathantanmy authored and gitster committed Aug 18, 2020
    Configuration menu
    Copy the full SHA
    5c3b801 View commit details
    Browse the repository at this point in the history
  25. checkout_entry(): remove unreachable error() call

    This if statement never evaluates to true since we already check
    state->force a few lines above, and immediately return when it is
    false.
    
    Signed-off-by: Matheus Tavares <matheus.bernardino@usp.br>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    matheustavares authored and gitster committed Aug 18, 2020
    Configuration menu
    Copy the full SHA
    748f733 View commit details
    Browse the repository at this point in the history
  26. patch-id: ignore newline at end of file in diff_flush_patch_id()

    Whitespace is ignored when calculating patch IDs.  This is done by
    removing all whitespace from diff lines before hashing them, including
    a newline at the end of a file.  If that newline is missing, however,
    diff reports that fact in a separate line containing "\ No newline at
    end of file\n", and this marker is hashed like a context line.
    
    This goes against our goal of making patch IDs independent of
    whitespace.  Use the same heuristic that 2485eab (git-patch-id: do
    not trip over "no newline" markers, 2011-02-17) added to git patch-id
    instead and skip diff lines that start with a backslash and a space
    and are longer than twelve characters.
    
    Reported-by: Tilman Vogel <tilman.vogel@web.de>
    Initial-test-by: Tilman Vogel <tilman.vogel@web.de>
    Signed-off-by: René Scharfe <l.s.r@web.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    rscharfe authored and gitster committed Aug 18, 2020
    Configuration menu
    Copy the full SHA
    82a6201 View commit details
    Browse the repository at this point in the history
  27. promisor-remote: lazy-fetch objects in subprocess

    Teach Git to lazy-fetch missing objects in a subprocess instead of doing
    it in-process. This allows any fatal errors that occur during the fetch
    to be isolated and converted into an error return value, instead of
    causing the current command being run to terminate.
    
    Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    jonathantanmy authored and gitster committed Aug 18, 2020
    Configuration menu
    Copy the full SHA
    7ca3c0a View commit details
    Browse the repository at this point in the history
  28. fetch-pack: remove no_dependents code

    Now that Git has switched to using a subprocess to lazy-fetch missing
    objects, remove the no_dependents code as it is no longer used.
    
    Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    jonathantanmy authored and gitster committed Aug 18, 2020
    Configuration menu
    Copy the full SHA
    9dfa8db View commit details
    Browse the repository at this point in the history

Commits on Aug 19, 2020

  1. dir: make clear_directory() free all relevant memory

    The calling convention for the dir API is supposed to end with a call to
    clear_directory() to free up no longer needed memory.  However,
    clear_directory() didn't free dir->entries or dir->ignored.  I believe
    this was an oversight, but a number of callers noticed memory leaks and
    started free'ing these.  Unfortunately, they did so somewhat haphazardly
    (sometimes freeing the entries in the arrays, and sometimes only
    free'ing the arrays themselves).  This suggests the callers weren't
    trying to make sure any possible memory used might be free'd, but just
    the memory they noticed their usecase definitely had allocated.
    
    Fix this mess by moving all the duplicated free'ing logic into
    clear_directory().  End by resetting dir to a pristine state so it could
    be reused if desired.
    
    Signed-off-by: Elijah Newren <newren@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    newren authored and gitster committed Aug 19, 2020
    Configuration menu
    Copy the full SHA
    dad4f23 View commit details
    Browse the repository at this point in the history
  2. dir: fix problematic API to avoid memory leaks

    The dir structure seemed to have a number of leaks and problems around
    it.  First I noticed that parent_hashmap and recursive_hashmap were
    being leaked (though Peff noticed and submitted fixes before me).  Then
    I noticed in the previous commit that clear_directory() was only taking
    responsibility for a subset of fields within dir_struct, despite the
    fact that entries[] and ignored[] we allocated internally to dir.c.
    That, of course, resulted in many callers either leaking or haphazardly
    trying to free these arrays and their contents.
    
    Digging further, I found that despite the pretty clear documentation
    near the top of dir.h that folks were supposed to call clear_directory()
    when the user no longer needed the dir_struct, there were four callers
    that didn't bother doing that at all.  However, two of them clearly
    thought about leaks since they had an UNLEAK(dir) directive, which to me
    suggests that the method to free the data was too unclear.  I suspect
    the non-obviousness of the API and its holes led folks to avoid it,
    which then snowballed into further problems with the entries[],
    ignored[], parent_hashmap, and recursive_hashmap problems.
    
    Rename clear_directory() to dir_clear() to be more in line with other
    data structures in git, and introduce a dir_init() to handle the
    suggested memsetting of dir_struct to all zeroes.  I hope that a name
    like "dir_clear()" is more clear, and that the presence of dir_init()
    will provide a hint to those looking at the code that they need to look
    for either a dir_clear() or a dir_free() and lead them to find
    dir_clear().
    
    Signed-off-by: Elijah Newren <newren@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    newren authored and gitster committed Aug 19, 2020
    Configuration menu
    Copy the full SHA
    eceba53 View commit details
    Browse the repository at this point in the history
  3. refs: split off reading loose ref data in separate function

    This prepares for handling FETCH_HEAD (which is not a regular ref)
    separately from the ref backend.
    
    Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    hanwen authored and gitster committed Aug 19, 2020
    Configuration menu
    Copy the full SHA
    e39620f View commit details
    Browse the repository at this point in the history
  4. refs: fix comment about submodule ref_stores

    Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    hanwen authored and gitster committed Aug 19, 2020
    Configuration menu
    Copy the full SHA
    4877c6c View commit details
    Browse the repository at this point in the history
  5. refs: move gitdir into base ref_store

    Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    hanwen authored and gitster committed Aug 19, 2020
    Configuration menu
    Copy the full SHA
    5085aef View commit details
    Browse the repository at this point in the history
  6. refs: read FETCH_HEAD and MERGE_HEAD generically

    The FETCH_HEAD and MERGE_HEAD refs must be stored in a file, regardless of the
    type of ref backend. This is because they can hold more than just a single ref.
    
    To accomodate them for alternate ref backends, read them from a file generically
    in refs_read_raw_ref()
    
    Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    hanwen authored and gitster committed Aug 19, 2020
    Configuration menu
    Copy the full SHA
    e811530 View commit details
    Browse the repository at this point in the history
  7. rebase -i: support --ignore-date

    Rebase is implemented with two different backends - 'apply' and
    'merge' each of which support a different set of options. In
    particular the apply backend supports a number of options implemented
    by 'git am' that are not implemented in the merge backend. This means
    that the available options are different depending on which backend is
    used which is confusing. This patch adds support for the --ignore-date
    option to the merge backend. This option uses the current time as the
    author date rather than reusing the original author date when
    rewriting commits. We take care to handle the combination of
    --ignore-date and --committer-date-is-author-date in the same way as
    the apply backend.
    
    Original-patch-by: Rohit Ashiwal <rohit.ashiwal265@gmail.com>
    Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    phillipwood authored and gitster committed Aug 19, 2020
    Configuration menu
    Copy the full SHA
    a3894aa View commit details
    Browse the repository at this point in the history
  8. rebase: add --reset-author-date

    The previous commit introduced --ignore-date flag to rebase -i, but the
    name is rather vague as it does not say whether the author date or the
    committer date is ignored. Add an alias to convey the precise purpose.
    
    Helped-by: Junio C Hamano <gitster@pobox.com>
    Signed-off-by: Rohit Ashiwal <rohit.ashiwal265@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    r1walz authored and gitster committed Aug 19, 2020
    Configuration menu
    Copy the full SHA
    2712669 View commit details
    Browse the repository at this point in the history
  9. Merge branch 'en/merge-tests'

    Updates to "git merge" tests, in preparation for a new merge
    strategy backend.
    
    * en/merge-tests:
      t6425: be more flexible with rename/delete conflict messages
      t642[23]: be more flexible for add/add conflicts involving pair renames
      t6422, t6426: be more flexible for add/add conflicts involving renames
      t6423: add an explanation about why one of the tests does not pass
      t6416, t6423: clarify some comments and fix some typos
      t6422: fix multiple errors with the mod6 test expectations
      t6423: fix test setup for a couple tests
      t6416, t6422: fix incorrect untracked file count
      t6422: fix bad check against missing file
      t6418: tighten delete/normalize conflict testcase
      Collect merge-related tests to t64xx
    gitster committed Aug 19, 2020
    Configuration menu
    Copy the full SHA
    36d225c View commit details
    Browse the repository at this point in the history
  10. Merge branch 'rp/ita-diff-modefix'

    "git diff [<tree-ish>] $path" for a $path that is marked with i-t-a
    bit was not showing the mode bits from the working tree.
    
    * rp/ita-diff-modefix:
      diff-lib: use worktree mode in diffs from i-t-a entries
    gitster committed Aug 19, 2020
    Configuration menu
    Copy the full SHA
    b10a44e View commit details
    Browse the repository at this point in the history
  11. Merge branch 'rs/upload-pack-sigchain-fix'

    Code clean-up.
    
    * rs/upload-pack-sigchain-fix:
      upload-pack: remove superfluous sigchain_pop() call
    gitster committed Aug 19, 2020
    Configuration menu
    Copy the full SHA
    f577d30 View commit details
    Browse the repository at this point in the history
  12. Merge branch 'rs/preserve-merges-unused-code-removal'

    Code clean-up.
    
    * rs/preserve-merges-unused-code-removal:
      rebase: remove unused function reschedule_last_action
    gitster committed Aug 19, 2020
    Configuration menu
    Copy the full SHA
    9cdf86b View commit details
    Browse the repository at this point in the history
  13. Merge branch 'en/sequencer-merge-labels'

    The commit labels used to explain each side of conflicted hunks
    placed by the sequencer machinery have been made more readable by
    humans.
    
    * en/sequencer-merge-labels:
      sequencer: avoid garbled merge machinery messages due to commit labels
    gitster committed Aug 19, 2020
    Configuration menu
    Copy the full SHA
    6cceea1 View commit details
    Browse the repository at this point in the history
  14. Merge branch 'ak/sequencer-fix-find-uniq-abbrev'

    Ring buffer with size 4 used for bin-hex translation resulted in a
    wrong object name in the sequencer's todo output, which has been
    corrected.
    
    * ak/sequencer-fix-find-uniq-abbrev:
      rebase -i: fix possibly wrong onto hash in todo
    gitster committed Aug 19, 2020
    Configuration menu
    Copy the full SHA
    4499a42 View commit details
    Browse the repository at this point in the history
  15. Merge branch 'jk/blame-coalesce-fix'

    When given more than one target line ranges, "git blame -La,b
    -Lc,d" was over-eager to coalesce groups of original lines and
    showed incorrect results, which has been corrected.
    
    * jk/blame-coalesce-fix:
      blame: only coalesce lines that are adjacent in result
      t8003: factor setup out of coalesce test
      t8003: check output of coalesced blame
    gitster committed Aug 19, 2020
    Configuration menu
    Copy the full SHA
    93121df View commit details
    Browse the repository at this point in the history
  16. Merge branch 'jb/commit-graph-doc-fix'

    Docfix.
    
    * jb/commit-graph-doc-fix:
      docs: commit-graph: fix some whitespace in the diagram
    gitster committed Aug 19, 2020
    Configuration menu
    Copy the full SHA
    ecc796c View commit details
    Browse the repository at this point in the history
  17. Merge branch 'pb/userdiff-fortran-update'

    The regexp to identify the function boundary for FORTRAN programs
    has been updated.
    
    * pb/userdiff-fortran-update:
      userdiff: improve Fortran xfuncname regex
      userdiff: add tests for Fortran xfuncname regex
    gitster committed Aug 19, 2020
    Configuration menu
    Copy the full SHA
    b350c4d View commit details
    Browse the repository at this point in the history
  18. Merge branch 'pb/set-url-docfix'

    Doc fix.
    
    * pb/set-url-docfix:
      fetch, pull doc: correct description of '--set-upstream'
    gitster committed Aug 19, 2020
    Configuration menu
    Copy the full SHA
    ee356a8 View commit details
    Browse the repository at this point in the history
  19. Merge branch 'bc/sha-256-doc-updates'

    Further update of docs to adjust to the recent SHA-256 work.
    
    * bc/sha-256-doc-updates:
      docs: fix step in transition plan
      docs: document SHA-256 pack and indices
    gitster committed Aug 19, 2020
    Configuration menu
    Copy the full SHA
    336fbd1 View commit details
    Browse the repository at this point in the history
  20. Merge branch 'jc/object-names-are-not-sha-1'

    A few end-user facing messages have been updated to be
    hash-algorithm agnostic.
    
    * jc/object-names-are-not-sha-1:
      messages: avoid SHA-1 in end-user facing messages
    gitster committed Aug 19, 2020
    Configuration menu
    Copy the full SHA
    2a978f8 View commit details
    Browse the repository at this point in the history
  21. Merge branch 'ma/sha-256-docs'

    Further update of docs to adjust to the recent SHA-256 work.
    
    * ma/sha-256-docs:
      shallow.txt: document SHA-256 shallow format
      protocol-capabilities.txt: clarify "allow-x-sha1-in-want" re SHA-256
      index-format.txt: document SHA-256 index format
      http-protocol.txt: document SHA-256 "want"/"have" format
    gitster committed Aug 19, 2020
    Configuration menu
    Copy the full SHA
    74a395c View commit details
    Browse the repository at this point in the history
  22. Merge branch 'ds/sha256-leftover-bits'

    midx and commit-graph files now use the byte defined in their file
    format specification for identifying the hash function used for
    object names.
    
    * ds/sha256-leftover-bits:
      multi-pack-index: use hash version byte
      commit-graph: use the "hash version" byte
      t/README: document GIT_TEST_DEFAULT_HASH
    gitster committed Aug 19, 2020
    Configuration menu
    Copy the full SHA
    6f8a213 View commit details
    Browse the repository at this point in the history
  23. Merge branch 'jh/mingw-unlink'

    "unlink" emulation on MinGW has been optimized.
    
    * jh/mingw-unlink:
      mingw: improve performance of mingw_unlink()
    gitster committed Aug 19, 2020
    Configuration menu
    Copy the full SHA
    5a04826 View commit details
    Browse the repository at this point in the history
  24. Ninth batch

    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    gitster committed Aug 19, 2020
    Configuration menu
    Copy the full SHA
    675a4aa View commit details
    Browse the repository at this point in the history

Commits on Aug 20, 2020

  1. parse-options: add --git-completion-helper-all

    --git-completion-helper excludes hidden options, such as --allow-empty
    for git commit. This is typically helpful, but occasionally we want
    auto-completion for obscure flags. --git-completion-helper-all returns
    all options, even if they are marked as hidden or nocomplete.
    
    Signed-off-by: Ryan Zoeller <rtzoeller@rtzoeller.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    rtzoeller authored and gitster committed Aug 20, 2020
    Configuration menu
    Copy the full SHA
    a0abe5e View commit details
    Browse the repository at this point in the history
  2. completion: add GIT_COMPLETION_SHOW_ALL env var

    When set to 1, GIT_COMPLETION_SHOW_ALL causes --git-completion-helper-all
    to be passed instead of --git-completion-helper.
    
    Signed-off-by: Ryan Zoeller <rtzoeller@rtzoeller.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    rtzoeller authored and gitster committed Aug 20, 2020
    Configuration menu
    Copy the full SHA
    c099f57 View commit details
    Browse the repository at this point in the history
  3. diff: teach --stat to ignore uninteresting modifications

    When options such as --ignore-space-change are in use, files with
    modifications can have no interesting textual changes worth showing.  In
    such cases, "git diff --stat" shows 0 lines of additions and deletions.
    Teach "git diff --stat" not to show such a path in its output, which
    would be more natural.
    
    However, we don't want to prevent the display  of all files that have 0
    effective diffs since they could be the result of a rename, permission
    change, or other similar operation that may still be of interest so we
    special case additions and deletions as they are always interesting.
    
    Signed-off-by: Matthew Rogers <mattr94@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    ROGERSM94 authored and gitster committed Aug 20, 2020
    Configuration menu
    Copy the full SHA
    1cf3d5d View commit details
    Browse the repository at this point in the history
  4. fetch-pack: in partial clone, pass --promisor

    When fetching a pack from a promisor remote, the corresponding .promisor
    file needs to be created. "fetch-pack" originally did this by passing
    "--promisor" to "index-pack", but in 5374a29 ("fetch-pack: write
    fetched refs to .promisor", 2019-10-16), "fetch-pack" was taught to do
    this itself instead, because it needed to store ref information in the
    .promisor file.
    
    This causes a problem with superprojects when transfer.fsckobjects is
    set, because in the current implementation, it is "index-pack" that
    calls fsck_finish() to check the objects; before 5374a29,
    fsck_finish() would see that .gitmodules is a promisor object and
    tolerate it being missing, but after, there is no .promisor file (at the
    time of the invocation of fsck_finish() by "index-pack") to tell it that
    .gitmodules is a promisor object, so it returns an error.
    
    Therefore, teach "fetch-pack" to pass "--promisor" to index pack once
    again. "fetch-pack" will subsequently overwrite this file with the ref
    information.
    
    An alternative is to instead move object checking to "fetch-pack", and
    let "index-pack" only index the files. However, since "index-pack" has
    to inflate objects in order to index them, it seems reasonable to also
    let it check the objects (which also require inflated files).
    
    Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    jonathantanmy authored and gitster committed Aug 20, 2020
    Configuration menu
    Copy the full SHA
    1b03df5 View commit details
    Browse the repository at this point in the history
  5. git-apply.txt: update descriptions of --cached, --index

    The blurb for "--cached" says it implies "--index", but in reality
    "--cached" and "--index" are distinct modes with different behavior.
    
    Additionally, the descriptions of "--index" and "--cached" are somewhat
    unclear about what might be modified, and what "--index" looks for to
    determine that the index and working copy "match".
    
    Rewrite the blurbs for both options for clarity and accuracy.
    
    Signed-off-by: Raymond E. Pasco <ray@ameretat.dev>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    juped authored and gitster committed Aug 20, 2020
    Configuration menu
    Copy the full SHA
    d064702 View commit details
    Browse the repository at this point in the history

Commits on Aug 21, 2020

  1. refs: make refs_ref_exists public

    This will be necessary to replace file existence checks for pseudorefs.
    
    Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    hanwen authored and gitster committed Aug 21, 2020
    Configuration menu
    Copy the full SHA
    3f9f1ac View commit details
    Browse the repository at this point in the history
  2. sequencer: treat CHERRY_PICK_HEAD as a pseudo ref

    Check for existence and delete CHERRY_PICK_HEAD through ref functions.
    This will help cherry-pick work with alternate ref storage backends.
    
    Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    hanwen authored and gitster committed Aug 21, 2020
    Configuration menu
    Copy the full SHA
    c8e4159 View commit details
    Browse the repository at this point in the history
  3. builtin/commit: suggest update-ref for pseudoref removal

    When pseudorefs move to a different ref storage mechanism, pseudorefs no longer
    can be removed with 'rm'. Instead, suggest a "update-ref -d" command, which will
    work regardless of ref storage backend.
    
    Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    hanwen authored and gitster committed Aug 21, 2020
    Configuration menu
    Copy the full SHA
    b6d2558 View commit details
    Browse the repository at this point in the history
  4. sequencer: treat REVERT_HEAD as a pseudo ref

    Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    hanwen authored and gitster committed Aug 21, 2020
    Configuration menu
    Copy the full SHA
    b8825ef View commit details
    Browse the repository at this point in the history
  5. t7401: modernize style

    The tests in 't7401-submodule-summary.sh' were written a long time ago
    and has a violation with respect to our CodingGuidelines which is,
    incorrect spacing in usages of the redirection operator.
    
    Mentored-by: Christian Couder <chriscool@tuxfamily.org>
    Mentored-by: Kaartic Sivaraam <kaartic.sivaraam@gmail.com>
    Helped-by: Denton Liu <liu.denton@gmail.com>
    Helped-by: Taylor Blau <me@ttaylorr.com>
    Signed-off-by: Shourya Shukla <shouryashukla.oo@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    periperidip authored and gitster committed Aug 21, 2020
    Configuration menu
    Copy the full SHA
    94e06c9 View commit details
    Browse the repository at this point in the history
  6. t7401: use 'short' instead of 'verify' and cut in rev-parse calls

    'git rev-parse' can limit the number of characters in the hash it
    outputs using the '--short' option, thereby, making the 'cut' invocation
    redundant. Since using '--short' implies '--verify' as well, we can
    safely replace the latter with the former. This change results in the
    helper functions getting the hash in the same way 'summary' gets the
    hash internally.
    
    So, avoid the unnecessary invocation to 'cut' in the helper
    functions.
    
    Mentored-by: Christian Couder <chriscool@tuxfamily.org>
    Mentored-by: Kaartic Sivaraam <kaartic.sivaraam@gmail.com>
    Signed-off-by: Shourya Shukla <shouryashukla.oo@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    periperidip authored and gitster committed Aug 21, 2020
    Configuration menu
    Copy the full SHA
    7303da3 View commit details
    Browse the repository at this point in the history
  7. t7401: change syntax of test_i18ncmp calls for clarity

    Change the test_i18ncmp syntax from 'test_i18ncmp actual expected' to
    'test_i18ncmp expected actual' to align it with the convention followed
    by other tests in the test script.
    
    Mentored-by: Christian Couder <chriscool@tuxfamily.org>
    Mentored-by: Kaartic Sivaraam <kaartic.sivaraam@gmail.com>
    Signed-off-by: Shourya Shukla <shouryashukla.oo@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    periperidip authored and gitster committed Aug 21, 2020
    Configuration menu
    Copy the full SHA
    17c102e View commit details
    Browse the repository at this point in the history
  8. t7401: change indentation for enhanced readability

    Change the indentation of expected outputs for enhanced readability of
    the tests. Also modify the heredoc string limiter in a test which lacks
    it to support the indentation change.
    
    Mentored-by: Christian Couder <chriscool@tuxfamily.org>
    Mentored-by: Kaartic Sivaraam <kaartic.sivaraam@gmail.com>
    Helped-by: Junio C Hamano <gitster@pobox.com>
    Helped-by: Taylor Blau <me@taylorr.com>
    Signed-off-by: Shourya Shukla <shouryashukla.oo@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    periperidip authored and gitster committed Aug 21, 2020
    Configuration menu
    Copy the full SHA
    3a4fdee View commit details
    Browse the repository at this point in the history
  9. t7401: add a NEEDSWORK

    Add a NEEDSWORK regarding the outdated syntax and working of the test,
    which may need to be improved to obtain better and desired results.
    
    While at it, change the word 'test' to 'test script' in the test
    description to avoid ambiguity.
    
    Mentored-by: Christian Couder <chriscool@tuxfamily.org>
    Mentored-by: Kaartic Sivaraam <kaartic.sivaraam@gmail.com>
    Helped-by: Taylor Blau <me@ttaylorr.com>
    Signed-off-by: Shourya Shukla <shouryashukla.oo@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    periperidip authored and gitster committed Aug 21, 2020
    Configuration menu
    Copy the full SHA
    2a0d1a5 View commit details
    Browse the repository at this point in the history
  10. p5302: disable thread-count parameter tests by default

    The primary function of the perf suite is to detect regressions (or
    improvements) between versions of Git. The only numbers we show a direct
    comparison for are timings between the same test run on two different
    versions.
    
    However, it can sometimes be used to collect other information.  For
    instance, p5302 runs the same index-pack operation with different thread
    counts. The output doesn't directly compare these, but anybody
    interested in working on index-pack can manually compare the results.
    
    For a normal regression run of the full perf-suite, though, this incurs
    a significant cost to generate numbers nobody will actually look at;
    about 25% of the total time of the test suite is spent in p5302. And the
    low-thread-count runs are the most expensive part of it, since they're
    (unsurprisingly) not using as many threads.
    
    Let's skip these tests by default, but make it possible for people
    working on index-pack to still run them by setting an environment
    variable. Rather than make this specific to p5302, let's introduce a
    generic mechanism. This makes it possible to run the full suite with
    every possible test if somebody really wants to burn some CPU.
    
    Signed-off-by: Jeff King <peff@peff.net>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    peff authored and gitster committed Aug 21, 2020
    Configuration menu
    Copy the full SHA
    4727425 View commit details
    Browse the repository at this point in the history
  11. p5302: count up to online-cpus for thread tests

    When PERF_EXTRA is enabled, p5302 checks the performance of index-pack
    with various numbers of threads. This can be useful for deciding what
    the default should be (which is currently capped at 3 threads based on
    the results of this script).
    
    However, we only go up to 8 threads, and modern machines may have more.
    Let's get the number of CPUs from test-tool, and test various numbers of
    threads between one and that maximum.
    
    Note that the current tests aren't all identical, as we have to set
    GIT_FORCE_THREADS for the --threads=1 test (which measures the overhead
    of starting a single worker thread versus the "0" case of using the main
    thread). To keep the loop simple, we'll keep the "0" case out of it, and
    set GIT_FORCE_THREADS=1 for all of the other cases (it's a noop for all
    but the "1" case, since numbers higher than 1 would always need
    threads).
    
    Note also that we could skip running "test-tool" if PERF_EXTRA isn't
    set. However, there's some small value in knowing the number of threads,
    so that we can mark each test as skipped in the output.
    
    Signed-off-by: Jeff King <peff@peff.net>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    peff authored and gitster committed Aug 21, 2020
    Configuration menu
    Copy the full SHA
    218389b View commit details
    Browse the repository at this point in the history
  12. index-pack: adjust default threading cap

    Commit b8a2486 (index-pack: support multithreaded delta resolving,
    2012-05-06) describes an experiment that shows that setting the number
    of threads for index-pack higher than 3 does not help.
    
    I repeated that experiment using a more modern version of Git and a more
    modern CPU and got different results.
    
    Here are timings for p5302 against linux.git run on my laptop, a Core
    i9-9880H with 8 cores plus hyperthreading (so online-cpus returns 16):
    
      5302.3: index-pack 0 threads                   256.28(253.41+2.79)
      5302.4: index-pack 1 threads                   257.03(254.03+2.91)
      5302.5: index-pack 2 threads                   149.39(268.34+3.06)
      5302.6: index-pack 4 threads                   94.96(294.10+3.23)
      5302.7: index-pack 8 threads                   68.12(339.26+3.89)
      5302.8: index-pack 16 threads                  70.90(655.03+7.21)
      5302.9: index-pack default number of threads   116.91(290.05+3.21)
    
    You can see that wall-clock times continue to improve dramatically up to
    the number of cores, but bumping beyond that (into hyperthreading
    territory) does not help (and in fact hurts a little).
    
    Here's the same experiment on a machine with dual Xeon 6230's, totaling
    40 cores (80 with hyperthreading):
    
      5302.3: index-pack 0 threads                    310.04(302.73+6.90)
      5302.4: index-pack 1 threads                    310.55(302.68+7.40)
      5302.5: index-pack 2 threads                    178.17(304.89+8.20)
      5302.6: index-pack 5 threads                    99.53(315.54+9.56)
      5302.7: index-pack 10 threads                   72.80(327.37+12.79)
      5302.8: index-pack 20 threads                   60.68(357.74+21.66)
      5302.9: index-pack 40 threads                   58.07(454.44+67.96)
      5302.10: index-pack 80 threads                  59.81(720.45+334.52)
      5302.11: index-pack default number of threads   134.18(309.32+7.98)
    
    The results are similar; things stop improving at 40 threads. Curiously,
    going from 20 to 40 really doesn't help much, either (and increases CPU
    time considerably). So that may represent an actual barrier to
    parallelism, where we lose out due to context-switching and loss of
    cache locality, but don't reap the wall-clock benefits due to contention
    of our coarse-grained locks.
    
    So what's a good default value? It's clear that the current cap of 3 is
    too low; our default values are 42% and 57% slower than the best times
    on each machine. The results on the 40-core machine imply that 20
    threads is an actual barrier regardless of the number of cores, so we'll
    take that as a maximum. We get the best results on these machines at
    half of the online-cpus value. That's presumably a result of the
    hyperthreading. That's common on multi-core Intel processors, but not
    necessarily elsewhere. But if we take it as an assumption, we can
    perform optimally on hyperthreaded machines and still do much better
    than the status quo on other machines, as long as we never half below
    the current value of 3.
    
    So that's what this patch does.
    
    Signed-off-by: Jeff King <peff@peff.net>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    peff authored and gitster committed Aug 21, 2020
    Configuration menu
    Copy the full SHA
    fbff95b View commit details
    Browse the repository at this point in the history
  13. ci: fix inconsistent indentation

    While YAML allows different indentation styles as long as each block
    is consistent, it is rather unusual to mix different indentations in
    a single file.  Adjust to use two-space indentation everywhere.
    
    Signed-off-by: Adrian Moennich <adrian@planetcoding.net>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    ThiefMaster authored and gitster committed Aug 21, 2020
    Configuration menu
    Copy the full SHA
    055747c View commit details
    Browse the repository at this point in the history
  14. t6300: unify %(trailers) and %(contents:trailers) tests

    Currently, there are different tests for testing %(trailers) and
    %(contents:trailers) causing redundant copy.
    
    Its time to get rid of duplicate code.
    
    Mentored-by: Christian Couder <chriscool@tuxfamily.org>
    Mentored-by: Heba Waly <heba.waly@gmail.com>
    Signed-off-by: Hariom Verma <hariom18599@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    harry-hov authored and gitster committed Aug 21, 2020
    Configuration menu
    Copy the full SHA
    a8e0f50 View commit details
    Browse the repository at this point in the history
  15. t4013: improve diff-post-processor logic

    From 72f936b (t4013: make test hash independent, 2020-02-07),
    we started to adjust metadata of git-diff's output in order to
    ignore uninteresting metadata which is dependent of underlying hash
    algorithm.
    
    However, we forgot to special case all-zero object names, which is
    special for missing objects, in consequence, we could't catch
    possible future bugs where object names is all-zeros including but
    not limited to:
    * show intend-to-add entry
    * deleted entry
    * diff between index and working tree with new file
    
    We also mistakenly munged file-modes as if they were object names
    abbreviated to 6 hexadecimal digits.
    
    In addition, in the upcoming change, we would like to test for
    customizing the length of abbreviated blob objects on the index line,
    which is not supported by current diff-processor logic.
    
    Let's fix the bug for all-zero object names, and file modes.
    While we're at it, support abbreviation of object names up to 16 bytes.
    
    Based-on-patch-by: Junio C Hamano <gitster@pobox.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
    Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    bk2204 authored and gitster committed Aug 21, 2020
    Configuration menu
    Copy the full SHA
    fc7e73d View commit details
    Browse the repository at this point in the history
  16. diff: index-line: respect --abbrev in object's name

    A handful of Git's commands respect `--abbrev' for customizing length
    of abbreviation of object names.
    
    For diff-family, Git supports 2 different options for 2 different
    purposes, `--full-index' for showing diff-patch object's name in full,
    and `--abbrev' to customize the length of object names in diff-raw and
    diff-tree header lines, without any options to customise the length of
    object names in diff-patch format. When working with diff-patch format,
    we only have two options, either full index, or default abbrev length.
    
    Although, that behaviour is documented, it doesn't stop users from
    trying to use `--abbrev' with the hope of customising diff-patch's
    objects' name's abbreviation.
    
    Let's allow the blob object names shown on the "index" line to be
    abbreviated to arbitrary length given via the "--abbrev" option.
    
    To preserve backward compatibility with old script that specify both
    `--full-index' and `--abbrev', always show full object id
    if `--full-index' is specified.
    
    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 Aug 21, 2020
    Configuration menu
    Copy the full SHA
    3046c7f View commit details
    Browse the repository at this point in the history
  17. ref-filter: 'contents:trailers' show error if : is missing

    The 'contents' atom does not show any error if used with 'trailers'
    atom and colon is missing before trailers arguments.
    
    e.g %(contents:trailersonly) works, while it shouldn't.
    
    It is definitely not an expected behavior.
    
    Let's fix this bug.
    
    Mentored-by: Christian Couder <chriscool@tuxfamily.org>
    Mentored-by: Heba Waly <heba.waly@gmail.com>
    Helped-by: Eric Sunshine <sunshine@sunshineco.com>
    Signed-off-by: Hariom Verma <hariom18599@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    harry-hov authored and gitster committed Aug 21, 2020
    Configuration menu
    Copy the full SHA
    2c22e10 View commit details
    Browse the repository at this point in the history
  18. ident: say whose identity is missing when giving user.name hint

    If `user.name` and `user.email` have not been configured and the
    user invokes:
    
        git commit --author=...
    
    without specifying the committer identity, then Git errors out with
    a message asking the user to configure `user.name` and `user.email`
    but doesn't tell the user which attribution was missing. This can be
    confusing for a user new to Git who isn't aware of the distinction
    between user, author, and committer.
    
    Give such users a bit more help by extending the error message to
    also say which attribution is expected.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    gitster committed Aug 21, 2020
    Configuration menu
    Copy the full SHA
    9ed104e View commit details
    Browse the repository at this point in the history

Commits on Aug 22, 2020

  1. checkout, restore: make pathspec recursive

    The pathspec given to git checkout and git restore is used with both
    tree_entry_interesting (via read_tree_recursive) and match_pathspec
    (via ce_path_match).  The latter effectively only supports recursive
    matching regardless of the value of the pathspec flag "recursive",
    which is unset here.
    
    That causes different match results for pathspecs with wildcards, and
    can lead checkout and restore in no-overlay mode to remove entries
    instead of modifying them.  Enable recursive matching for both checkout
    and restore to make matching consistent.
    
    Setting the flag in checkout_main() technically also affects git switch,
    but since that command doesn't accept pathspecs at all this has no
    actual consequence.
    
    Reported-by: Sergii Shkarnikov <sergii.shkarnikov@globallogic.com>
    Initial-test-by: Sergii Shkarnikov <sergii.shkarnikov@globallogic.com>
    Helped-by: Jeff King <peff@peff.net>
    Signed-off-by: René Scharfe <l.s.r@web.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    rscharfe authored and gitster committed Aug 22, 2020
    Configuration menu
    Copy the full SHA
    bfda204 View commit details
    Browse the repository at this point in the history
  2. bisect: add first-parent option to documentation

    Ensure that the [--first-parent] option is listed in the output of
    "git bisect -h".
    
    Signed-off-by: Aaron Lipman <alipman88@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    alipman88 authored and gitster committed Aug 22, 2020
    Configuration menu
    Copy the full SHA
    6028f5f View commit details
    Browse the repository at this point in the history

Commits on Aug 24, 2020

  1. Merge branch 'es/init-no-separate-git-dir-in-bare'

    The purpose of "git init --separate-git-dir" is to initialize a
    new project with the repository separate from the working tree,
    or, in the case of an existing project, to move the repository
    (the .git/ directory) out of the working tree. It does not make
    sense to use --separate-git-dir with a bare repository for which
    there is no working tree, so disallow its use with bare
    repositories.
    
    * es/init-no-separate-git-dir-in-bare:
      init: disallow --separate-git-dir with bare repository
    gitster committed Aug 24, 2020
    Configuration menu
    Copy the full SHA
    a654836 View commit details
    Browse the repository at this point in the history
  2. Merge branch 'ds/midx-repack-to-batch-size'

    The "--batch-size" option of "git multi-pack-index repack" command
    is now used to specify that very small packfiles are collected into
    one until the total size roughly exceeds it.
    
    * ds/midx-repack-to-batch-size:
      multi-pack-index: repack batches below --batch-size
    gitster committed Aug 24, 2020
    Configuration menu
    Copy the full SHA
    9e8c754 View commit details
    Browse the repository at this point in the history
  3. Merge branch 'en/dir-nonbare-embedded'

    "ls-files -o" mishandled the top-level directory of another git
    working tree that hangs in the current git working tree.
    
    * en/dir-nonbare-embedded:
      dir: avoid prematurely marking nonbare repositories as matches
      t3000: fix some test description typos
    gitster committed Aug 24, 2020
    Configuration menu
    Copy the full SHA
    11f433f View commit details
    Browse the repository at this point in the history
  4. Merge branch 'jk/unleak-fixes'

    Fix some incorrect UNLEAK() annotations.
    
    * jk/unleak-fixes:
      ls-remote: simplify UNLEAK() usage
      stop calling UNLEAK() before die()
    gitster committed Aug 24, 2020
    Configuration menu
    Copy the full SHA
    ff20794 View commit details
    Browse the repository at this point in the history
  5. Merge branch 'rs/more-buffered-io'

    Use more buffered I/O where we used to call many small write(2)s.
    
    * rs/more-buffered-io:
      upload-pack: use buffered I/O to talk to rev-list
      midx: use buffered I/O to talk to pack-objects
      connected: use buffered I/O to talk to rev-list
    gitster committed Aug 24, 2020
    Configuration menu
    Copy the full SHA
    d8488b9 View commit details
    Browse the repository at this point in the history
  6. Merge branch 'ma/doc-sha-256-is-experimental'

    The recent addition of SHA-256 support is marked as experimental in
    the documentation.
    
    * ma/doc-sha-256-is-experimental:
      Documentation: mark `--object-format=sha256` as experimental
    gitster committed Aug 24, 2020
    Configuration menu
    Copy the full SHA
    d1ff741 View commit details
    Browse the repository at this point in the history
  7. Merge branch 'jc/no-update-fetch-head'

    "git fetch" learned --no-write-fetch-head option to avoid writing
    the FETCH_HEAD file.
    
    * jc/no-update-fetch-head:
      fetch: optionally allow disabling FETCH_HEAD update
    gitster committed Aug 24, 2020
    Configuration menu
    Copy the full SHA
    b556050 View commit details
    Browse the repository at this point in the history
  8. Merge branch 'mt/checkout-entry-dead-code-removal'

    Code clean-up.
    
    * mt/checkout-entry-dead-code-removal:
      checkout_entry(): remove unreachable error() call
    gitster committed Aug 24, 2020
    Configuration menu
    Copy the full SHA
    43c80d2 View commit details
    Browse the repository at this point in the history
  9. Merge branch 'dl/subtree-docs'

    Doc updates for subtree (in contrib/)
    
    * dl/subtree-docs:
      contrib/subtree: document 'push' does not take '--squash'
      contrib/subtree: fix "unsure" for --message in the document
    gitster committed Aug 24, 2020
    Configuration menu
    Copy the full SHA
    8923a45 View commit details
    Browse the repository at this point in the history
  10. Merge branch 'rs/patch-id-with-incomplete-line'

    The patch-id computation did not ignore the "incomplete last line"
    marker like whitespaces.
    
    * rs/patch-id-with-incomplete-line:
      patch-id: ignore newline at end of file in diff_flush_patch_id()
    gitster committed Aug 24, 2020
    Configuration menu
    Copy the full SHA
    5122614 View commit details
    Browse the repository at this point in the history
  11. Merge branch 'en/dir-clear'

    Leakfix with code clean-up.
    
    * en/dir-clear:
      dir: fix problematic API to avoid memory leaks
      dir: make clear_directory() free all relevant memory
    gitster committed Aug 24, 2020
    Configuration menu
    Copy the full SHA
    ad00f44 View commit details
    Browse the repository at this point in the history
  12. Tenth batch

    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    gitster committed Aug 24, 2020
    Configuration menu
    Copy the full SHA
    e9b77c8 View commit details
    Browse the repository at this point in the history

Commits on Aug 25, 2020

  1. (various): document from_promisor parameter

    88e2f9e ("introduce fetch-object: fetch one promisor object",
    2017-12-05) plumbed through the from_promisor parameter but did
    not document it everywhere it appeared. Add the documentation.
    
    (It also plumbed through the no_dependents parameter, but I have left
    that alone because it is being removed in a commit under review [1].)
    
    [1] https://lore.kernel.org/git/e8f16d69089a5011c355d5939c56fa53b7a1eb2d.1597184949.git.jonathantanmy@google.com/
    
    Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    jonathantanmy authored and gitster committed Aug 25, 2020
    Configuration menu
    Copy the full SHA
    42d418d View commit details
    Browse the repository at this point in the history
  2. fetch-pack: document only_packfile in get_pack()

    dd4b732 ("upload-pack: send part of packfile response as uri",
    2020-06-10) added the "only_packfile" parameter to get_pack() but did
    not document it. Add documentation.
    
    Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    jonathantanmy authored and gitster committed Aug 25, 2020
    Configuration menu
    Copy the full SHA
    ece9aea View commit details
    Browse the repository at this point in the history
  3. fetch-pack: make packfile URIs work with transfer.fsckobjects

    When fetching with packfile URIs and transfer.fsckobjects=1, use the
    --fsck-objects instead of the --strict flag when invoking index-pack so
    that links are not checked, only objects. This is because incomplete
    links are expected. (A subsequent connectivity check will be done when
    all the packs have been downloaded regardless of whether
    transfer.fsckobjects is set.)
    
    This is similar to 98a2ea4 ("fetch-pack: do not check links for
    partial fetch", 2018-03-15), but for packfile URIs instead of partial
    clones.
    
    Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    jonathantanmy authored and gitster committed Aug 25, 2020
    Configuration menu
    Copy the full SHA
    0bd96be View commit details
    Browse the repository at this point in the history
  4. submodule: eliminate unused parameters from print_submodule_summary()

    Eliminate the parameters 'missing_{src,dst}' from the
    'print_submodule_summary()' function call since they are not used
    anywhere in the function.
    
    Reported-by: Jeff King <peff@peff.net>
    Mentored-by: Christian Couder <chriscool@tuxfamily.org>
    Mentored-by: Kaartic Sivaraam <kaartic.sivaraam@gmail.com>
    Signed-off-by: Shourya Shukla <shouryashukla.oo@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    periperidip authored and gitster committed Aug 25, 2020
    Configuration menu
    Copy the full SHA
    e0f7ae5 View commit details
    Browse the repository at this point in the history
  5. submodule: fix style in function definition

    The definitions of 'verify_submodule_committish()' and
    'print_submodule_summary()' had wrong styling in terms of the asterisk
    placement. Amend them.
    
    Also, the warning printed in case of an unexpected file mode printed the
    mode in decimal. Print it in octal for enhanced readability.
    
    Reported-by: Kaartic Sivaraam <kaartic.sivaraam@gmail.com>
    Mentored-by: Christian Couder <chriscool@tuxfamily.org>
    Mentored-by: Kaartic Sivaraam <kaartic.sivaraam@gmail.com>
    Helped-by: Junio C Hamano <gitster@pobox.com>
    Signed-off-by: Shourya Shukla <shouryashukla.oo@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    periperidip authored and gitster committed Aug 25, 2020
    Configuration menu
    Copy the full SHA
    f0c6b64 View commit details
    Browse the repository at this point in the history
  6. refs: remove lookup cache for reference-transaction hook

    When adding the reference-transaction hook, there were concerns about
    the performance impact it may have on setups which do not make use of
    the new hook at all. After all, it gets executed every time a reftx is
    prepared, committed or aborted, which linearly scales with the number of
    reference-transactions created per session. And as there are code paths
    like `git push` which create a new transaction for each reference to be
    updated, this may translate to calling `find_hook()` quite a lot.
    
    To address this concern, a cache was added with the intention to not
    repeatedly do negative hook lookups. Turns out this cache caused a
    regression, which was fixed via e5256c8 (refs: fix interleaving hook
    calls with reference-transaction hook, 2020-08-07). In the process of
    discussing the fix, we realized that the cache doesn't really help even
    in the negative-lookup case. While performance tests added to benchmark
    this did show a slight improvement in the 1% range, this really doesn't
    warrent having a cache. Furthermore, it's quite flaky, too. E.g. running
    it twice in succession produces the following results:
    
    Test                         master            pks-reftx-hook-remove-cache
    --------------------------------------------------------------------------
    1400.2: update-ref           2.79(2.16+0.74)   2.73(2.12+0.71) -2.2%
    1400.3: update-ref --stdin   0.22(0.08+0.14)   0.21(0.08+0.12) -4.5%
    
    Test                         master            pks-reftx-hook-remove-cache
    --------------------------------------------------------------------------
    1400.2: update-ref           2.70(2.09+0.72)   2.74(2.13+0.71) +1.5%
    1400.3: update-ref --stdin   0.21(0.10+0.10)   0.21(0.08+0.13) +0.0%
    
    One case notably absent from those benchmarks is a single executable
    searching for the hook hundreds of times, which is exactly the case for
    which the negative cache was added. p1400.2 will spawn a new update-ref
    for each transaction and p1400.3 only has a single reference-transaction
    for all reference updates. So this commit adds a third benchmark, which
    performs an non-atomic push of a thousand references. This will create a
    new reference transaction per reference. But even for this case, the
    negative cache doesn't consistently improve performance:
    
    Test                         master            pks-reftx-hook-remove-cache
    --------------------------------------------------------------------------
    1400.4: nonatomic push       6.63(6.50+0.13)   6.81(6.67+0.14) +2.7%
    1400.4: nonatomic push       6.35(6.21+0.14)   6.39(6.23+0.16) +0.6%
    1400.4: nonatomic push       6.43(6.31+0.13)   6.42(6.28+0.15) -0.2%
    
    So let's just remove the cache altogether to simplify the code.
    
    Signed-off-by: Patrick Steinhardt <ps@pks.im>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    pks-t authored and gitster committed Aug 25, 2020
    Configuration menu
    Copy the full SHA
    0a0fbbe View commit details
    Browse the repository at this point in the history

Commits on Aug 26, 2020

  1. revision: set rev_input_given in handle_revision_arg()

    Commit 7ba8262 (revision: add rev_input_given flag, 2017-08-02) added
    a flag to rev_info to tell whether we got any revision arguments. As
    explained there, this is necessary because some revision arguments may
    not produce any pending traversal objects, but should still inhibit
    default behaviors (e.g., a glob that matches nothing).
    
    However, it only set the flag in the globbing code, but not for
    revisions we get on the command-line or via stdin. This leads to two
    problems:
    
      - the command-line code keeps its own separate got_rev_arg flag; this
        isn't wrong, but it's confusing and an extra maintenance burden
    
      - even specifically-named rev arguments might end up not adding any
        pending objects: if --ignore-missing is set, then specifying a
        missing object is a noop rather than an error.
    
    And that leads to some user-visible bugs:
    
      - when deciding whether a default rev like "HEAD" should kick in, we
        check both got_rev_arg and rev_input_given. That means that
        "--ignore-missing $ZERO_OID" works on the command-line (where we set
        got_rev_arg) but not on --stdin (where we don't)
    
      - when rev-list decides whether it should complain that it wasn't
        given a starting point, it relies on rev_input_given. So it can't
        even get the command-line "--ignore-missing $ZERO_OID" right
    
    Let's consistently set the flag if we got any revision argument. That
    lets us clean up the redundant got_rev_arg, and fixes both of those bugs
    (but note there are three new tests: we'll confirm the already working
    git-log command-line case).
    
    A few implementation notes:
    
      - conceptually we want to set the flag whenever handle_revision_arg()
        finds an actual revision arg ("handles" it, you might say). But it
        covers a ton of cases with early returns. Rather than annotating
        each one, we just wrap it and use its success exit-code to set the
        flag in one spot.
    
      - the new rev-list test is in t6018, which is titled to cover globs.
        This isn't exactly a glob, but it made sense to stick it with the
        other tests that handle the "even though we got a rev, we have no
        pending objects" case, which are globs.
    
      - the tests check for the oid of a missing object, which it's pretty
        clear --ignore-missing should ignore. You can see the same behavior
        with "--ignore-missing a-ref-that-does-not-exist", because
        --ignore-missing treats them both the same. That's perhaps less
        clearly correct, and we may want to change that in the future. But
        the way the code and tests here are written, we'd continue to do the
        right thing even if it does.
    
    Reported-by: Bryan Turner <bturner@atlassian.com>
    Signed-off-by: Jeff King <peff@peff.net>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    peff authored and gitster committed Aug 26, 2020
    Configuration menu
    Copy the full SHA
    04a0e98 View commit details
    Browse the repository at this point in the history
  2. builtin/repack.c: invalidate MIDX only when necessary

    In 525e18c (midx: clear midx on repack, 2018-07-12), 'git repack'
    learned to remove a multi-pack-index file if it added or removed a pack
    from the object store.
    
    This mechanism is a little over-eager, since it is only necessary to
    drop a MIDX if 'git repack' removes a pack that the MIDX references.
    Adding a pack outside of the MIDX does not require invalidating the
    MIDX, and likewise for removing a pack the MIDX does not know about.
    
    Teach 'git repack' to check for this by loading the MIDX, and checking
    whether the to-be-removed pack is known to the MIDX. This requires a
    slightly odd alternation to a test in t5319, which is explained with a
    comment. A new test is added to show that the MIDX is left alone when
    both packs known to it are marked as .keep, but two packs unknown to it
    are removed and combined into one new pack.
    
    Helped-by: Derrick Stolee <dstolee@microsoft.com>
    Signed-off-by: Taylor Blau <me@ttaylorr.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    ttaylorr authored and gitster committed Aug 26, 2020
    Configuration menu
    Copy the full SHA
    e08f7bb View commit details
    Browse the repository at this point in the history
  3. t3436: do not run git-merge-recursive in dashed form

    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    gitster committed Aug 26, 2020
    Configuration menu
    Copy the full SHA
    6160b2e View commit details
    Browse the repository at this point in the history
  4. transport-helper: do not run git-remote-ext etc. in dashed form

    Running it as "git remote-ext" and letting "git" dispatch to
    "remote-ext" would just be fine and is more idiomatic.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    gitster committed Aug 26, 2020
    Configuration menu
    Copy the full SHA
    675df19 View commit details
    Browse the repository at this point in the history
  5. cvsexportcommit: do not run git programs in dashed form

    This ancient script runs "git-foo" all over the place, which is
    OK for a scripted Porcelain in the Git suite, but asking "git" to
    dispatch to subcommands is the usual way these days.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    gitster committed Aug 26, 2020
    Configuration menu
    Copy the full SHA
    7cff3b6 View commit details
    Browse the repository at this point in the history
  6. run_command: teach API users to use embedded 'args' more

    The child_process structure has an embedded strvec for formulating
    the command line argument list these days, but code that predates
    the wide use of it prepared a separate char *argv[] array and
    manually set the child_process.argv pointer point at it.
    
    Teach these old-style code to lose the separate argv[] array.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    gitster committed Aug 26, 2020
    Configuration menu
    Copy the full SHA
    afbdba3 View commit details
    Browse the repository at this point in the history

Commits on Aug 27, 2020

  1. worktree: fix leak in check_clean_worktree()

    We allocate a child_env strvec but never free its memory. Instead, let's
    just use the strvec that our child_process struct provides, which is
    cleaned up automatically when we run the command.
    
    And while we're moving the initialization of the child_process around,
    let's switch it to use the official init function (zero-initializing it
    works OK, since strvec is happy enough with that, but it sets a bad
    example).
    
    Signed-off-by: Jeff King <peff@peff.net>
    Reviewed-by: Eric Sunshine <sunshine@sunshineco.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    peff authored and gitster committed Aug 27, 2020
    Configuration menu
    Copy the full SHA
    27ed6cc View commit details
    Browse the repository at this point in the history
  2. credential-cache: use child_process.args

    As child_process structure has an embedded strvec args for
    formulating the command line, let's use it instead of using
    an out-of-line argv[] whose length needs to be maintained
    correctly.
    
    Also, when spawning a git subcommand, omit it from the command list
    and instead use the .git_cmd bit in the child_process structure.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    gitster committed Aug 27, 2020
    Configuration menu
    Copy the full SHA
    c0e190c View commit details
    Browse the repository at this point in the history
  3. pretty-options.txt: fix --no-abbrev-commit description

    Description suggested --no-abbrev-commit negates --oneline as well as any other
    option that implies --abbrev-commit. Fix it to say that it's --abbrev-commit
    that is negated, not the option that implies it.
    
    Signed-off-by: Sergey Organov <sorganov@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    sorganov authored and gitster committed Aug 27, 2020
    Configuration menu
    Copy the full SHA
    ee22a29 View commit details
    Browse the repository at this point in the history
  4. worktree: add skeleton "repair" command

    Worktree administrative files can become corrupted or outdated due to
    external factors. Although, it is often possible to recover from such
    situations by hand-tweaking these files, doing so requires intimate
    knowledge of worktree internals. While information necessary to make
    such repairs manually can be obtained from git-worktree.txt and
    gitrepository-layout.txt, we can assist users more directly by teaching
    git-worktree how to repair its administrative files itself (at least to
    some extent). Therefore, add a "git worktree repair" command which
    attempts to correct common problems which may arise due to factors
    beyond Git's control.
    
    At this stage, the "repair" command is a mere skeleton; subsequent
    commits will flesh out the functionality.
    
    Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    sunshineco authored and gitster committed Aug 27, 2020
    Configuration menu
    Copy the full SHA
    e8e1ff2 View commit details
    Browse the repository at this point in the history
  5. t7421: eliminate 'grep' check in t7421.4 for mingw compatibility

    The 'grep' check in test 4 of t7421 resulted in the failure of t7421 on
    Windows due to a different error message
    
        error: cannot spawn git: No such file or directory
    
    instead of
    
        fatal: exec 'rev-parse': cd to 'my-subm' failed: No such file or directory
    
    Tighten up the check to compute 'src_abbrev' by guarding the
    'verify_submodule_committish()' call using `p->status !='D'`, so that
    the former isn't called in case of non-existent submodule directory,
    consequently, there is no such error message on any execution
    environment. The same need not be implemented for 'dst_abbrev' and is
    rather redundant since the conditional 'if (S_ISGITLINK(p->mod_dst))'
    already guards the 'verify_submodule_committish()' when we have a
    status of 'D'.
    
    Therefore, eliminate the 'grep' check in t7421. Instead, verify the
    absence of an error message by doing a 'test_must_be_empty' on the
    file containing the error.
    
    Reported-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
    Helped-by: Kaartic Sivaraam <kaartic.sivaraam@gmail.com>
    Mentored-by: Christian Couder <chriscool@tuxfamily.org>
    Mentored-by: Kaartic Sivaraam <kaartic.sivaraam@gmail.com>
    Signed-off-by: Shourya Shukla <shouryashukla.oo@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    periperidip authored and gitster committed Aug 27, 2020
    Configuration menu
    Copy the full SHA
    d79b145 View commit details
    Browse the repository at this point in the history
  6. Merge branch 'en/mem-pool'

    API update.
    
    * en/mem-pool:
      mem-pool: use consistent pool variable name
      mem-pool: use more standard initialization and finalization
      mem-pool: add convenience functions for strdup and strndup
    gitster committed Aug 27, 2020
    Configuration menu
    Copy the full SHA
    edab8a8 View commit details
    Browse the repository at this point in the history
  7. Merge branch 'jk/leakfix'

    Code clean-up.
    
    * jk/leakfix:
      submodule--helper: fix leak of core.worktree value
      config: fix leak in git_config_get_expiry_in_days()
      config: drop git_config_get_string_const()
      config: fix leaks from git_config_get_string_const()
      checkout: fix leak of non-existent branch names
      submodule--helper: use strbuf_release() to free strbufs
      clear_pattern_list(): clear embedded hashmaps
    gitster committed Aug 27, 2020
    Configuration menu
    Copy the full SHA
    0d9a8e3 View commit details
    Browse the repository at this point in the history
  8. Merge branch 'rz/complete-more-options'

    Command line completion (in contrib/) usually omits redundant,
    deprecated and/or dangerous options from its output; it learned to
    optionally include all of them.
    
    * rz/complete-more-options:
      completion: add GIT_COMPLETION_SHOW_ALL env var
      parse-options: add --git-completion-helper-all
    gitster committed Aug 27, 2020
    Configuration menu
    Copy the full SHA
    bd3ae9f View commit details
    Browse the repository at this point in the history
  9. Merge branch 'hn/refs-fetch-head-is-special'

    The FETCH_HEAD is now always read from the filesystem regardless of
    the ref backend in use, as its format is much richer than the
    normal refs, and written directly by "git fetch" as a plain file..
    
    * hn/refs-fetch-head-is-special:
      refs: read FETCH_HEAD and MERGE_HEAD generically
      refs: move gitdir into base ref_store
      refs: fix comment about submodule ref_stores
      refs: split off reading loose ref data in separate function
    gitster committed Aug 27, 2020
    Configuration menu
    Copy the full SHA
    98df75b View commit details
    Browse the repository at this point in the history
  10. Eleventh batch

    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    gitster committed Aug 27, 2020
    Configuration menu
    Copy the full SHA
    20de7e7 View commit details
    Browse the repository at this point in the history
  11. doc: clarify how exit status of post-checkout hook is used

    Because the hook runs after the main checkout operation finishes, it
    cannot affect what branch will be the current branch, what paths are
    updated in the working tree, etc., which was described as "cannot
    affect the outcome of 'checkout'".
    
    However, the exit status of the hook is used as the exit status of
    the 'checkout' command and is observable by anybody who spawned the
    'checkout', which was missing from the documentation.  Fix this.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    gitster committed Aug 27, 2020
    Configuration menu
    Copy the full SHA
    3100fd5 View commit details
    Browse the repository at this point in the history

Commits on Aug 28, 2020

  1. ref-filter: support different email formats

    Currently, ref-filter only supports printing email with angle brackets.
    
    Let's add support for two more email options.
    - trim : for email without angle brackets.
    - localpart : for the part before the @ sign out of trimmed email
    
    Mentored-by: Christian Couder <chriscool@tuxfamily.org>
    Mentored-by: Heba Waly <heba.waly@gmail.com>
    Signed-off-by: Hariom Verma <hariom18599@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    harry-hov authored and gitster committed Aug 28, 2020
    Configuration menu
    Copy the full SHA
    b82445d View commit details
    Browse the repository at this point in the history
  2. ref-filter: refactor grab_objectname()

    Prepares `grab_objectname()` for more generic usage.
    This change will allow us to reuse `grab_objectname()` for
    the `tree` and `parent` atoms in a following commit.
    
    Mentored-by: Christian Couder <chriscool@tuxfamily.org>
    Mentored-by: Heba Waly <heba.waly@gmail.com>
    Signed-off-by: Hariom Verma <hariom18599@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    harry-hov authored and gitster committed Aug 28, 2020
    Configuration menu
    Copy the full SHA
    5101100 View commit details
    Browse the repository at this point in the history
  3. ref-filter: modify error messages in grab_objectname()

    As we plan to use `grab_objectname()` for `tree` and `parent` atom,
    it's better to parameterize the error messages in the function
    `grab_objectname()` where "objectname" is hard coded.
    
    Mentored-by: Christian Couder <chriscool@tuxfamily.org>
    Mentored-by: Heba Waly <heba.waly@gmail.com>
    Signed-off-by: Hariom Verma <hariom18599@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    harry-hov authored and gitster committed Aug 28, 2020
    Configuration menu
    Copy the full SHA
    e7601eb View commit details
    Browse the repository at this point in the history
  4. ref-filter: rename objectname related functions and fields

    In previous commits, we prepared some `objectname` related functions
    for more generic usage, so that these functions can be used for `tree`
    and `parent` atom.
    
    But the name of some functions and fields may mislead someone.
    For ex: function `objectname_atom_parser()` implies that it is
    for atom `objectname`.
    
    Let's rename all such functions and fields.
    
    Mentored-by: Christian Couder <chriscool@tuxfamily.org>
    Mentored-by: Heba Waly <heba.waly@gmail.com>
    Signed-off-by: Hariom Verma <hariom18599@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    harry-hov authored and gitster committed Aug 28, 2020
    Configuration menu
    Copy the full SHA
    87d3beb View commit details
    Browse the repository at this point in the history
  5. ref-filter: add short modifier to 'tree' atom

    Sometimes while using 'tree' atom, user might want to see abbrev hash
    instead of full 40 character hash.
    
    Just like 'objectname', it might be convenient for users to have the
    `:short` and `:short=<length>` option for printing 'tree' hash.
    
    Let's introduce `short` option to 'tree' atom.
    
    Mentored-by: Christian Couder <chriscool@tuxfamily.org>
    Mentored-by: Heba Waly <heba.waly@gmail.com>
    Signed-off-by: Hariom Verma <hariom18599@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    harry-hov authored and gitster committed Aug 28, 2020
    Configuration menu
    Copy the full SHA
    837adb1 View commit details
    Browse the repository at this point in the history
  6. ref-filter: add short modifier to 'parent' atom

    Sometimes while using 'parent' atom, user might want to see abbrev hash
    instead of full 40 character hash.
    
    Just like 'objectname', it might be convenient for users to have the
    `:short` and `:short=<length>` option for printing 'parent' hash.
    
    Let's introduce `short` option to 'parent' atom.
    
    Mentored-by: Christian Couder <chriscool@tuxfamily.org>
    Mentored-by: Heba Waly <heba.waly@gmail.com>
    Signed-off-by: Hariom Verma <hariom18599@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    harry-hov authored and gitster committed Aug 28, 2020
    Configuration menu
    Copy the full SHA
    26bc0aa View commit details
    Browse the repository at this point in the history
  7. pretty: refactor format_sanitized_subject()

    The function 'format_sanitized_subject()' is responsible for
    sanitized subject line in pretty.c
    e.g.
    the subject line
    the-sanitized-subject-line
    
    It would be a nice enhancement to `subject` atom to have the
    same feature. So in the later commits, we plan to add this feature
    to ref-filter.
    
    Refactor `format_sanitized_subject()`, so it can be reused in
    ref-filter.c for adding new modifier `sanitize` to "subject" atom.
    
    Currently, the loop inside `format_sanitized_subject()` runs
    until `\n` is found. But now, we stored the first occurrence
    of `\n` in a variable `eol` and passed it in
    `format_sanitized_subject()`. And the loop runs upto `eol`.
    
    Mentored-by: Christian Couder <chriscool@tuxfamily.org>
    Mentored-by: Heba Waly <heba.waly@gmail.com>
    Signed-off-by: Hariom Verma <hariom18599@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    harry-hov authored and gitster committed Aug 28, 2020
    Configuration menu
    Copy the full SHA
    47d4676 View commit details
    Browse the repository at this point in the history
  8. ref-filter: add sanitize option for 'subject' atom

    Currently, subject does not take any arguments. This commit introduce
    `sanitize` formatting option to 'subject' atom.
    
    `subject:sanitize` - print sanitized subject line, suitable for a filename.
    
    e.g.
    %(subject): "the subject line"
    %(subject:sanitize): "the-subject-line"
    
    Mentored-by: Christian Couder <chriscool@tuxfamily.org>
    Mentored-by: Heba Waly <heba.waly@gmail.com>
    Signed-off-by: Hariom Verma <hariom18599@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    harry-hov authored and gitster committed Aug 28, 2020
    Configuration menu
    Copy the full SHA
    905f0a4 View commit details
    Browse the repository at this point in the history
  9. po: add missing letter for French message

    Add the missing "e" in "de".  While it is possible in French to omit it,
    that only occurs with an apostrophe and only when the next word starts
    with a vowel or mute h, which is not the case here.
    
    Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
    Acked-by: Jean-Noël Avila <jn.avila@free.fr>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    bk2204 authored and gitster committed Aug 28, 2020
    Configuration menu
    Copy the full SHA
    d9cd433 View commit details
    Browse the repository at this point in the history
  10. bisect: swap command-line options in documentation

    The positional arguments are specified in this order: "bad" then "good".
    To avoid confusion, the options above the positional arguments
    are now specified in the same order. They can still be specified in any
    order since they're options, not positional arguments.
    
    Signed-off-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    Calinou authored and gitster committed Aug 28, 2020
    Configuration menu
    Copy the full SHA
    ef4d9f8 View commit details
    Browse the repository at this point in the history
  11. midx: traverse the local MIDX first

    When a repository has an alternate object directory configured, callers
    can traverse through each alternate's MIDX by walking the '->next'
    pointer.
    
    But, when 'prepare_multi_pack_index_one()' loads multiple MIDXs, it
    places the new ones at the front of this pointer chain, not at the end.
    This can be confusing for callers such as 'git repack -ad', causing test
    failures like in t7700.6 with 'GIT_TEST_MULTI_PACK_INDEX=1'.
    
    The occurs when dropping a pack known to the local MIDX with alternates
    configured that have their own MIDX. Since the alternate's MIDX is
    returned via 'get_multi_pack_index()', 'midx_contains_pack()' returns
    true (which is correct, since it traverses through the '->next' pointer
    to find the MIDX in the chain that does contain the requested object).
    But, we call 'clear_midx_file()' on 'the_repository', which drops the
    MIDX at the path of the first MIDX in the chain, which (in the case of
    t7700.6 is the one in the alternate).
    
    This patch addresses that by:
    
      - placing the local MIDX first in the chain when calling
        'prepare_multi_pack_index_one()', and
    
      - introducing a new 'get_local_multi_pack_index()', which explicitly
        returns the repository-local MIDX, if any.
    
    Don't impose an additional order on the MIDX's '->next' pointer beyond
    that the first item in the chain must be local if one exists so that we
    avoid a quadratic insertion.
    
    Likewise, use 'get_local_multi_pack_index()' in
    'remove_redundant_pack()' to fix the formerly broken t7700.6 when run
    with 'GIT_TEST_MULTI_PACK_INDEX=1'.
    
    Finally, note that the MIDX ordering invariant is only preserved by the
    insertion order in 'prepare_packed_git()', which traverses through the
    ODB's '->next' pointer, meaning we visit the local object store first.
    This fragility makes this an undesirable long-term solution if more
    callers are added, but it is acceptable for now since this is the only
    caller.
    
    Helped-by: Jeff King <peff@peff.net>
    Signed-off-by: Jeff King <peff@peff.net>
    Signed-off-by: Taylor Blau <me@ttaylorr.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    ttaylorr authored and gitster committed Aug 28, 2020
    Configuration menu
    Copy the full SHA
    59552fb View commit details
    Browse the repository at this point in the history

Commits on Aug 31, 2020

  1. git-imap-send.txt: don't duplicate 'Examples' sections

    Remove the 'Examples' subsection in the 'Configuration' section and move
    these examples to the 'Examples' section. Also remove the 'Variables'
    title since it is now useless.
    
    Also, use appropriate Asciidoc syntax for configuration values, and
    capitalize 'Gmail' properly.
    
    Suggested-by: Junio C Hamano <gitster@pobox.com>
    Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    phil-blain authored and gitster committed Aug 31, 2020
    Configuration menu
    Copy the full SHA
    587e69b View commit details
    Browse the repository at this point in the history
  2. git-imap-send.txt: do verify SSL certificate for gmail.com

    As a public service, it is unlikely that the Gmail server is configured
    to throw a certificate that does not verify at the user.
    
    Remove the `sslVerify=false` config from the Gmail example.
    
    Also, comment it in the `example.com` example, and add a note to the
    user explaining that they might want to uncomment it if they are having
    trouble connecting. While at it, use an Asciidoc 'Note' section in the
    Gmail example also.
    
    Based-on-patch-by: Barbu Paul - Gheorghe <barbu.paul.gheorghe@gmail.com>
    Helped-by: Junio C Hamano <gitster@pobox.com>
    Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    phil-blain authored and gitster committed Aug 31, 2020
    Configuration menu
    Copy the full SHA
    08a694b View commit details
    Browse the repository at this point in the history
  3. git-imap-send.txt: add note about localized Gmail folders

    The name of the "Special-Use Mailboxes" in Gmail are localized
    using the user's localization settings. Add a note to that effect
    in `git imap-send`'s documentation, to make it easier for users to
    configure their account.
    
    Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    phil-blain authored and gitster committed Aug 31, 2020
    Configuration menu
    Copy the full SHA
    1bbac2a View commit details
    Browse the repository at this point in the history
  4. doc: mention GIT_SEQUENCE_EDITOR and 'sequence.editor' more

    The environment variable `GIT_SEQUENCE_EDITOR`, and the configuration
    variable 'sequence.editor', which were added in 821881d ("rebase -i":
    support special-purpose editor to edit insn sheet, 2011-10-17), are
    mentioned in the `git config` man page but not anywhere else.
    
    Include `config/sequencer.txt` in `git-rebase.txt`, so that both the
    environment variable and the configuration setting are mentioned there.
    
    Also, add `GIT_SEQUENCE_EDITOR` to the list of environment variables
    in `git(1)`.
    
    Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    phil-blain authored and gitster committed Aug 31, 2020
    Configuration menu
    Copy the full SHA
    902a126 View commit details
    Browse the repository at this point in the history
  5. worktree: teach "repair" to fix worktree back-links to main worktree

    The .git file in a linked worktree is a "gitfile" which points back to
    the .git/worktrees/<id> entry in the main worktree or bare repository.
    If a worktree's .git file is deleted or becomes corrupted or outdated,
    then the linked worktree won't know how to find the repository or any of
    its own administrative files (such as 'index', 'HEAD', etc.). An easy
    way for the .git file to become outdated is for the user to move the
    main worktree or bare repository. Although it is possible to manually
    update each linked worktree's .git file to reflect the new repository
    location, doing so requires a level of knowledge about worktree
    internals beyond what a user should be expected to know offhand.
    
    Therefore, teach "git worktree repair" how to repair broken or outdated
    worktree .git files automatically. (For this to work, the command must
    be invoked from within the main worktree or bare repository, or from
    within a worktree which has not become disconnected from the repository
    -- such as one which was created after the repository was moved.)
    
    Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    sunshineco authored and gitster committed Aug 31, 2020
    Configuration menu
    Copy the full SHA
    bdd1f3e View commit details
    Browse the repository at this point in the history
  6. worktree: teach "repair" to fix outgoing links to worktrees

    The .git/worktrees/<id>/gitdir file points at the location of a linked
    worktree's .git file. Its content must be of the form
    /path/to/worktree/.git (from which the location of the worktree itself
    can be derived by stripping the "/.git" suffix). If the gitdir file is
    deleted or becomes corrupted or outdated, then Git will be unable to
    find the linked worktree. An easy way for the gitdir file to become
    outdated is for the user to move the worktree manually (without using
    "git worktree move"). Although it is possible to manually update the
    gitdir file to reflect the new linked worktree location, doing so
    requires a level of knowledge about worktree internals beyond what a
    user should be expected to know offhand.
    
    Therefore, teach "git worktree repair" how to repair broken or outdated
    .git/worktrees/<id>/gitdir files automatically. (For this to work, the
    command must either be invoked from within the worktree whose gitdir
    file requires repair, or from within the main or any linked worktree by
    providing the path of the broken worktree as an argument to "git
    worktree repair".)
    
    Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    sunshineco authored and gitster committed Aug 31, 2020
    Configuration menu
    Copy the full SHA
    b214ab5 View commit details
    Browse the repository at this point in the history
  7. init: teach --separate-git-dir to repair linked worktrees

    A linked worktree's .git file is a "gitfile" pointing at the
    .git/worktrees/<id> directory within the repository. When `git init
    --separate-git-dir=<path>` is used on an existing repository to relocate
    the repository's .git/ directory to a different location, it neglects to
    update the .git files of linked worktrees, thus breaking the worktrees
    by making it impossible for them to locate the repository. Fix this by
    teaching --separate-git-dir to repair the .git file of each linked
    worktree to point at the new repository location.
    
    Reported-by: Henré Botha <henrebotha@gmail.com>
    Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    sunshineco authored and gitster committed Aug 31, 2020
    Configuration menu
    Copy the full SHA
    42264bc View commit details
    Browse the repository at this point in the history
  8. init: make --separate-git-dir work from within linked worktree

    The intention of `git init --separate-work-dir=<path>` is to move the
    .git/ directory to a location outside of the main worktree. When used
    within a linked worktree, however, rather than moving the .git/
    directory as intended, it instead incorrectly moves the worktree's
    .git/worktrees/<id> directory to <path>, thus disconnecting the linked
    worktree from its parent repository and breaking the worktree in the
    process since its local .git file no longer points at a location at
    which it can find the object database. Fix this broken behavior.
    
    An intentional side-effect of this change is that it also closes a
    loophole not caught by ccf236a (init: disallow --separate-git-dir
    with bare repository, 2020-08-09) in which the check to prevent
    --separate-git-dir being used in conjunction with a bare repository was
    unable to detect the invalid combination when invoked from within a
    linked worktree. Therefore, add a test to verify that this loophole is
    closed, as well.
    
    Reported-by: Henré Botha <henrebotha@gmail.com>
    Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    sunshineco authored and gitster committed Aug 31, 2020
    Configuration menu
    Copy the full SHA
    59d876c View commit details
    Browse the repository at this point in the history
  9. revision: add separate field for "-m" of "diff-index -m"

    Add separate 'match_missing' field for diff-index to use and set it when we
    encounter "-m" option. This field won't then be cleared when another meaning of
    "-m" is reverted (e.g., by "--no-diff-merges"), nor it will be affected by
    future option(s) that might drive 'ignore_merges' field.
    
    Use this new field from diff-lib:do_oneway_diff() instead of reusing
    'ignore_merges' field.
    
    Signed-off-by: Sergey Organov <sorganov@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    sorganov authored and gitster committed Aug 31, 2020
    Configuration menu
    Copy the full SHA
    572fc9a View commit details
    Browse the repository at this point in the history
  10. Merge branch 'am/ci-wsfix'

    Aesthetic fix to a CI configuration file.
    
    * am/ci-wsfix:
      ci: fix inconsistent indentation
    gitster committed Aug 31, 2020
    Configuration menu
    Copy the full SHA
    1a75372 View commit details
    Browse the repository at this point in the history
  11. Merge branch 'dd/diff-customize-index-line-abbrev'

    The output from the "diff" family of the commands had abbreviated
    object names of blobs involved in the patch, but its length was not
    affected by the --abbrev option.  Now it is.
    
    * dd/diff-customize-index-line-abbrev:
      diff: index-line: respect --abbrev in object's name
      t4013: improve diff-post-processor logic
    gitster committed Aug 31, 2020
    Configuration menu
    Copy the full SHA
    096c948 View commit details
    Browse the repository at this point in the history
  12. Merge branch 'jt/promisor-pack-fix'

    Updates into a lazy/partial clone with a submodule did not work
    well with transfer.fsckobjects set.
    
    * jt/promisor-pack-fix:
      fetch-pack: in partial clone, pass --promisor
    gitster committed Aug 31, 2020
    Configuration menu
    Copy the full SHA
    63728e4 View commit details
    Browse the repository at this point in the history
  13. Merge branch 'hv/ref-filter-trailers-atom-parsing-fix'

    The parser for "git for-each-ref --format=..." was too loose when
    parsing the "%(trailers...)" atom, and forgot that "trailers" and
    "trailers:<modifiers>" are the only two allowed forms, which has
    been corrected.
    
    * hv/ref-filter-trailers-atom-parsing-fix:
      ref-filter: 'contents:trailers' show error if `:` is missing
      t6300: unify %(trailers) and %(contents:trailers) tests
    gitster committed Aug 31, 2020
    Configuration menu
    Copy the full SHA
    e177238 View commit details
    Browse the repository at this point in the history
  14. Merge branch 'jk/index-pack-w-more-threads'

    Long ago, we decided to use 3 threads by default when running the
    index-pack task in parallel, which has been adjusted a bit upwards.
    
    * jk/index-pack-w-more-threads:
      index-pack: adjust default threading cap
      p5302: count up to online-cpus for thread tests
      p5302: disable thread-count parameter tests by default
    gitster committed Aug 31, 2020
    Configuration menu
    Copy the full SHA
    53015c9 View commit details
    Browse the repository at this point in the history
  15. Merge branch 'hn/refs-pseudorefs'

    Accesses to two pseudorefs have been updated to properly use ref
    API.
    
    * hn/refs-pseudorefs:
      sequencer: treat REVERT_HEAD as a pseudo ref
      builtin/commit: suggest update-ref for pseudoref removal
      sequencer: treat CHERRY_PICK_HEAD as a pseudo ref
      refs: make refs_ref_exists public
    gitster committed Aug 31, 2020
    Configuration menu
    Copy the full SHA
    e699684 View commit details
    Browse the repository at this point in the history
  16. Merge branch 'jk/refspecs-cleanup'

    Preliminary code clean-up before introducing "negative refspec".
    
    * jk/refspecs-cleanup:
      refspec: make sure stack refspec_item variables are zeroed
      refspec: fix documentation referring to refspec_item
    gitster committed Aug 31, 2020
    Configuration menu
    Copy the full SHA
    cca424b View commit details
    Browse the repository at this point in the history
  17. Merge branch 'al/bisect-first-parent'

    Finishing touches.
    
    * al/bisect-first-parent:
      bisect: add first-parent option to documentation
    gitster committed Aug 31, 2020
    Configuration menu
    Copy the full SHA
    b9ccc5e View commit details
    Browse the repository at this point in the history
  18. Merge branch 'rs/checkout-no-overlay-pathspec-fix'

    "git restore/checkout --no-overlay" with wildcarded pathspec
    mistakenly removed matching paths in subdirectories, which has been
    corrected.
    
    * rs/checkout-no-overlay-pathspec-fix:
      checkout, restore: make pathspec recursive
    gitster committed Aug 31, 2020
    Configuration menu
    Copy the full SHA
    c57afd7 View commit details
    Browse the repository at this point in the history
  19. Merge branch 'rp/apply-cached-doc'

    The description of --cached/--index options in "git apply --help"
    has been updated.
    
    * rp/apply-cached-doc:
      git-apply.txt: update descriptions of --cached, --index
    gitster committed Aug 31, 2020
    Configuration menu
    Copy the full SHA
    1393f56 View commit details
    Browse the repository at this point in the history
  20. Merge branch 'jc/ident-whose-ident'

    Error message update.
    
    * jc/ident-whose-ident:
      ident: say whose identity is missing when giving user.name hint
    gitster committed Aug 31, 2020
    Configuration menu
    Copy the full SHA
    e9bd00a View commit details
    Browse the repository at this point in the history
  21. Merge branch 'jk/rev-input-given-fix'

    Feeding "$ZERO_OID" to "git log --ignore-missing --stdin", and
    running "git log --ignore-missing $ZERO_OID" fell back to start
    digging from HEAD; it has been corrected to become a no-op, like
    "git log --tags=no-tag-matches-this-pattern" does.
    
    * jk/rev-input-given-fix:
      revision: set rev_input_given in handle_revision_arg()
    gitster committed Aug 31, 2020
    Configuration menu
    Copy the full SHA
    cacab0c View commit details
    Browse the repository at this point in the history
  22. Merge branch 'ps/ref-transaction-hook'

    Code simplification by removing ineffective optimization.
    
    * ps/ref-transaction-hook:
      refs: remove lookup cache for reference-transaction hook
    gitster committed Aug 31, 2020
    Configuration menu
    Copy the full SHA
    6ddd76f View commit details
    Browse the repository at this point in the history
  23. Twelfth batch

    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    gitster committed Aug 31, 2020
    Configuration menu
    Copy the full SHA
    e197136 View commit details
    Browse the repository at this point in the history

Commits on Sep 1, 2020

  1. git.txt: correct stale 'GIT_EXTERNAL_DIFF' description

    In fde97d8 (Update documentation to remove incorrect GIT_DIFF_OPTS
    example., 2006-11-27), the description of the 'GIT_EXTERNAL_DIFF'
    variable was moved from 'diff-format.txt' to 'git.txt', and the
    documentation was updated to remove a 'diff(1)' invocation since Git did
    not use an external diff program anymore by default.
    
    However, the description of 'GIT_EXTERNAL_DIFF' still mentions "instead
    of the diff invocation described above", which is confusing.
    
    Correct that outdated sentence.
    
    Also, link to git(1) in 'diff-generate-patch.txt' when GIT_DIFF_OPTS and
    GIT_EXTERNAL_DIFF are mentioned, so that users can easily know what
    these variables are about.
    
    Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    phil-blain authored and gitster committed Sep 1, 2020
    Configuration menu
    Copy the full SHA
    17bae89 View commit details
    Browse the repository at this point in the history

Commits on Sep 2, 2020

  1. xrealloc: do not reuse pointer freed by zero-length realloc()

    This patch fixes a bug where xrealloc(ptr, 0) can double-free and
    corrupt the heap on some platforms (including at least glibc).
    
    The C99 standard says of malloc (section 7.20.3):
    
      If the size of the space requested is zero, the behavior is
      implementation-defined: either a null pointer is returned, or the
      behavior is as if the size were some nonzero value, except that the
      returned pointer shall not be used to access an object.
    
    So we might get NULL back, or we might get an actual pointer (but we're
    not allowed to look at its contents). To simplify our code, our
    xmalloc() handles a NULL return by converting it into a single-byte
    allocation. That way callers get consistent behavior. This was done way
    back in 4e7a2ec (?alloc: do not return NULL when asked for zero
    bytes, 2005-12-29).
    
    We also gave xcalloc() and xrealloc() the same treatment. And according
    to C99, that is fine; the text above is in a paragraph that applies to
    all three. But what happens to the memory we passed to realloc() in such
    a case? I.e., if we do:
    
      ret = realloc(ptr, 0);
    
    and "ptr" is non-NULL, but we get NULL back, is "ptr" still valid? C99
    doesn't cover this case specifically, but says (section 7.20.3.4):
    
      The realloc function deallocates the old object pointed to by ptr and
      returns a pointer to a new object that has the size specified by size.
    
    So "ptr" is now deallocated, and we must only look at "ret". And since
    "ret" is NULL, that means we have no allocated object at all. But that's
    not quite the whole story. It also says:
    
      If memory for the new object cannot be allocated, the old object is
      not deallocated and its value is unchanged.
      [...]
      The realloc function returns a pointer to the new object (which may
      have the same value as a pointer to the old object), or a null pointer
      if the new object could not be allocated.
    
    So if we see a NULL return with a non-zero size, we can expect that the
    original object _is_ still valid. But with a non-zero size, it's
    ambiguous. The NULL return might mean a failure (in which case the
    object is valid), or it might mean that we successfully allocated
    nothing, and used NULL to represent that.
    
    The glibc manpage for realloc() explicitly says:
    
      [...]if size is equal to zero, and ptr is not NULL, then the call is
      equivalent to free(ptr).
    
    Likewise, this StackOverflow answer:
    
      https://stackoverflow.com/a/2135302
    
    claims that C89 gave similar guidance (but I don't have a copy to verify
    it). A comment on this answer:
    
      https://stackoverflow.com/a/2022410
    
    claims that Microsoft's CRT behaves the same.
    
    But our current "retry with 1 byte" code passes the original pointer
    again. So on glibc, we effectively free() the pointer and then try to
    realloc() it again, which is undefined behavior.
    
    The simplest fix here is to just pass "ret" (which we know to be NULL)
    to the follow-up realloc(). But that means that a system which _doesn't_
    free the original pointer would leak it. It's not clear if any such
    systems exist, and that interpretation of the standard seems unlikely
    (I'd expect a system that doesn't deallocate to simply return the
    original pointer in this case). But it's easy enough to err on the safe
    side, and just never pass a zero size to realloc() at all.
    
    Signed-off-by: Jeff King <peff@peff.net>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    peff authored and gitster committed Sep 2, 2020
    Configuration menu
    Copy the full SHA
    6479ea4 View commit details
    Browse the repository at this point in the history
  2. ci: fix indentation of the ci-config job

    The section added in e76eec3 (ci: allow per-branch config for
    GitHub Actions, 2020-05-07) contains a `&&`-chain that connects several
    commands. The first command is actually so long that it stretches over
    multiple lines, and as per usual, the continuation lines are indented one
    more level than the first.
    
    However, the subsequent commands in the `&&`-chain were also indented
    one more level than the first command, which was almost certainly
    unintended.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    Acked-by: Jeff King <peff@peff.net>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    dscho authored and gitster committed Sep 2, 2020
    Configuration menu
    Copy the full SHA
    b01aff8 View commit details
    Browse the repository at this point in the history
  3. ci: avoid ugly "failure" in the ci-config job

    In the common case where users have _not_ pushed a `ci-config` branch to
    configure which branches should be included in the GitHub workflow runs,
    there is a big fat ugly annotation about a failure in the run's log:
    
    	X Check failure on line 1 in .github
    
    	  @github-actions github-actions / ci-config
    
    	  .github#L1
    
    	  Process completed with exit code 128.
    
    The reason is that the `ci-config` job tries to clone that `ci-config`
    branch, and even if it is configured to continue on error, the
    annotation is displayed, and it is distracting.
    
    Let's just handle this on the shell script level, so that the job's step
    is not marked as a failure.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    Acked-by: Jeff King <peff@peff.net>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    dscho authored and gitster committed Sep 2, 2020
    Configuration menu
    Copy the full SHA
    2fcf7a8 View commit details
    Browse the repository at this point in the history
  4. fetch: no FETCH_HEAD display if --no-write-fetch-head

    887952b ("fetch: optionally allow disabling FETCH_HEAD update",
    2020-08-18) introduced the ability to disable writing to FETCH_HEAD
    during fetch, but did not suppress the "<source> -> FETCH_HEAD" message
    when this ability is used. This message is misleading in this case,
    because FETCH_HEAD is not written. Also, because "fetch" is used to
    lazy-fetch missing objects in a partial clone, this significantly
    clutters up the output in that case since the objects to be fetched are
    potentially numerous.
    
    Therefore, suppress this message when --no-write-fetch-head is passed
    (but not when --dry-run is set).
    
    Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    jonathantanmy authored and gitster committed Sep 2, 2020
    Configuration menu
    Copy the full SHA
    db3c293 View commit details
    Browse the repository at this point in the history
  5. sha1-name: replace unsigned int with option struct

    In preparation for a future patch adding a boolean parameter to
    repo_interpret_branch_name(), which might be easily confused with an
    existing unsigned int parameter, refactor repo_interpret_branch_name()
    to take an option struct instead of the unsigned int parameter.
    
    The static function interpret_branch_mark() is also updated to take the
    option struct in preparation for that future patch, since it will also
    make use of the to-be-introduced boolean parameter.
    
    Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    jonathantanmy authored and gitster committed Sep 2, 2020
    Configuration menu
    Copy the full SHA
    a4f66a7 View commit details
    Browse the repository at this point in the history
  6. refs: move dwim_ref() to header file

    This makes it clear that dwim_ref() is just repo_dwim_ref() without the
    first parameter.
    
    Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    jonathantanmy authored and gitster committed Sep 2, 2020
    Configuration menu
    Copy the full SHA
    ec06b05 View commit details
    Browse the repository at this point in the history
  7. wt-status: tolerate dangling marks

    When a user checks out the upstream branch of HEAD, the upstream branch
    not being a local branch, and then runs "git status", like this:
    
      git clone $URL client
      cd client
      git checkout @{u}
      git status
    
    no status is printed, but instead an error message:
    
      fatal: HEAD does not point to a branch
    
    (This error message when running "git branch" persists even after
    checking out other things - it only stops after checking out a branch.)
    
    This is because "git status" reads the reflog when determining the "HEAD
    detached" message, and thus attempts to DWIM "@{u}", but that doesn't
    work because HEAD no longer points to a branch.
    
    Therefore, when calculating the status of a worktree, tolerate dangling
    marks. This is done by adding an additional parameter to
    dwim_ref() and repo_dwim_ref().
    
    Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    jonathantanmy authored and gitster committed Sep 2, 2020
    Configuration menu
    Copy the full SHA
    f24c30e View commit details
    Browse the repository at this point in the history

Commits on Sep 3, 2020

  1. vcbuild: fix library name for expat with make MSVC=1

    Signed-off-by: Orgad Shaneh <orgads@gmail.com>
    Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    orgads authored and gitster committed Sep 3, 2020
    Configuration menu
    Copy the full SHA
    c2f3ef8 View commit details
    Browse the repository at this point in the history
  2. vcbuild: fix batch file name in README

    Signed-off-by: Orgad Shaneh <orgads@gmail.com>
    Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    orgads authored and gitster committed Sep 3, 2020
    Configuration menu
    Copy the full SHA
    3384a1e View commit details
    Browse the repository at this point in the history
  3. Merge branch 'pw/rebase-i-more-options'

    "git rebase -i" learns a bit more options.
    
    * pw/rebase-i-more-options:
      t3436: do not run git-merge-recursive in dashed form
      rebase: add --reset-author-date
      rebase -i: support --ignore-date
      rebase -i: support --committer-date-is-author-date
      am: stop exporting GIT_COMMITTER_DATE
      rebase -i: add --ignore-whitespace flag
    gitster committed Sep 3, 2020
    Configuration menu
    Copy the full SHA
    9c31b19 View commit details
    Browse the repository at this point in the history
  4. Merge branch 'ss/t7401-modernize'

    Test clean-up.
    
    * ss/t7401-modernize:
      t7401: add a NEEDSWORK
      t7401: change indentation for enhanced readability
      t7401: change syntax of test_i18ncmp calls for clarity
      t7401: use 'short' instead of 'verify' and cut in rev-parse calls
      t7401: modernize style
    gitster committed Sep 3, 2020
    Configuration menu
    Copy the full SHA
    3cbff01 View commit details
    Browse the repository at this point in the history
  5. Merge branch 'jt/fetch-pack-loosen-validation-with-packfile-uri'

    Bugfix for "git fetch" when the packfile URI capability is in use.
    
    * jt/fetch-pack-loosen-validation-with-packfile-uri:
      fetch-pack: make packfile URIs work with transfer.fsckobjects
      fetch-pack: document only_packfile in get_pack()
      (various): document from_promisor parameter
    gitster committed Sep 3, 2020
    Configuration menu
    Copy the full SHA
    bdccf5e View commit details
    Browse the repository at this point in the history
  6. Merge branch 'pw/add-p-allowed-options-fix'

    "git add -p" update.
    
    * pw/add-p-allowed-options-fix:
      add -p: fix checking of user input
      add -p: use ALLOC_GROW_BY instead of ALLOW_GROW
    gitster committed Sep 3, 2020
    Configuration menu
    Copy the full SHA
    cce5178 View commit details
    Browse the repository at this point in the history
  7. Merge branch 'jk/slimmed-down'

    Trim an unused binary and turn a bunch of commands into built-in.
    
    * jk/slimmed-down:
      drop vcs-svn experiment
      make git-fast-import a builtin
      make git-bugreport a builtin
      make credential helpers builtins
      Makefile: drop builtins from MSVC pdb list
    gitster committed Sep 3, 2020
    Configuration menu
    Copy the full SHA
    afd49c3 View commit details
    Browse the repository at this point in the history
  8. Merge branch 'jc/undash-in-tree-git-callers'

    A handful of places in in-tree code still relied on being able to
    execute the git subcommands, especially built-ins, in "git-foo"
    form, which have been corrected.
    
    * jc/undash-in-tree-git-callers:
      credential-cache: use child_process.args
      cvsexportcommit: do not run git programs in dashed form
      transport-helper: do not run git-remote-ext etc. in dashed form
    gitster committed Sep 3, 2020
    Configuration menu
    Copy the full SHA
    18aff08 View commit details
    Browse the repository at this point in the history
  9. Merge branch 'jc/run-command-use-embedded-args'

    Various callers of run_command API has been modernized.
    
    * jc/run-command-use-embedded-args:
      run_command: teach API users to use embedded 'args' more
    gitster committed Sep 3, 2020
    Configuration menu
    Copy the full SHA
    3f02c0a View commit details
    Browse the repository at this point in the history
  10. Merge branch 'jt/lazy-fetch'

    Updates to on-demand fetching code in lazily cloned repositories.
    
    * jt/lazy-fetch:
      fetch: no FETCH_HEAD display if --no-write-fetch-head
      fetch-pack: remove no_dependents code
      promisor-remote: lazy-fetch objects in subprocess
      fetch-pack: do not lazy-fetch during ref iteration
      fetch: only populate existing_refs if needed
      fetch: avoid reading submodule config until needed
      fetch: allow refspecs specified through stdin
      negotiator/noop: add noop fetch negotiator
    gitster committed Sep 3, 2020
    Configuration menu
    Copy the full SHA
    b4100f3 View commit details
    Browse the repository at this point in the history
  11. Merge branch 'mr/diff-hide-stat-wo-textual-change'

    "git diff --stat -w" showed 0-line changes for paths whose changes
    were only whitespaces, which was not intuitive.  We now omit such
    paths from the stat output.
    
    * mr/diff-hide-stat-wo-textual-change:
      diff: teach --stat to ignore uninteresting modifications
    gitster committed Sep 3, 2020
    Configuration menu
    Copy the full SHA
    b58e47a View commit details
    Browse the repository at this point in the history
  12. Merge branch 'so/pretty-abbrev-doc'

    Documentation update for "--no-abbrev-commit".
    
    * so/pretty-abbrev-doc:
      pretty-options.txt: fix --no-abbrev-commit description
    gitster committed Sep 3, 2020
    Configuration menu
    Copy the full SHA
    b720ad2 View commit details
    Browse the repository at this point in the history
  13. Merge branch 'hl/bisect-doc-clarify-bad-good-ordering'

    Doc update.
    
    * hl/bisect-doc-clarify-bad-good-ordering:
      bisect: swap command-line options in documentation
    gitster committed Sep 3, 2020
    Configuration menu
    Copy the full SHA
    da6b99c View commit details
    Browse the repository at this point in the history
  14. Merge branch 'pb/doc-sequence-editor-configuration'

    Doc update.
    
    * pb/doc-sequence-editor-configuration:
      doc: mention GIT_SEQUENCE_EDITOR and 'sequence.editor' more
    gitster committed Sep 3, 2020
    Configuration menu
    Copy the full SHA
    ed9d833 View commit details
    Browse the repository at this point in the history
  15. Merge branch 'jc/post-checkout-doc'

    Doc update.
    
    * jc/post-checkout-doc:
      doc: clarify how exit status of post-checkout hook is used
    gitster committed Sep 3, 2020
    Configuration menu
    Copy the full SHA
    2f1757e View commit details
    Browse the repository at this point in the history
  16. Merge branch 'jk/xrealloc-avoid-use-after-free'

    It was possible for xrealloc() to send a non-NULL pointer that has
    been freed, which has been fixed.
    
    * jk/xrealloc-avoid-use-after-free:
      xrealloc: do not reuse pointer freed by zero-length realloc()
    gitster committed Sep 3, 2020
    Configuration menu
    Copy the full SHA
    56b891e View commit details
    Browse the repository at this point in the history
  17. Merge branch 'pb/doc-external-diff-env'

    Doc update.
    
    * pb/doc-external-diff-env:
      git.txt: correct stale 'GIT_EXTERNAL_DIFF' description
    gitster committed Sep 3, 2020
    Configuration menu
    Copy the full SHA
    cd332b2 View commit details
    Browse the repository at this point in the history
  18. Thirteenth batch

    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    gitster committed Sep 3, 2020
    Configuration menu
    Copy the full SHA
    3a238e5 View commit details
    Browse the repository at this point in the history

Commits on Sep 6, 2020

  1. log_tree_diff: get rid of code duplication for first_parent_only

    Handle first_parent_only by breaking from generic loop early
    rather than by duplicating (part of) the loop body.
    
    Signed-off-by: Sergey Organov <sorganov@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    sorganov authored and gitster committed Sep 6, 2020
    Configuration menu
    Copy the full SHA
    a7b9430 View commit details
    Browse the repository at this point in the history
  2. log_tree_diff: get rid of extra check for NULL

    Get rid of needless check of 'parents' for NULL. The NULL case
    is already handled right above, and 'parents' is dereferenced
    without check below anyway.
    
    Signed-off-by: Sergey Organov <sorganov@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    sorganov authored and gitster committed Sep 6, 2020
    Configuration menu
    Copy the full SHA
    793d37c View commit details
    Browse the repository at this point in the history
  3. Makefile: add support for generating JSON compilation database

    Tools based on LibClang [1] can make use of a 'JSON Compilation
    Database' [2] that keeps track of the exact options used to compile a set
    of source files.
    
    For example, clangd [3], which is a C language server protocol
    implementation, can use a JSON compilation database to determine the
    flags needed to compile a file so it can provide proper editor
    integration.  As a result, editors supporting the language server
    protocol (such as VS Code, Emacs, or Vim, with suitable plugins) can
    provide better searching, integration, and refactoring tools.
    
    The Clang compiler can generate JSON fragments when compiling [4],
    using the `-MJ` flag. These JSON fragments (one per compiled source
    file) can then be concatenated to create the compilation database,
    commonly called 'compile_commands.json'.
    
    Add support to the Makefile for generating these JSON fragments as well
    as the compilation database itself, if the environment variable
    'GENERATE_COMPILATION_DATABASE' is set.
    
    If this variable is set, check that $(CC) indeed supports the `-MJ`
    flag, following what is done for automatic dependencies.
    
    All JSON fragments are placed in the 'compile_commands/' directory, and
    the compilation database 'compile_commands.json' is generated as a
    dependency of the 'all' target using a `sed` invocation.
    
    [1] https://clang.llvm.org/docs/Tooling.html
    [2] https://clang.llvm.org/docs/JSONCompilationDatabase.html
    [3] https://clangd.llvm.org/
    [4] https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-mj-arg
    
    Helped-by: brian m. carlson <sandals@crustytoothpaste.net>
    Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    phil-blain authored and gitster committed Sep 6, 2020
    Configuration menu
    Copy the full SHA
    3821c38 View commit details
    Browse the repository at this point in the history
  4. read-cache: fix mem-pool allocation for multi-threaded index loading

    44c7e1a (mem-pool: use more standard initialization and finalization,
    2020-08-15) moved the allocation of the mem-pool structure to callers.
    It also added an allocation to load_cache_entries_threaded(), but for an
    unrelated mem-pool.  Fix that by allocating the correct one instead --
    the one that is initialized two lines later.
    
    Reported-by: Sandor Bodo-Merle <sbodomerle@gmail.com>
    Signed-off-by: René Scharfe <l.s.r@web.de>
    Reviewed-by: Elijah Newren <newren@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    rscharfe authored and gitster committed Sep 6, 2020
    Configuration menu
    Copy the full SHA
    bcd2c5e View commit details
    Browse the repository at this point in the history
  5. push: release strbufs used for refspec formatting

    map_refspec() either returns the passed in ref string or a detached
    strbuf.  This makes it hard for callers to release the possibly
    allocated memory, and set_refspecs() consequently leaks it.
    
    Let map_refspec() append any refspecs directly and release its own
    strbufs after use.  Rename it to refspec_append_mapped() and don't
    return anything to reflect its increased responsibility.
    
    set_refspecs() also leaks its strbufs.  Do the same here and directly
    call refspec_append() in each if branch instead of holding onto a
    detached strbuf, then dispose of the allocated memory after use.  We
    need to add an else branch for the final call because all the other
    conditional branches already add their formatted refspec now.
    
    setup_push_upstream() and setup_push_current() forgot to release their
    strbufs as well; plug these leaks, too, while at it.
    
    None of these leaks were likely to impact users, because the number
    and sizes of refspecs are usually small and the allocations are only
    done once per program run.  Clean them up nevertheless, as another
    step on the long road towards zero memory leaks.
    
    Signed-off-by: René Scharfe <l.s.r@web.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    rscharfe authored and gitster committed Sep 6, 2020
    Configuration menu
    Copy the full SHA
    30035d9 View commit details
    Browse the repository at this point in the history
  6. refspec: add and use refspec_appendf()

    Add a function for building a refspec using printf-style formatting.  It
    frees callers from managing their own buffer.  Use it throughout the
    tree to shorten and simplify its callers.
    
    Signed-off-by: René Scharfe <l.s.r@web.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    rscharfe authored and gitster committed Sep 6, 2020
    Configuration menu
    Copy the full SHA
    1af8b8c View commit details
    Browse the repository at this point in the history
  7. fast-import: use write_pack_header()

    Call write_pack_header() to hash and write a pack header instead of
    open-coding this function.  This gets rid of duplicate code and of the
    magic version number 2 -- which has been used here since c90be46
    (Changed fast-import's pack header creation to use pack.h, 2006-08-16)
    and in pack.h (again) since 29f049a (Revert "move pack creation to
    version 3", 2006-10-14).
    
    Signed-off-by: René Scharfe <l.s.r@web.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    rscharfe authored and gitster committed Sep 6, 2020
    Configuration menu
    Copy the full SHA
    ccb181d View commit details
    Browse the repository at this point in the history
  8. midx: use hashwrite_u8() in write_midx_header()

    Emit byte-sized values using hashwrite_u8() instead of buffering them
    locally first.  The hashwrite functions already do their own buffering,
    so this double-buffering does not reduce the number of system calls.
    Getting rid of it shortens and simplifies the code a bit.
    
    Signed-off-by: René Scharfe <l.s.r@web.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    rscharfe authored and gitster committed Sep 6, 2020
    Configuration menu
    Copy the full SHA
    014f144 View commit details
    Browse the repository at this point in the history
  9. pack-bitmap-write: use hashwrite_be32() in write_hash_cache()

    Call hashwrite_be32() instead of open-coding it.  This is shorter and
    easier to read.
    
    Signed-off-by: René Scharfe <l.s.r@web.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    rscharfe authored and gitster committed Sep 6, 2020
    Configuration menu
    Copy the full SHA
    7744a5d View commit details
    Browse the repository at this point in the history
  10. submodule: suppress checking for file name and ref ambiguity for obje…

    …ct ids
    
    The argv argument of collect_changed_submodules() contains only object ids
    (the objects references of all the refs).
    
    Notify setup_revisions() that the input is not filenames by passing
    assume_dashdash, so it can avoid redundant stat for each ref.
    
    Also suppress refname_ambiguity flag to avoid filesystem lookups for
    each object. Similar logic can be found in cat-file, pack-objects and more.
    
    This change reduces the time for git fetch in my repo from 25s to 6s.
    
    Signed-off-by: Orgad Shaneh <orgads@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    orgads authored and gitster committed Sep 6, 2020
    Configuration menu
    Copy the full SHA
    a462bee View commit details
    Browse the repository at this point in the history

Commits on Sep 7, 2020

  1. git-checkout.txt: document -d short option for --detach

    `git checkout` learned -d as short option for --detach in 163e3b2
    (switch: add short option for --detach, 2019-03-29) but the
    documentation was never updated to reflect the change.
    
    Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    sunshineco authored and gitster committed Sep 7, 2020
    Configuration menu
    Copy the full SHA
    07351d9 View commit details
    Browse the repository at this point in the history
  2. worktree: teach add to recognize -d as shorthand for --detach

    Like `git switch` and `git checkout`, `git worktree add` can check out a
    branch or set up a detached HEAD. However, unlike those other commands,
    `git worktree add` does not understand -d as shorthand for --detach,
    which may confound users accustomed to using -d for this purpose.
    Address this shortcoming by teaching `add` to recognize -d for --detach,
    thus bringing it in line with the other commands.
    
    Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    sunshineco authored and gitster committed Sep 7, 2020
    Configuration menu
    Copy the full SHA
    c670aa4 View commit details
    Browse the repository at this point in the history
  3. git-worktree.txt: discuss branch-based vs. throwaway worktrees

    By default, `git worktree add` creates a new worktree associated with a
    particular branch (which may have been created automatically if not
    specified explicitly on the command-line). It is also convenient to
    create throwaway worktrees not associated with any branch, which can be
    handy when making experimental changes or doing testing. However, the
    latter use-case may not be obvious to newcomers since the high-level
    description of worktrees talks only about checking out "more than one
    branch at a time". Therefore, enhance the description to to discuss both
    use-cases.
    
    A secondary goal of highlighting the distinction between branch-based
    and throwaway worktrees is to help newcomers understand that the
    simplest form `git worktree add <path>` automatically creates a new
    branch. Stating this early in the description, may help newcomers avoid
    creating branches without realizing they are doing so, and later
    wondering why `git branch --list` shows branches the user did not
    intentionally create.
    
    Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    sunshineco authored and gitster committed Sep 7, 2020
    Configuration menu
    Copy the full SHA
    dccadad View commit details
    Browse the repository at this point in the history

Commits on Sep 8, 2020

  1. add-patch: fix inverted return code of repo_read_index()

    After applying hunks to a file with "add -p", the C patch_update_file()
    function tries to refresh the index (just like the perl version does).
    We can only refresh the index if we're able to read it in, so we first
    check the return value of repo_read_index(). But unlike many functions,
    where "0" is success, that function is documented to return the number
    of entries in the index.  Hence we should be checking for success with a
    non-negative return value.
    
    Neither the tests nor any users seem to have noticed this, probably due
    to a combination of:
    
      - this affects only the C version, which is not yet the default
    
      - following it up with any porcelain command like "git diff" or "git
        commit" would refresh the index automatically.
    
    But you can see the problem by running the plumbing "git diff-files"
    immediately after "add -p" stages all hunks. Running the new test with
    GIT_TEST_ADD_I_USE_BUILTIN=1 fails without the matching code change.
    
    Signed-off-by: Jeff King <peff@peff.net>
    Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    peff authored and gitster committed Sep 8, 2020
    Configuration menu
    Copy the full SHA
    dc62641 View commit details
    Browse the repository at this point in the history
  2. add--interactive.perl: specify --no-color explicitly

    Our color tests of "git add -p" do something a bit different from how a
    normal user would behave: we pretend there's a pager in use, so that Git
    thinks it's OK to write color to a non-tty stdout.  This comes from
    8539b46 (t3701: avoid depending on the TTY prerequisite, 2019-12-06),
    which allows us to avoid a lot of complicated mock-tty code.
    
    However, those environment variables also make their way down to
    sub-processes of add--interactive, including the "diff-files" we run to
    generate the patches. As a result, it thinks it should output color,
    too. So in t3701.50, for example, the machine-readable version of the
    diff we get unexpectedly has color in it. We fail to parse it as a diff
    and think there are zero hunks.
    
    The test does still pass, though, because even with zero hunks we'll
    dump the diff header (and we consider those unparseable bits to be part
    of the header!), and so the output still has the expected color codes in
    it. We don't notice that the command was totally broken and failed to
    apply anything.
    
    And in fact we're not really testing what we think we are about the
    color, either. While add--interactive does correctly show the version we
    got from running "diff-files --color", we'd also pass the test if we had
    accidentally shown the machine-readable version, too, since it
    (erroneously) has color codes in it.
    
    One could argue that the test isn't very realistic; it's setting up this
    "pretend there's a pager" situation to get around the tty restrictions
    of the test environment. So one option would be to move back towards
    using a real tty. But the behavior of add--interactive really is
    user-visible here. If a user, for whatever reason, did run "git
    --paginate add --patch" (perhaps because their pager is really a filter
    or something), the command would totally fail to do anything useful.
    
    Since we know that we don't want color in this output, let's just make
    add--interactive more defensive, and say "--no-color" explicitly. It
    doesn't hurt anything in the common case, but it fixes this odd case and
    lets our test function properly again.
    
    Note that the C builtin run_add_p() already passes --no-color, so it
    doesn't need a similar fix. That will eventually replace this perl code
    anyway, but the test change here will be valuable for ensuring that.
    
    Signed-off-by: Jeff King <peff@peff.net>
    Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    peff authored and gitster committed Sep 8, 2020
    Configuration menu
    Copy the full SHA
    1c6ffb5 View commit details
    Browse the repository at this point in the history
  3. contrib/buildsystems: fix expat library name for generated vcxproj

    expat.lib -> libexpat.lib (libexpatd.lib for debug build).
    
    Signed-off-by: Orgad Shaneh <orgads@gmail.com>
    Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    orgads authored and gitster committed Sep 8, 2020
    Configuration menu
    Copy the full SHA
    e58e405 View commit details
    Browse the repository at this point in the history
  4. add -p: fix memory leak

    asan reports that the C version of `add -p` is not freeing all the
    memory it allocates. Fix this by introducing a function to clear
    `struct add_p_state` and use it instead of freeing individual members.
    
    Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
    Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    phillipwood authored and gitster committed Sep 8, 2020
    Configuration menu
    Copy the full SHA
    324efcf View commit details
    Browse the repository at this point in the history
  5. add -i: use the built-in version when feature.experimental is set

    We have had parallel implementations of "add -i/-p" since 2.25 and
    have been using them from various codepaths since 2.26 days, but
    never made the built-in version the default.
    
    We have found and fixed a handful of corner case bugs in the
    built-in version, and it may be a good time to start switching over
    the user base from the scripted version to the built-in version.
    Let's enable the built-in version for those who opt into the
    feature.experimental guinea-pig program to give wider exposure.
    
    Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    gitster committed Sep 8, 2020
    1 Configuration menu
    Copy the full SHA
    2df2d81 View commit details
    Browse the repository at this point in the history
  6. t3200: clean side effect of git checkout --orphan

    The "refuse --edit-description on unborn branch for now" test in t3200
    switches to an orphan branch, causing subsequent git commands
    referencing HEAD to fail. Avoid this side-effect by switching back to
    master after the test finishes.
    
    This has gone undetected, as the next affected test expects failure -
    but it currently fails for the wrong reason.
    
    Verbose output of the next test referencing HEAD,
    "--merged is incompatible with --no-merged":
    
      fatal: malformed object name HEAD
    
    Which this commit corrects to:
    
      error: option `no-merged' is incompatible with --merged
    
    Signed-off-by: Aaron Lipman <alipman88@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    alipman88 authored and gitster committed Sep 8, 2020
    Configuration menu
    Copy the full SHA
    e6d5a11 View commit details
    Browse the repository at this point in the history
  7. refs: move REF_LOG_ONLY to refs-internal.h

    REF_LOG_ONLY is used in the transaction preparation: if a symref is involved in
    a transaction, the referent of the symref should be updated, and the symref
    itself should only be updated in the reflog.
    
    Other ref backends will need to duplicate this logic too, so move it to a
    central place.
    
    Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    hanwen authored and gitster committed Sep 8, 2020
    Configuration menu
    Copy the full SHA
    63c0567 View commit details
    Browse the repository at this point in the history
  8. blame.c: replace instance of !oidcmp for oideq

    0906ac2 (blame: use changed-path Bloom filters, 2020-04-16)
    introduced a call to oidcmp() that should have been oideq(), which
    was introduced in 14438c4 (introduce hasheq() and oideq(),
    2018-08-28).
    
    Signed-off-by: Edmundo Carmona Antoranz <eantoranz@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    eantoranz authored and gitster committed Sep 8, 2020
    Configuration menu
    Copy the full SHA
    1302bad View commit details
    Browse the repository at this point in the history

Commits on Sep 9, 2020

  1. Makefile: allow extra tweaking of distribution tarball

    The maintainer's dist rules are used to produce distribution
    tarballs.  They use "$(TAR) cf" and "$(TAR) rf" to produce archives
    out of a freshly created local installation area, which means that
    the built product can be affected by maintainer's umask and other
    local environment.
    
    Implementations of "tar" have ways (implementation specific,
    unfortunately) to force permission bits and other stuff to allow the
    user to hide these effects coming from the local environment.  Teach
    our Makefile to allow the maintainer to tweak the invocation of the
    $(TAR) commands by setting TAR_DIST_EXTRA_OPTS.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    gitster committed Sep 9, 2020
    Configuration menu
    Copy the full SHA
    eec6ab5 View commit details
    Browse the repository at this point in the history
  2. config: complain about --worktree outside of a git repo

    Running `git config --worktree` outside of a git repository hits a BUG()
    when trying to enumerate the worktrees. Let's catch this error earlier
    and die() with a friendlier message.
    
    Signed-off-by: Matheus Tavares <matheus.bernardino@usp.br>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    matheustavares authored and gitster committed Sep 9, 2020
    Configuration menu
    Copy the full SHA
    378fe5f View commit details
    Browse the repository at this point in the history
  3. Merge branch 'ss/submodule-summary-in-c'

    Yet another subcommand of "git submodule" is getting rewritten in C.
    
    * ss/submodule-summary-in-c:
      submodule: port submodule subcommand 'summary' from shell to C
      t7421: introduce a test script for verifying 'summary' output
      submodule: rename helper functions to avoid ambiguity
      submodule: remove extra line feeds between callback struct and macro
    gitster committed Sep 9, 2020
    Configuration menu
    Copy the full SHA
    bbdba3d View commit details
    Browse the repository at this point in the history
  4. Merge branch 'tb/repack-clearing-midx'

    When a packfile is removed by "git repack", multi-pack-index gets
    cleared; the code was taught to do so less aggressively by first
    checking if the midx actually refers to a pack that no longer
    exists.
    
    * tb/repack-clearing-midx:
      midx: traverse the local MIDX first
      builtin/repack.c: invalidate MIDX only when necessary
    gitster committed Sep 9, 2020
    Configuration menu
    Copy the full SHA
    a31677d View commit details
    Browse the repository at this point in the history
  5. Merge branch 'jk/worktree-check-clean-leakfix'

    Leakfix.
    
    * jk/worktree-check-clean-leakfix:
      worktree: fix leak in check_clean_worktree()
    gitster committed Sep 9, 2020
    Configuration menu
    Copy the full SHA
    1aadb47 View commit details
    Browse the repository at this point in the history
  6. Merge branch 'es/worktree-repair'

    "git worktree" gained a "repair" subcommand to help users recover
    after moving the worktrees or repository manually without telling
    Git.  Also, "git init --separate-git-dir" no longer corrupts
    administrative data related to linked worktrees.
    
    * es/worktree-repair:
      init: make --separate-git-dir work from within linked worktree
      init: teach --separate-git-dir to repair linked worktrees
      worktree: teach "repair" to fix outgoing links to worktrees
      worktree: teach "repair" to fix worktree back-links to main worktree
      worktree: add skeleton "repair" command
    gitster committed Sep 9, 2020
    Configuration menu
    Copy the full SHA
    eb7460f View commit details
    Browse the repository at this point in the history
  7. Merge branch 'so/separate-field-for-m-and-diff-merges'

    Internal API clean-up to handle two options "diff-index" and "log"
    have, which happen to share the same short form, more sensibly.
    
    * so/separate-field-for-m-and-diff-merges:
      revision: add separate field for "-m" of "diff-index -m"
    gitster committed Sep 9, 2020
    Configuration menu
    Copy the full SHA
    c1ce30d View commit details
    Browse the repository at this point in the history
  8. Merge branch 'ss/submodule-summary-in-c-fixes'

    Fixups to a topic in 'next'.
    
    * ss/submodule-summary-in-c-fixes:
      t7421: eliminate 'grep' check in t7421.4 for mingw compatibility
      submodule: fix style in function definition
      submodule: eliminate unused parameters from print_submodule_summary()
    gitster committed Sep 9, 2020
    Configuration menu
    Copy the full SHA
    9f7833f View commit details
    Browse the repository at this point in the history
  9. Merge branch 'hv/ref-filter-misc'

    The "--format=" option to the "for-each-ref" command and friends
    learned a few more tricks, e.g. the ":short" suffix that applies to
    "objectname" now also can be used for "parent", "tree", etc.
    
    * hv/ref-filter-misc:
      ref-filter: add `sanitize` option for 'subject' atom
      pretty: refactor `format_sanitized_subject()`
      ref-filter: add `short` modifier to 'parent' atom
      ref-filter: add `short` modifier to 'tree' atom
      ref-filter: rename `objectname` related functions and fields
      ref-filter: modify error messages in `grab_objectname()`
      ref-filter: refactor `grab_objectname()`
      ref-filter: support different email formats
    gitster committed Sep 9, 2020
    Configuration menu
    Copy the full SHA
    c25fba9 View commit details
    Browse the repository at this point in the history
  10. Merge branch 'pb/imap-send-updates'

    "git imap-send" updates.
    
    * pb/imap-send-updates:
      git-imap-send.txt: add note about localized Gmail folders
      git-imap-send.txt: do verify SSL certificate for gmail.com
      git-imap-send.txt: don't duplicate 'Examples' sections
    gitster committed Sep 9, 2020
    Configuration menu
    Copy the full SHA
    6e5f930 View commit details
    Browse the repository at this point in the history
  11. Merge branch 'js/ci-squelch-false-failure'

    CI noise reduction.
    
    * js/ci-squelch-false-failure:
      ci: avoid ugly "failure" in the `ci-config` job
      ci: fix indentation of the `ci-config` job
    gitster committed Sep 9, 2020
    Configuration menu
    Copy the full SHA
    7364aee View commit details
    Browse the repository at this point in the history
  12. Merge branch 'jt/interpret-branch-name-fallback'

    "git status" has trouble showing where it came from by interpreting
    reflog entries that recordcertain events, e.g. "checkout @{u}", and
    gives a hard/fatal error.  Even though it inherently is impossible
    to give a correct answer because the reflog entries lose some
    information (e.g. "@{u}" does not record what branch the user was
    on hence which branch 'the upstream' needs to be computed, and even
    if the record were available, the relationship between branches may
    have changed), at least hide the error to allow "status" show its
    output.
    
    * jt/interpret-branch-name-fallback:
      wt-status: tolerate dangling marks
      refs: move dwim_ref() to header file
      sha1-name: replace unsigned int with option struct
    gitster committed Sep 9, 2020
    Configuration menu
    Copy the full SHA
    0df670b View commit details
    Browse the repository at this point in the history
  13. Merge branch 'os/vcbuild'

    Fix build procedure for MSVC.
    
    * os/vcbuild:
      contrib/buildsystems: fix expat library name for generated vcxproj
      vcbuild: fix batch file name in README
      vcbuild: fix library name for expat with make MSVC=1
    gitster committed Sep 9, 2020
    Configuration menu
    Copy the full SHA
    ff75e6c View commit details
    Browse the repository at this point in the history
  14. Fourteenth batch

    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    gitster committed Sep 9, 2020
    Configuration menu
    Copy the full SHA
    54e85e7 View commit details
    Browse the repository at this point in the history

Commits on Sep 10, 2020

  1. quote_path: rename quote_path_relative() to quote_path()

    There is no quote_path_absolute() or anything that causes confusion,
    and one of the two large consumers already rename the long name
    locally with a preprocessor macro.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    gitster committed Sep 10, 2020
    Configuration menu
    Copy the full SHA
    c34d24b View commit details
    Browse the repository at this point in the history
  2. quote_path: give flags parameter to quote_path()

    The quote_path() function computes a path (relative to its base
    directory) and c-quotes the result if necessary.  Teach it to take a
    flags parameter to allow its behaviour to be enriched later.
    
    No behaviour change intended.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    gitster committed Sep 10, 2020
    Configuration menu
    Copy the full SHA
    88910c9 View commit details
    Browse the repository at this point in the history
  3. quote_path: optionally allow quoting a path with SP in it

    Some code in wt-status.c special case a path with SP in it, which
    usually does not have to be c-quoted, and ensure that such a path
    does get quoted.  Move the logic to quote_path() and give it a bit
    in the flags word, QUOTE_PATH_QUOTE_SP.
    
    No behaviour change intended.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    gitster committed Sep 10, 2020
    Configuration menu
    Copy the full SHA
    f3fc4a1 View commit details
    Browse the repository at this point in the history
  4. quote_path: code clarification

    The implementation we moved from wt-status to enclose a pathname
    that has a SP in it inside a dq-pair is a bit convoluted.  It lets
    quote_c_style_counted() do its escaping and then
    
     (1) if the input string got escaped, which is checked by seeing if
         the result begins with a double-quote, declare that we are
         done.  If there wasn't any SP in the input, that is OK, and if
         there was, the result is quoted already so it is OK, too.
    
     (2) if the input string did not get escaped, and the result has SP
         in it, enclose the whole thing in a dq-pair ourselves.
    
    Instead we can scan the path upfront to see if the input has SP in
    it.  If so, we tell quote_c_style_counted() not to enclose its
    output in a dq-pair, and we add a dq-pair ourselves.  Whether the
    input had bytes that quote_c_style_counted() uses backslash quoting,
    this would give us a desired quoted string.  If the input does not
    have SP in it, we just let quote_c_style_counted() do its thing as
    usual, which would enclose the result in a dq-pair only when needed.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    gitster committed Sep 10, 2020
    Configuration menu
    Copy the full SHA
    e2773aa View commit details
    Browse the repository at this point in the history
  5. wt-status: consistently quote paths in "status --short" output

    Tracked paths with SP in them were cquoted in "git status --short"
    output, but untracked, ignored, and unmerged paths weren't.
    
    The test was stolen from a patch to fix output for the 'untracked'
    paths by brian m. carlson, with similar tests added for 'ignored'
    ones.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    gitster committed Sep 10, 2020
    Configuration menu
    Copy the full SHA
    a361dd3 View commit details
    Browse the repository at this point in the history
  6. quote: rename misnamed sq_lookup[] to cq_lookup[]

    This table is used to see if each byte needs quoting when responding
    to a request to C-quote the string, not quoting with single-quote in
    the shell style.  Similarly, sq_must_quote() is fed each byte from
    the string being C-quoted.
    
    No behaviour change intended.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    gitster committed Sep 10, 2020
    Configuration menu
    Copy the full SHA
    dfc7f65 View commit details
    Browse the repository at this point in the history
  7. quote: turn 'nodq' parameter into a set of flags

    quote_c_style() and its friend quote_two_c_style() both take an
    optional "please omit the double quotes around the quoted body"
    parameter.  Turn it into a flag word, assign one bit out of it,
    and call it CQUOTE_NODQ bit.
    
    No behaviour change intended.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    gitster committed Sep 10, 2020
    Configuration menu
    Copy the full SHA
    7c37c97 View commit details
    Browse the repository at this point in the history

Commits on Sep 19, 2020

  1. Merge branch 'rs/misc-cleanups'

    Misc cleanups.
    
    * rs/misc-cleanups:
      pack-bitmap-write: use hashwrite_be32() in write_hash_cache()
      midx: use hashwrite_u8() in write_midx_header()
      fast-import: use write_pack_header()
    gitster committed Sep 19, 2020
    Configuration menu
    Copy the full SHA
    9b80744 View commit details
    Browse the repository at this point in the history
  2. Merge branch 'rs/refspec-leakfix'

    Leakfix.
    
    * rs/refspec-leakfix:
      refspec: add and use refspec_appendf()
      push: release strbufs used for refspec formatting
    gitster committed Sep 19, 2020
    Configuration menu
    Copy the full SHA
    21de7e9 View commit details
    Browse the repository at this point in the history
  3. Merge branch 'rs/parallel-read-cache-fix'

    A follow-up fix to a topic already in 'master'.
    
    * rs/parallel-read-cache-fix:
      read-cache: fix mem-pool allocation for multi-threaded index loading
    gitster committed Sep 19, 2020
    Configuration menu
    Copy the full SHA
    2496da4 View commit details
    Browse the repository at this point in the history
  4. Merge branch 'so/log-tree-diff-cleanup'

    Code cleanup.
    
    * so/log-tree-diff-cleanup:
      log_tree_diff: get rid of extra check for NULL
      log_tree_diff: get rid of code duplication for first_parent_only
    gitster committed Sep 19, 2020
    Configuration menu
    Copy the full SHA
    e465444 View commit details
    Browse the repository at this point in the history
  5. Merge branch 'pb/clang-json-compilation-database'

    Developer support.
    
    * pb/clang-json-compilation-database:
      Makefile: add support for generating JSON compilation database
    gitster committed Sep 19, 2020
    Configuration menu
    Copy the full SHA
    4f4cb66 View commit details
    Browse the repository at this point in the history
  6. Merge branch 'ea/blame-use-oideq'

    Code cleanup.
    
    * ea/blame-use-oideq:
      blame.c: replace instance of !oidcmp for oideq
    gitster committed Sep 19, 2020
    Configuration menu
    Copy the full SHA
    e1dd499 View commit details
    Browse the repository at this point in the history
  7. Merge branch 'hn/refs-ref-log-only-bit'

    A bit of API reshuffling to make sure stuff common to all backends
    are not defined only in files backend.
    
    * hn/refs-ref-log-only-bit:
      refs: move REF_LOG_ONLY to refs-internal.h
    gitster committed Sep 19, 2020
    Configuration menu
    Copy the full SHA
    711f5b3 View commit details
    Browse the repository at this point in the history
  8. Merge branch 'al/t3200-back-on-a-branch'

    Test fix.
    
    * al/t3200-back-on-a-branch:
      t3200: clean side effect of git checkout --orphan
    gitster committed Sep 19, 2020
    Configuration menu
    Copy the full SHA
    e41500a View commit details
    Browse the repository at this point in the history
  9. Merge branch 'jc/add-i-use-builtin-experimental'

    The "add -i/-p" machinery has been written in C but it is not used
    by default yet.  It is made default to those who are participating
    in feature.experimental experiment.
    
    * jc/add-i-use-builtin-experimental:
      add -i: use the built-in version when feature.experimental is set
    gitster committed Sep 19, 2020
    Configuration menu
    Copy the full SHA
    e96b271 View commit details
    Browse the repository at this point in the history
  10. Merge branch 'pw/add-p-leakfix'

    Leakfix.
    
    * pw/add-p-leakfix:
      add -p: fix memory leak
    gitster committed Sep 19, 2020
    Configuration menu
    Copy the full SHA
    3ad8d3e View commit details
    Browse the repository at this point in the history
  11. Merge branch 'jk/add-i-fixes'

    "add -i/-p" fixes.
    
    * jk/add-i-fixes:
      add--interactive.perl: specify --no-color explicitly
      add-patch: fix inverted return code of repo_read_index()
    gitster committed Sep 19, 2020
    Configuration menu
    Copy the full SHA
    694e517 View commit details
    Browse the repository at this point in the history
  12. Merge branch 'es/wt-add-detach'

    "git worktree add" learns that the "-d" is a synonym to "--detach"
    option to create a new worktree without being on a branch.
    
    * es/wt-add-detach:
      git-worktree.txt: discuss branch-based vs. throwaway worktrees
      worktree: teach `add` to recognize -d as shorthand for --detach
      git-checkout.txt: document -d short option for --detach
    gitster committed Sep 19, 2020
    Configuration menu
    Copy the full SHA
    45f462b View commit details
    Browse the repository at this point in the history
  13. Merge branch 'os/collect-changed-submodules-optim'

    Optimization around submodule handling.
    
    * os/collect-changed-submodules-optim:
      submodule: suppress checking for file name and ref ambiguity for object ids
    gitster committed Sep 19, 2020
    Configuration menu
    Copy the full SHA
    2ce9d4e View commit details
    Browse the repository at this point in the history
  14. Merge branch 'jc/quote-path-cleanup'

    "git status --short" quoted a path with SP in it when tracked, but
    not those that are untracked, ignored or unmerged.  They are all
    shown quoted consistently.
    
    * jc/quote-path-cleanup:
      quote: turn 'nodq' parameter into a set of flags
      quote: rename misnamed sq_lookup[] to cq_lookup[]
      wt-status: consistently quote paths in "status --short" output
      quote_path: code clarification
      quote_path: optionally allow quoting a path with SP in it
      quote_path: give flags parameter to quote_path()
      quote_path: rename quote_path_relative() to quote_path()
    gitster committed Sep 19, 2020
    Configuration menu
    Copy the full SHA
    9d4e7ec View commit details
    Browse the repository at this point in the history
  15. Merge branch 'mf/submodule-summary-with-correct-repository'

    "git diff/show" on a change that involves a submodule used to read
    the information on commits in the submodule from a wrong repository
    and gave a wrong information when the commit-graph is involved.
    
    * mf/submodule-summary-with-correct-repository:
      submodule: use submodule repository when preparing summary
      revision: use repository from rev_info when parsing commits
    gitster committed Sep 19, 2020
    Configuration menu
    Copy the full SHA
    4831c23 View commit details
    Browse the repository at this point in the history
  16. Merge branch 'jc/dist-tarball-tweak'

    Allow maintainers to tweak $(TAR) invocations done while making
    distribution tarballs.
    
    * jc/dist-tarball-tweak:
      Makefile: allow extra tweaking of distribution tarball
    gitster committed Sep 19, 2020
    Configuration menu
    Copy the full SHA
    52bcf6e View commit details
    Browse the repository at this point in the history
  17. Merge branch 'mt/config-fail-nongit-early'

    Unlike "git config --local", "git config --worktree" did not fail
    early and cleanly when started outside a git repository.
    
    * mt/config-fail-nongit-early:
      config: complain about --worktree outside of a git repo
    gitster committed Sep 19, 2020
    Configuration menu
    Copy the full SHA
    80cacae View commit details
    Browse the repository at this point in the history
  18. Fifteenth batch

    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    gitster committed Sep 19, 2020
    Configuration menu
    Copy the full SHA
    385c171 View commit details
    Browse the repository at this point in the history

Commits on Sep 21, 2020

  1. msvc: copy the correct .pdb files in the Makefile target install

    There is a hard-coded list of `.pdb` files to copy. But we are about to
    introduce the `SKIP_DASHED_BUILT_INS` knob in the `Makefile`, which
    might make this hard-coded list incorrect.
    
    Let's switch to a dynamically-generated list instead.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Sep 21, 2020
    Configuration menu
    Copy the full SHA
    5df767c View commit details
    Browse the repository at this point in the history
  2. Optionally skip linking/copying the built-ins

    For a long time already, the non-dashed form of the built-ins is the
    recommended way to write scripts, i.e. it is better to call `git merge
    [...]` than to call `git-merge [...]`.
    
    While Git still supports the dashed form (by hard-linking the `git`
    executable to the dashed name in `libexec/git-core/`), in practice, it
    is probably almost irrelevant.
    
    However, we *do* care about keeping people's scripts working (even if
    they were written before the non-dashed form started to be recommended).
    
    Keeping this backwards-compatibility is not necessarily cheap, though:
    even so much as amending the tip commit in a git.git checkout will
    require re-linking all of those dashed commands. On this developer's
    laptop, this makes a noticeable difference:
    
    	$ touch version.c && time make
    	    CC version.o
    	    AR libgit.a
    	    LINK git-bugreport.exe
    	    [... 11 similar lines ...]
    	    LN/CP git-remote-https.exe
    	    LN/CP git-remote-ftp.exe
    	    LN/CP git-remote-ftps.exe
    	    LINK git.exe
    	    BUILTIN git-add.exe
    	    [... 123 similar lines ...]
    	    BUILTIN all
    	    SUBDIR git-gui
    	    SUBDIR gitk-git
    	    SUBDIR templates
    	    LINK t/helper/test-fake-ssh.exe
    	    LINK t/helper/test-line-buffer.exe
    	    LINK t/helper/test-svn-fe.exe
    	    LINK t/helper/test-tool.exe
    
    	real    0m36.633s
    	user    0m3.794s
    	sys     0m14.141s
    
    	$ touch version.c && time make SKIP_DASHED_BUILT_INS=1
    	    CC version.o
    	    AR libgit.a
    	    LINK git-bugreport.exe
    	    [... 11 similar lines ...]
    	    LN/CP git-remote-https.exe
    	    LN/CP git-remote-ftp.exe
    	    LN/CP git-remote-ftps.exe
    	    LINK git.exe
    	    BUILTIN git-receive-pack.exe
    	    BUILTIN git-upload-archive.exe
    	    BUILTIN git-upload-pack.exe
    	    BUILTIN all
    	    SUBDIR git-gui
    	    SUBDIR gitk-git
    	    SUBDIR templates
    	    LINK t/helper/test-fake-ssh.exe
    	    LINK t/helper/test-line-buffer.exe
    	    LINK t/helper/test-svn-fe.exe
    	    LINK t/helper/test-tool.exe
    
    	real    0m23.717s
    	user    0m1.562s
    	sys     0m5.210s
    
    Also, `.zip` files do not have any standardized support for hard-links,
    therefore "zipping up" the executables will result in inflated disk
    usage. (To keep down the size of the "MinGit" variant of Git for
    Windows, which is distributed as a `.zip` file, the hard-links are
    excluded specifically.)
    
    In addition to that, some programs that are regularly used to assess
    disk usage fail to realize that those are hard-links, and heavily
    overcount disk usage. Most notably, this was the case with Windows
    Explorer up until the last couple of Windows 10 versions. See e.g.
    msysgit/msysgit#58.
    
    To save on the time needed to hard-link these dashed commands, with the
    plan to eventually stop shipping with those hard-links on Windows, let's
    introduce a Makefile knob to skip generating them.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Sep 21, 2020
    Configuration menu
    Copy the full SHA
    14d6eee View commit details
    Browse the repository at this point in the history
  3. ci: stop linking built-ins to the dashed versions

    Since e4597aa (run test suite without dashed git-commands in PATH,
    2009-12-02), we stopped running our tests with `git-foo` binaries found
    at the top-level directory of a freshly built source tree; instead we
    have placed only `git` and selected `git-foo` commands that must be on
    `$PATH` in `bin-wrappers/` and prepended that `bin-wrappers/` to the
    `PATH` used in the test suite. We did that to catch the tests and
    scripted Git commands that still try to use the dashed form.
    
    Since CI jobs will not install the built Git to anywhere, and the
    hardlinks we make at the top-level of the source tree for `git-add` and
    friends are not even used during tests, they are pure waste of resources
    these days.
    
    Thanks to the newly invented `SKIP_DASHED_BUILT_INS` knob, we can now
    skip creating these links in the source tree. So let's do that.
    
    Note that this change introduces a subtle change of behavior: when Git's
    `cmd_main()` calls `setup_path()`, it inserts the value of
    `GIT_EXEC_PATH` (defaulting to `<prefix>/libexec/git-core`) at the
    beginning of the environment variable `PATH`. This is necessary to find
    e.g. scripted commands that are installed in that location. For the
    purposes of Git's test suite, the `bin-wrappers/` scripts override
    `GIT_EXEC_PATH` to point to the top-level directory of the source code.
    
    In other words, if a scripted command had used a dashed invocation of a
    built-in Git command, it would not have been caught previously, which is
    fixed by this change.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Sep 21, 2020
    Configuration menu
    Copy the full SHA
    1fdf24a View commit details
    Browse the repository at this point in the history