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

refs.h: make all flags arguments unsigned #1210

Closed
wants to merge 188 commits into from
Closed

Commits on Oct 14, 2021

  1. t7400-submodule-basic: modernize inspect() helper

    Since the inspect() helper in the submodule-basic test suite was
    written, 'git -C <dir>' was added. By using -C, we no longer need a
    reference to the base directory for the test. This simplifies callsites,
    and will make the addition of other arguments in later patches more
    readable.
    
    Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    nasamuffin authored and gitster committed Oct 14, 2021
    Configuration menu
    Copy the full SHA
    279e008 View commit details
    Browse the repository at this point in the history

Commits on Oct 21, 2021

  1. fsmonitor: enhance existing comments

    Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    jeffhostetler authored and gitster committed Oct 21, 2021
    Configuration menu
    Copy the full SHA
    2660789 View commit details
    Browse the repository at this point in the history
  2. fsmonitor-ipc: create client routines for git-fsmonitor--daemon

    Create fsmonitor_ipc__*() client routines to spawn the built-in file
    system monitor daemon and send it an IPC request using the `Simple
    IPC` API.
    
    Stub in empty fsmonitor_ipc__*() functions for unsupported platforms.
    
    Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    jeffhostetler authored and gitster committed Oct 21, 2021
    Configuration menu
    Copy the full SHA
    656efc5 View commit details
    Browse the repository at this point in the history
  3. fsmonitor: config settings are repository-specific

    Move fsmonitor config settings to a new and opaque
    `struct fsmonitor_settings` structure.  Add a lazily-loaded pointer
    to this into `struct repo_settings`
    
    Create an `enum fsmonitor_mode` type in `struct fsmonitor_settings` to
    represent the state of fsmonitor.  This lets us represent which, if
    any, fsmonitor provider (hook or IPC) is enabled.
    
    Create `fsm_settings__get_*()` getters to lazily look up fsmonitor-
    related config settings.
    
    Add support for the new `core.useBuiltinFSMonitor` config setting.
    
    Get rid of the `core_fsmonitor` global variable.  Move the code to
    lookup the existing `core.fsmonitor` config value into the fsmonitor
    settings.
    
    Create a hook pathname variable in `struct fsmonitor-settings` and
    only set it when in hook mode.
    
    The existing `core_fsmonitor` global variable was used to store the
    pathname to the fsmonitor hook *and* it was used as a boolean to see
    if fsmonitor was enabled.  This dual usage and global visibility leads
    to confusion when we add the IPC-based provider.  So lets hide the
    details in fsmonitor-settings.c and let it decide which provider to
    use in the case of multiple settings.  This avoids cluttering up
    repo-settings.c with these private details.
    
    A future commit in builtin-fsmonitor series will add the ability to
    disqualify worktrees for various reasons, such as being mounted from a
    remote volume, where fsmonitor should not be started.  Having the
    config settings hidden in fsmonitor-settings.c allows such worktree
    restrictions to override the config values used.
    
    Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    jeffhostetler authored and gitster committed Oct 21, 2021
    Configuration menu
    Copy the full SHA
    d5a8573 View commit details
    Browse the repository at this point in the history
  4. fsmonitor: use IPC to query the builtin FSMonitor daemon

    Use simple IPC to directly communicate with the new builtin file
    system monitor daemon when `core.useBuiltinFSMonitor` is set.
    
    The `core.fsmonitor` setting has already been defined as a HOOK
    pathname.  Historically, this has been set to a HOOK script that will
    talk with Watchman.  For compatibility reasons, we do not want to
    overload that definition (and cause problems if users have multiple
    versions of Git installed).
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    jeffhostetler authored and gitster committed Oct 21, 2021
    Configuration menu
    Copy the full SHA
    101fd33 View commit details
    Browse the repository at this point in the history
  5. fsmonitor: document builtin fsmonitor

    Document the new `core.useBuiltinFSMonitor` config value.
    
    Update references to `core.fsmonitor` and `core.fsmonitorHookVersion` and
    pointers to `Watchman` to refer to it.
    
    Create `git-fsmonitor--daemon` manual page and describe its features.
    
    Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    jeffhostetler authored and gitster committed Oct 21, 2021
    Configuration menu
    Copy the full SHA
    15a30a3 View commit details
    Browse the repository at this point in the history
  6. fsmonitor--daemon: add a built-in fsmonitor daemon

    Create a built-in file system monitoring daemon that can be used by
    the existing `fsmonitor` feature (protocol API and index extension)
    to improve the performance of various Git commands, such as `status`.
    
    The `fsmonitor--daemon` feature builds upon the `Simple IPC` API and
    provides an alternative to hook access to existing fsmonitors such
    as `watchman`.
    
    This commit merely adds the new command without any functionality.
    
    Co-authored-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    2 people authored and gitster committed Oct 21, 2021
    Configuration menu
    Copy the full SHA
    8142440 View commit details
    Browse the repository at this point in the history
  7. fsmonitor--daemon: implement 'stop' and 'status' commands

    Implement `stop` and `status` client commands to control and query the
    status of a `fsmonitor--daemon` server process (and implicitly start a
    server process if necessary).
    
    Later commits will implement the actual server and monitor the file
    system.
    
    Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    jeffhostetler authored and gitster committed Oct 21, 2021
    Configuration menu
    Copy the full SHA
    7c49474 View commit details
    Browse the repository at this point in the history
  8. compat/fsmonitor/fsm-listen-win32: stub in backend for Windows

    Stub in empty filesystem listener backend for fsmonitor--daemon on Windows.
    
    Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    jeffhostetler authored and gitster committed Oct 21, 2021
    Configuration menu
    Copy the full SHA
    2411a88 View commit details
    Browse the repository at this point in the history
  9. compat/fsmonitor/fsm-listen-darwin: stub in backend for Darwin

    Stub in empty implementation of fsmonitor--daemon
    backend for Darwin (aka MacOS).
    
    Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    jeffhostetler authored and gitster committed Oct 21, 2021
    Configuration menu
    Copy the full SHA
    12f8d45 View commit details
    Browse the repository at this point in the history
  10. fsmonitor--daemon: implement 'run' command

    Implement `run` command to try to begin listening for file system events.
    
    This version defines the thread structure with a single fsmonitor_fs_listen
    thread to watch for file system events and a simple IPC thread pool to
    watch for connection from Git clients over a well-known named pipe or
    Unix domain socket.
    
    This commit does not actually do anything yet because the platform
    backends are still just stubs.
    
    Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    jeffhostetler authored and gitster committed Oct 21, 2021
    Configuration menu
    Copy the full SHA
    884ae3f View commit details
    Browse the repository at this point in the history
  11. fsmonitor--daemon: implement 'start' command

    Implement 'git fsmonitor--daemon start' command.  This command starts
    an instance of 'git fsmonitor--daemon run' in the background using
    the new 'start_bg_command()' function.
    
    We avoid the fork-and-call technique on Unix systems in favor of a
    fork-and-exec technique.  This gives us more uniform Trace2 child-*
    events.  It also makes our usage more consistent with Windows usage.
    
    On Windows, teach 'git fsmonitor--daemon run' to optionally call
    'FreeConsole()' to release handles to the inherited Win32 console
    (despite being passed invalid handles for stdin/out/err).  Without
    this, command prompts and powershell terminal windows could hang
    in "exit" until the last background child process exited or released
    their Win32 console handle.  (This was not seen with git-bash shells
    because they don't have a Win32 console attached to them.)
    
    Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    jeffhostetler authored and gitster committed Oct 21, 2021
    Configuration menu
    Copy the full SHA
    44be368 View commit details
    Browse the repository at this point in the history
  12. fsmonitor--daemon: add pathname classification

    Teach fsmonitor--daemon to classify relative and absolute
    pathnames and decide how they should be handled.  This will
    be used by the platform-specific backend to respond to each
    filesystem event.
    
    When we register for filesystem notifications on a directory,
    we get events for everything (recursively) in the directory.
    We want to report to clients changes to tracked and untracked
    paths within the working directory.  We do not want to report
    changes within the .git directory, for example.
    
    This classification will be used in a later commit by the
    different backends to classify paths as events are received.
    
    Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    jeffhostetler authored and gitster committed Oct 21, 2021
    Configuration menu
    Copy the full SHA
    6ced6e2 View commit details
    Browse the repository at this point in the history
  13. fsmonitor--daemon: define token-ids

    Teach fsmonitor--daemon to create token-ids and define the
    overall token naming scheme.
    
    Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    jeffhostetler authored and gitster committed Oct 21, 2021
    Configuration menu
    Copy the full SHA
    492a65b View commit details
    Browse the repository at this point in the history
  14. fsmonitor--daemon: create token-based changed path cache

    Teach fsmonitor--daemon to build a list of changed paths and associate
    them with a token-id.  This will be used by the platform-specific
    backends to accumulate changed paths in response to filesystem events.
    
    The platform-specific file system listener thread receives file system
    events containing one or more changed pathnames (with whatever bucketing
    or grouping that is convenient for the file system).  These paths are
    accumulated (without locking) by the file system layer into a `fsmonitor_batch`.
    
    When the file system layer has drained the kernel event queue, it will
    "publish" them to our token queue and make them visible to concurrent
    client worker threads.  The token layer is free to combine and/or de-dup
    paths within these batches for efficient presentation to clients.
    
    Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    jeffhostetler authored and gitster committed Oct 21, 2021
    Configuration menu
    Copy the full SHA
    eac8ea8 View commit details
    Browse the repository at this point in the history
  15. compat/fsmonitor/fsm-listen-win32: implement FSMonitor backend on Win…

    …dows
    
    Teach the win32 backend to register a watch on the working tree
    root directory (recursively).  Also watch the <gitdir> if it is
    not inside the working tree.  And to collect path change notifications
    into batches and publish.
    
    Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    jeffhostetler authored and gitster committed Oct 21, 2021
    Configuration menu
    Copy the full SHA
    b73aeb6 View commit details
    Browse the repository at this point in the history
  16. compat/fsmonitor/fsm-listen-darwin: add macos header files for FSEvent

    Include MacOS system declarations to allow us to use FSEvent and
    CoreFoundation APIs.  We need GCC and clang versions because of
    compiler and header file conflicts.
    
    While it is quite possible to #include Apple's CoreServices.h when
    compiling C source code with clang, trying to build it with GCC
    currently fails with this error:
    
    In file included
       from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Security.framework/Headers/AuthSession.h:32,
       from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Security.framework/Headers/Security.h:42,
       from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/CSIdentity.h:43,
       from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/OSServices.h:29,
       from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/IconsCore.h:23,
       from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LaunchServices.h:23,
       from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:45,
         /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Security.framework/Headers/Authorization.h:193:7: error: variably modified 'bytes' at file scope
           193 | char bytes[kAuthorizationExternalFormLength];
               |      ^~~~~
    
    The underlying reason is that GCC (rightfully) objects that an `enum`
    value such as `kAuthorizationExternalFormLength` is not a constant
    (because it is not, the preprocessor has no knowledge of it, only the
    actual C compiler does) and can therefore not be used to define the size
    of a C array.
    
    This is a known problem and tracked in GCC's bug tracker:
    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93082
    
    In the meantime, let's not block things and go the slightly ugly route
    of declaring/defining the FSEvents constants, data structures and
    functions that we need, so that we can avoid above-mentioned issue.
    
    Let's do this _only_ for GCC, though, so that the CI/PR builds (which
    build both with clang and with GCC) can guarantee that we _are_ using
    the correct data types.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    jeffhostetler authored and gitster committed Oct 21, 2021
    Configuration menu
    Copy the full SHA
    f5dc5dd View commit details
    Browse the repository at this point in the history
  17. compat/fsmonitor/fsm-listen-darwin: implement FSEvent listener on MacOS

    Implement file system event listener on MacOS using FSEvent,
    CoreFoundation, and CoreServices.
    
    Co-authored-by: Kevin Willford <Kevin.Willford@microsoft.com>
    Co-authored-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    3 people authored and gitster committed Oct 21, 2021
    Configuration menu
    Copy the full SHA
    cd5beb2 View commit details
    Browse the repository at this point in the history
  18. fsmonitor--daemon: implement handle_client callback

    Teach fsmonitor--daemon to respond to IPC requests from client
    Git processes and respond with a list of modified pathnames
    relative to the provided token.
    
    Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    jeffhostetler authored and gitster committed Oct 21, 2021
    Configuration menu
    Copy the full SHA
    9623fe9 View commit details
    Browse the repository at this point in the history
  19. help: include fsmonitor--daemon feature flag in version info

    Add the "feature: fsmonitor--daemon" message to the output of
    `git version --build-options`.
    
    The builtin FSMonitor is only available on certain platforms and
    even then only when certain Makefile flags are enabled, so print
    a message in the verbose version output when it is available.
    
    This can be used by test scripts for prereq testing.  Granted, tests
    could just try `git fsmonitor--daemon status` and look for a 128 exit
    code or grep for a "not supported" message on stderr, but this is
    rather obscure.
    
    The main advantage is that the feature message will automatically
    appear in bug reports and other support requests.
    
    Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    jeffhostetler authored and gitster committed Oct 21, 2021
    Configuration menu
    Copy the full SHA
    cd6d50b View commit details
    Browse the repository at this point in the history
  20. t/helper/fsmonitor-client: create IPC client to talk to FSMonitor Daemon

    Create an IPC client to send query and flush commands to the daemon.
    
    Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    jeffhostetler authored and gitster committed Oct 21, 2021
    Configuration menu
    Copy the full SHA
    866d64c View commit details
    Browse the repository at this point in the history
  21. t7527: create test for fsmonitor--daemon

    Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    jeffhostetler authored and gitster committed Oct 21, 2021
    Configuration menu
    Copy the full SHA
    2136985 View commit details
    Browse the repository at this point in the history
  22. t/perf: avoid copying builtin fsmonitor files into test repo

    Do not copy any of the various fsmonitor--daemon files from the .git
    directory of the (GIT_PREF_REPO or GIT_PERF_LARGE_REPO) source repo
    into the test's trash directory.
    
    When perf tests start, they copy the contents of the source repo into
    the test's trash directory.  If fsmonitor is running in the source repo,
    there may be control files, such as the IPC socket and/or fsmonitor
    cookie files.  These should not be copied into the test repo.
    
    Unix domain sockets cannot be copied in the manner used by the test
    setup, so if present, the test setup fails.
    
    Cookie files are harmless, but we should avoid them.
    
    The builtin fsmonitor keeps all such control files/sockets in
    .git/fsmonitor--daemon*, so it is simple to exclude them.
    
    Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    jeffhostetler authored and gitster committed Oct 21, 2021
    Configuration menu
    Copy the full SHA
    c8c2657 View commit details
    Browse the repository at this point in the history
  23. t/helper/test-chmtime: skip directories on Windows

    Teach `test-tool.exe chmtime` to ignore errors when setting the mtime
    on a directory on Windows.
    
    NEEDSWORK: The Windows version of `utime()` (aka `mingw_utime()`) does
    not properly handle directories because it uses `_wopen()`.  It should
    be converted to using `CreateFileW()` and backup semantics at a minimum.
    Since I'm already in the middle of a large patch series, I did not want
    to destabilize other callers of `utime()` right now.  The problem has
    only been observed in the t/perf/p7519 test when the test repo contains
    an empty directory on disk.
    
    Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    jeffhostetler authored and gitster committed Oct 21, 2021
    Configuration menu
    Copy the full SHA
    81cc7cd View commit details
    Browse the repository at this point in the history
  24. t/perf/p7519: speed up test on Windows

    Change p7519 to use `test_seq` and `xargs` rather than a `for` loop
    to touch thousands of files.  This takes minutes off of test runs
    on Windows because of process creation overhead.
    
    Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    jeffhostetler authored and gitster committed Oct 21, 2021
    Configuration menu
    Copy the full SHA
    ebc550a View commit details
    Browse the repository at this point in the history
  25. t/perf/p7519: add fsmonitor--daemon test cases

    Repeat all of the fsmonitor perf tests using `git fsmonitor--daemon` and
    the "Simple IPC" interface.
    
    Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    jeffhostetler authored and gitster committed Oct 21, 2021
    Configuration menu
    Copy the full SHA
    07fecc7 View commit details
    Browse the repository at this point in the history
  26. fsmonitor--daemon: periodically truncate list of modified files

    Teach fsmonitor--daemon to periodically truncate the list of
    modified files to save some memory.
    
    Clients will ask for the set of changes relative to a token that they
    found in the FSMN index extension in the index.  (This token is like a
    point in time, but different).  Clients will then update the index to
    contain the response token (so that subsequent commands will be
    relative to this new token).
    
    Therefore, the daemon can gradually truncate the in-memory list of
    changed paths as they become obsolete (older than the previous token).
    Since we may have multiple clients making concurrent requests with a
    skew of tokens and clients may be racing to the talk to the daemon,
    we lazily truncate the list.
    
    We introduce a 5 minute delay and truncate batches 5 minutes after
    they are considered obsolete.
    
    Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    jeffhostetler authored and gitster committed Oct 21, 2021
    Configuration menu
    Copy the full SHA
    8e16a9c View commit details
    Browse the repository at this point in the history
  27. fsmonitor--daemon: use a cookie file to sync with file system

    Teach fsmonitor--daemon client threads to create a cookie file
    inside the .git directory and then wait until FS events for the
    cookie are observed by the FS listener thread.
    
    This helps address the racy nature of file system events by
    blocking the client response until the kernel has drained any
    event backlog.
    
    This is especially important on MacOS where kernel events are
    only issued with a limited frequency.  See the `latency` argument
    of `FSeventStreamCreate()`.  The kernel only signals every `latency`
    seconds, but does not guarantee that the kernel queue is completely
    drained, so we may have to wait more than one interval.  If we
    increase the frequency, the system is more likely to drop events.
    We avoid these issues by having each client thread create a unique
    cookie file and then wait until it is seen in the event stream.
    
    Co-authored-by: Kevin Willford <Kevin.Willford@microsoft.com>
    Co-authored-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    3 people authored and gitster committed Oct 21, 2021
    Configuration menu
    Copy the full SHA
    9ab6e3c View commit details
    Browse the repository at this point in the history
  28. fsmonitor: force update index after large responses

    Measure the time taken to apply the FSMonitor query result
    to the index and the untracked-cache.
    
    Set the `FSMONITOR_CHANGED` bit on `istate->cache_changed` when
    FSMonitor returns a very large repsonse to ensure that the index is
    written to disk.
    
    Normally, when the FSMonitor response includes a tracked file, the
    index is always updated.  Similarly, the index might be updated when
    the response alters the untracked-cache (when enabled).  However, in
    cases where neither of those cause the index to be considered changed,
    the FSMonitor response is wasted.  Subsequent Git commands will make
    requests with the same token and receive the same response.
    
    If that response is very large, performance may suffer.  It would be
    more efficient to force update the index now (and the token in the
    index extension) in order to reduce the size of the response received
    by future commands.
    
    This was observed on Windows after a large checkout.  On Windows, the
    kernel emits events for the files that are changed as they are
    changed.  However, it might delay events for the containing
    directories until the system is more idle (or someone scans the
    directory (so it seems)).  The first status following a checkout would
    get the list of files.  The subsequent status commands would get the
    list of directories as the events trickled out.  But they would never
    catch up because the token was not advanced because the index wasn't
    updated.
    
    This list of directories caused `wt_status_collect_untracked()` to
    unnecessarily spend time actually scanning them during each command.
    
    Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    jeffhostetler authored and gitster committed Oct 21, 2021
    Configuration menu
    Copy the full SHA
    8b213c4 View commit details
    Browse the repository at this point in the history
  29. t7527: test status with untracked-cache and fsmonitor--daemon

    Create 2x2 test matrix with the untracked-cache and fsmonitor--daemon
    features and a series of edits and verify that status output is
    identical.
    
    Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    jeffhostetler authored and gitster committed Oct 21, 2021
    Configuration menu
    Copy the full SHA
    e89980f View commit details
    Browse the repository at this point in the history

Commits on Nov 19, 2021

  1. introduce submodule.superprojectGitDir record

    Teach submodules a reference to their superproject's gitdir. This allows
    us to A) know that we're running from a submodule, and B) have a
    shortcut to the superproject's vitals, for example, configs.
    
    By using a relative path instead of an absolute path, we can move the
    superproject directory around on the filesystem without breaking the
    submodule's pointer. And by using the path from gitdir to gitdir, we can
    move the submodule within the superproject's tree structure without
    breaking the submodule's pointer, too. Finally, by pointing at the
    superproject's worktree gitdir (if it exists), we ensure that we can
    tell which worktree contains our submodule.
    
    Since this hint value is only introduced during new submodule creation
    via `git submodule add`, though, there is more work to do to allow the
    record to be created at other times.
    
    Once this new config is reliably in place, we can use it to know
    definitively that we are working in a submodule, and to know which
    superproject we are a submodule of. This allows us to do some
    value-added behavior, like letting "git status" print additional info
    about the submodule's status in relation to its superproject, or like
    letting the superproject and submodule share an additional config file
    separate from either one's local config.
    
    Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
    Helped-by: Junio C Hamano <gitster@pobox.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    nasamuffin authored and gitster committed Nov 19, 2021
    Configuration menu
    Copy the full SHA
    e62a7db View commit details
    Browse the repository at this point in the history
  2. submodule: record superproject gitdir during absorbgitdirs

    Already during 'git submodule add' we record a pointer to the
    superproject's gitdir. However, this doesn't help brand-new
    submodules created with 'git init' and later absorbed with 'git
    submodule absorbgitdirs'. Let's start adding that pointer during 'git
    submodule absorbgitdirs' too.
    
    Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    nasamuffin authored and gitster committed Nov 19, 2021
    Configuration menu
    Copy the full SHA
    3b2a0f3 View commit details
    Browse the repository at this point in the history
  3. submodule: record superproject gitdir during 'update'

    A recorded path to the superproject's gitdir might be added during
    'git submodule add', but in some cases - like submodules which were
    created before 'git submodule add' learned to record that info - it might
    be useful to update the hint. Let's do it during 'git submodule
    update', when we already have a handle to the superproject while calling
    operations on the submodules.
    
    Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    nasamuffin authored and gitster committed Nov 19, 2021
    Configuration menu
    Copy the full SHA
    588504b View commit details
    Browse the repository at this point in the history
  4. submodule: use config to find superproject worktree

    Now that submodule.superprojectGitDir is being treated as the point of
    truth for whether a repo is a submodule or not, let's use it in `git
    rev-parse --show-superproject-working-tree`.
    
    Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    nasamuffin authored and gitster committed Nov 19, 2021
    Configuration menu
    Copy the full SHA
    2e5b7d4 View commit details
    Browse the repository at this point in the history

Commits on Dec 2, 2021

  1. terminal: teach save_term to fail when not foreground

    e22b245 (terminal: teach git how to save/restore its terminal
    settings, 2021-10-05) allows external calls to the termios code,
    but kept the assumption that all operations were done with
    foreground processes, which was proven incorrect.
    
    Add a check to validate that the current process is indeed in the
    foreground and in control of the terminal and fail early if not the
    case.
    
    To avoid changing behaviour from the other users of save_term() the
    full_duplex parameter has been overloaded to restrict the new check
    to only future callers, as it is set to 0 for all current users.
    
    The detection is done in a helper function so it can be reused by
    all other functions that might benefit from it later, and once that
    is done that overloading might be unnecessary and cleaned up, but
    doing so has been punted from this series as it is not needed and
    might require backward incompatible changes.
    
    Helped-by: Phillip Wood <phillip.wood123@gmail.com>
    Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    carenas authored and gitster committed Dec 2, 2021
    Configuration menu
    Copy the full SHA
    e0b9248 View commit details
    Browse the repository at this point in the history
  2. editor: allow for saving/restoring terminal state

    When EDITOR is invoked to modify a commit message (or do some
    other editing), and it is a terminal mode editor, it will need to
    change the terminal settings, and if it misbehaves could leave the
    terminal output damaged as shown in recent reports from Windows
    Terminal[1]
    
    Instead use the functions provided by compat/terminal to save the
    settings of the terminal and recover safely, but only do so if
    the editor is known to have issues and unless the user has told
    us through a boolean configuration "editor.stty" that it is safe
    not to do so.
    
    [1] microsoft/terminal#9359
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    gitster committed Dec 2, 2021
    Configuration menu
    Copy the full SHA
    b371c1b View commit details
    Browse the repository at this point in the history
  3. fixup! editor: allow for saving/restoring terminal state

    Use DEFAULT_EDITOR instead of another hardcoding of "vi".
    
    Do a minor refactoring to avoid having to call isatty(2) twice,
    and while at it, a related reformatting that avoids an overlong
    line.
    
    Only check if we should enable saving/restoring the terminal if
    the session is interactive.
    
    Add documentation for the configuration variable.
    
    Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    carenas authored and gitster committed Dec 2, 2021
    Configuration menu
    Copy the full SHA
    86a3696 View commit details
    Browse the repository at this point in the history

Commits on Dec 22, 2021

  1. fetch-pack: parameterize message containing 'ready' keyword

    The protocol keyword 'ready' isn't meant for translation. Pass it as
    parameter instead of spell it in die() message (and potentially confuse
    translators).
    
    Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    bagasme authored and gitster committed Dec 22, 2021
    Configuration menu
    Copy the full SHA
    d3ebf1f View commit details
    Browse the repository at this point in the history

Commits on Dec 23, 2021

  1. Configuration menu
    Copy the full SHA
    a631cd4 View commit details
    Browse the repository at this point in the history

Commits on Dec 26, 2021

  1. fixup! t/perf/p7519: speed up test on Windows

    Fix style violation of a shell-function definition introduced by
    this step, and correct existing ones while at it.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    gitster committed Dec 26, 2021
    Configuration menu
    Copy the full SHA
    c58b72f View commit details
    Browse the repository at this point in the history
  2. fixup! t7527: create test for fsmonitor--daemon

    Fix style violation of a shell-function definition
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    gitster committed Dec 26, 2021
    Configuration menu
    Copy the full SHA
    976a6d6 View commit details
    Browse the repository at this point in the history

Commits on Jan 8, 2022

  1. leak tests: fix a memory leak in "test-progress" helper

    Fix a memory leak in the test-progress helper, and mark the
    corresponding "t0500-progress-display.sh" test as being leak-free
    under SANITIZE=leak. This fixes a leak added in 2bb74b5 (Test the
    progress display, 2019-09-16).
    
    My 48f6871 (tr2: stop leaking "thread_name" memory, 2021-08-27)
    had fixed another memory leak in this test (as it did some trace2
    testing).
    
    Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    avar authored and gitster committed Jan 8, 2022
    Configuration menu
    Copy the full SHA
    a7e6a9c View commit details
    Browse the repository at this point in the history
  2. progress.c test helper: add missing braces

    If we have braces on one arm of an if/else all of them should have it,
    per the CodingGuidelines's "When there are multiple arms to a
    conditional[...]" advice. This formatting change makes a subsequent
    commit smaller.
    
    Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    avar authored and gitster committed Jan 8, 2022
    Configuration menu
    Copy the full SHA
    31efeb9 View commit details
    Browse the repository at this point in the history
  3. progress.c tests: make start/stop commands on stdin

    Change the usage of the "test-tool progress" introduced in
    2bb74b5 (Test the progress display, 2019-09-16) to take command
    like "start" and "stop" on stdin, instead of running them implicitly.
    
    This makes for tests that are easier to read, since the recipe will
    mirror the API usage, and allows for easily testing invalid usage that
    would yield (or should yield) a BUG(), e.g. providing two "start"
    calls in a row. A subsequent commit will add such tests.
    
    Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    avar authored and gitster committed Jan 8, 2022
    Configuration menu
    Copy the full SHA
    e9b3e61 View commit details
    Browse the repository at this point in the history
  4. progress.c tests: test some invalid usage

    Test what happens when we "stop" without a "start", omit the "stop"
    after a "start", or try to start two concurrent progress bars. This
    extends the trace2 tests added in 98a1364 (trace2: log progress
    time and throughput, 2020-05-12).
    
    These tests are not merely testing the helper, but invalid API usage
    that can happen if the progress.c API is misused.
    
    The "without stop" test will leak under SANITIZE=leak, since this
    buggy use of the API will leak memory. But let's not skip it entirely,
    or use the "!SANITIZE_LEAK" prerequisite check as we'd do with tests
    that we're skipping due to leaks we haven't fixed yet. Instead
    annotate the specific command that should skip leak checking with
    custom $LSAN_OPTIONS[1].
    
    1. https://github.com/google/sanitizers/wiki/AddressSanitizerLeakSanitizer
    
    Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    avar authored and gitster committed Jan 8, 2022
    Configuration menu
    Copy the full SHA
    3bd92ed View commit details
    Browse the repository at this point in the history
  5. progress.c: add temporary variable from progress struct

    Since 98a1364 (trace2: log progress time and throughput,
    2020-05-12) stop_progress() dereferences a "struct progress **"
    parameter in several places. Extract a dereferenced variable (like in
    stop_progress_msg()) to reduce clutter and make it clearer who needs
    to write to this parameter.
    
    Now instead of using "*p_progress" several times in stop_progress() we
    check it once for NULL and then use a dereferenced "progress" variable
    thereafter. This continues the same pattern used in the above
    stop_progress() function, see ac900fd (progress: don't dereference
    before checking for NULL, 2020-08-10).
    
    Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    avar authored and gitster committed Jan 8, 2022
    Configuration menu
    Copy the full SHA
    0dd1448 View commit details
    Browse the repository at this point in the history
  6. pack-bitmap-write.c: don't return without stop_progress()

    Fix a bug that's been here since 7cc8f97 (pack-objects: implement
    bitmap writing, 2013-12-21), we did not call stop_progress() if we
    reached the early exit in this function.
    
    We could call stop_progress() before we return, but better yet is to
    defer calling start_progress() until we need it. For now this only
    matters in practice because we'd previously omit the "region_leave"
    for the progress trace2 event.
    
    Suggested-by: SZEDER Gábor <szeder.dev@gmail.com>
    Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    avar authored and gitster committed Jan 8, 2022
    Configuration menu
    Copy the full SHA
    5a4128c View commit details
    Browse the repository at this point in the history
  7. *.c: use isatty(0|2), not isatty(STDIN_FILENO|STDERR_FILENO)

    We have over 50 uses of "isatty(1)" and "isatty(2)" in the codebase,
    and around 10 "isatty(0)", but three callers used the
    {STDIN_FILENO,STD{OUT,ERR}_FILENO} macros in "stdlib.h" to refer to
    them.
    
    Let's change these for consistency.  This makes it easier to change
    all calls to isatty() at a whim, which is useful to test some
    scenarios[1].
    
    1. https://lore.kernel.org/git/patch-v6-8.8-bff919994b5-20211102T122507Z-avarab@gmail.com/
    
    Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    avar authored and gitster committed Jan 8, 2022
    Configuration menu
    Copy the full SHA
    af5d71b View commit details
    Browse the repository at this point in the history

Commits on Jan 10, 2022

  1. sparse-checkout: custom tab completion tests

    Add tests for missing/incorrect components of custom tab completion for the
    sparse-checkout command. These tests specifically highlight the following:
    
    1. git sparse-checkout <TAB> results in an incomplete list of subcommands
    (it is missing reapply and add).
    2. git sparse-checkout --<TAB> does not complete the help option.
    3. Options for subcommands are not tab-completable.
    4. git sparse-checkout set <TAB> and git sparse-checkout add <TAB> show
    both file names and directory names.
    
    Although these tests currently fail, they will succeed with the
    sparse-checkout modifications in git-completion.bash in the next commit in
    this series.
    
    Signed-off-by: Lessley Dennington <lessleydennington@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    ldennington authored and gitster committed Jan 10, 2022
    Configuration menu
    Copy the full SHA
    d482fbc View commit details
    Browse the repository at this point in the history
  2. sparse-checkout: custom tab completion

    Fix custom tab completion for sparse-checkout command. This will ensure:
    
    1. The full list of subcommands is provided when users enter git
    sparse-checkout <TAB>.
    2. The --help option is tab-completable.
    3. Subcommand options are tab-completable.
    4. A list of directories (but not files) is provided when users enter git
    sparse-checkout add <TAB> or git sparse-checkout set <TAB>. It is
    important to note that this will apply for both cone mode and non-cone
    mode (even though non-cone mode matches on patterns rather than
    directories).
    
    Failing tests that were added in the previous commit to verify these
    scenarios are now passing with these updates.
    
    Signed-off-by: Lessley Dennington <lessleydennington@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    ldennington authored and gitster committed Jan 10, 2022
    Configuration menu
    Copy the full SHA
    a4143e0 View commit details
    Browse the repository at this point in the history
  3. sparse-checkout: limit tab completion to a single level

    Ensure only directories at the current level will be tab-completed with
    the sparse-checkout command. For example, if paths a/b/c/ and a/d/ exist
    in the current directory, running a/<TAB> will result in:
    
            a/b/
            a/d/
    
    The 'sparse-checkout completes directory names' test has also been
    updated/extended according to these changes.
    
    Co-authored-by: Elijah Newren <newren@gmail.com>
    Co-authored-by: Lessley Dennington <lessleydennington@gmail.com>
    Signed-off-by: Lessley Dennington <lessleydennington@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    2 people authored and gitster committed Jan 10, 2022
    Configuration menu
    Copy the full SHA
    a5dea2c View commit details
    Browse the repository at this point in the history

Commits on Jan 14, 2022

  1. ls-tree: remove commented-out code

    Remove code added in f35a6d3 (Teach core object handling functions
    about gitlinks, 2007-04-09), later patched in 7d0b18a (Add output
    flushing before fork(), 2008-08-04), and then finally ending up in its
    current form in d3bee16 (tree.c: allow read_tree_recursive() to
    traverse gitlink entries, 2009-01-25). All while being commented-out!
    
    Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    avar authored and gitster committed Jan 14, 2022
    Configuration menu
    Copy the full SHA
    18b01b0 View commit details
    Browse the repository at this point in the history
  2. ls-tree: add missing braces to "else" arms

    Add missing {} to the "else" arms in show_tree() per the
    CodingGuidelines.
    
    Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    avar authored and gitster committed Jan 14, 2022
    Configuration menu
    Copy the full SHA
    6b1796b View commit details
    Browse the repository at this point in the history
  3. ls-tree: use "enum object_type", not {blob,tree,commit}_type

    Change the ls-tree.c code to use type_name() on the enum instead of
    using the string constants. This doesn't matter either way for
    performance, but makes this a bit easier to read as we'll no longer
    need a strcmp() here.
    
    Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    avar authored and gitster committed Jan 14, 2022
    Configuration menu
    Copy the full SHA
    9dc969c View commit details
    Browse the repository at this point in the history
  4. ls-tree: use "size_t", not "int" for "struct strbuf"'s "len"

    The "struct strbuf"'s "len" member is a "size_t", not an "int", so
    let's change our corresponding types accordingly. This also changes
    the "len" and "speclen" variables, which are likewise used to store
    the return value of strlen(), which returns "size_t", not "int".
    
    Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    avar authored and gitster committed Jan 14, 2022
    Configuration menu
    Copy the full SHA
    a3385c8 View commit details
    Browse the repository at this point in the history
  5. ls-tree: optimize naming and handling of "return" in show_tree()

    The variable which "show_tree()" return is named "retval", a name that's
    a little hard to understand. This commit tries to make the variable
    and the related codes more clear in the context.
    
    The commit firstly rename "retval" to "recurse" which is a more
    meaningful name than before. Secondly, "get_type()" is introduced
    to setup the "type" by "mode", this will remove some of the nested if.
    After this, The codes here become a little bit clearer, so we do not
    need to take a look at "read_tree_at()" in "tree.c" to make sure the
    context of the return value.
    
    Signed-off-by: Teng Long <dyronetengb@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    dyrone authored and gitster committed Jan 14, 2022
    Configuration menu
    Copy the full SHA
    d5e7af7 View commit details
    Browse the repository at this point in the history
  6. ls-tree.c: support --object-only option for "git-ls-tree"

    We usually pipe the output from `git ls-trees` to tools like
    `sed` or `cut` when we only want to extract some fields.
    
    When we want only the pathname component, we can pass
    `--name-only` option to omit such a pipeline, but there are no
    options for extracting other fields.
    
    Teach the "--object-only" option to the command to only show the
    object name. This option cannot be used together with
    "--name-only" or "--long" , they are mutually exclusive (actually
    "--name-only" and "--long" can be combined together before, this
    commit by the way fix this bug).
    
    A simple refactoring was done to the "show_tree" function, intead by
    using bitwise operations to recognize the format for printing to
    stdout. The reason for doing this is that we don't want to increase
    the readability difficulty with the addition of "-object-only",
    making this part of the logic easier to read and expand.
    
    In terms of performance, there is no loss comparing to the
    "master" (2ae0a9c), here are the
    results of the performance tests in my environment based on linux
    repository:
    
        $hyperfine --warmup=10 "/opt/git/master/bin/git ls-tree -r HEAD"
        Benchmark 1: /opt/git/master/bin/git ls-tree -r HEAD
        Time (mean ± σ):     105.8 ms ±   2.7 ms    [User: 85.7 ms, System: 20.0 ms]
        Range (min … max):   101.5 ms … 111.3 ms    28 runs
    
        $hyperfine --warmup=10 "/opt/git/ls-tree-oid-only/bin/git ls-tree -r HEAD"
        Benchmark 1: /opt/git/ls-tree-oid-only/bin/git ls-tree -r HEAD
        Time (mean ± σ):     105.0 ms ±   3.0 ms    [User: 83.7 ms, System: 21.2 ms]
        Range (min … max):    99.3 ms … 109.5 ms    27 runs
    
        $hyperfine --warmup=10 "/opt/git/master/bin/git ls-tree -r -l HEAD"
        Benchmark 1: /opt/git/master/bin/git ls-tree -r -l HEAD
        Time (mean ± σ):     337.4 ms ±  10.9 ms    [User: 308.3 ms, System: 29.0 ms]
        Range (min … max):   323.0 ms … 355.0 ms    10 runs
    
        $hyperfine --warmup=10 "/opt/git/ls-tree-oid-only/bin/git ls-tree -r -l HEAD"
        Benchmark 1: /opt/git/ls-tree-oid-only/bin/git ls-tree -r -l HEAD
        Time (mean ± σ):     337.6 ms ±   6.2 ms    [User: 309.4 ms, System: 28.1 ms]
        Range (min … max):   330.4 ms … 349.9 ms    10 runs
    
    Signed-off-by: Teng Long <dyroneteng@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    dyrone authored and gitster committed Jan 14, 2022
    Configuration menu
    Copy the full SHA
    45c4575 View commit details
    Browse the repository at this point in the history
  7. ls-tree.c: introduce struct "show_tree_data"

    "show_tree_data" is a struct that packages the necessary fields for
    "show_tree()". This commit is a pre-prepared commit for supporting
    "--format" option and it does not affect any existing functionality.
    
    Signed-off-by: Teng Long <dyroneteng@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    dyrone authored and gitster committed Jan 14, 2022
    Configuration menu
    Copy the full SHA
    799b5e1 View commit details
    Browse the repository at this point in the history
  8. cocci: allow padding with strbuf_addf()

    A convenient way to pad strings is to use something like
    `strbuf_addf(&buf, "%20s", "Hello, world!")`.
    
    However, the Coccinelle rule that forbids a format `"%s"` with a
    constant string argument cast too wide a net, and also forbade such
    padding.
    
    The original rule was introduced by commit:
    
        28c23cd (strbuf.cocci: suggest strbuf_addbuf() to add one strbuf to an other, 2019-01-25)
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    Signed-off-by: Teng Long <dyroneteng@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    dyrone authored and gitster committed Jan 14, 2022
    Configuration menu
    Copy the full SHA
    6601264 View commit details
    Browse the repository at this point in the history
  9. ls-tree.c: introduce "--format" option

    Add a --format option to ls-tree. It has an existing default output,
    and then --long and --name-only options to emit the default output
    along with the objectsize and, or to only emit object paths.
    
    Rather than add --type-only, --object-only etc. we can just support a
    --format using a strbuf_expand() similar to "for-each-ref
    --format". We might still add such options in the future for
    convenience.
    
    The --format implementation is slower than the existing code, but this
    change does not cause any performance regressions. We'll leave the
    existing show_tree() unchanged, and only run show_tree_fmt() in if
    a --format different than the hardcoded built-in ones corresponding to
    the existing modes is provided.
    
    I.e. something like the "--long" output would be much slower with
    this, mainly due to how we need to allocate various things to do with
    quote.c instead of spewing the output directly to stdout.
    
    The new option of '--format' comes from Ævar Arnfjörð Bjarmasonn's
    idea and suggestion, this commit makes modifications in terms of the
    original discussion on community [1].
    
    Here is the statistics about performance tests:
    
    1. Default format (hitten the builtin formats):
    
        "git ls-tree <tree-ish>" vs "--format='%(mode) %(type) %(object)%x09%(file)'"
    
        $hyperfine --warmup=10 "/opt/git/master/bin/git ls-tree -r HEAD"
        Benchmark 1: /opt/git/master/bin/git ls-tree -r HEAD
        Time (mean ± σ):     105.2 ms ±   3.3 ms    [User: 84.3 ms, System: 20.8 ms]
        Range (min … max):    99.2 ms … 113.2 ms    28 runs
    
        $hyperfine --warmup=10 "/opt/git/ls-tree-oid-only/bin/git ls-tree -r --format='%(mode) %(type) %(object)%x09%(file)'  HEAD"
        Benchmark 1: /opt/git/ls-tree-oid-only/bin/git ls-tree -r --format='%(mode) %(type) %(object)%x09%(file)'  HEAD
        Time (mean ± σ):     106.4 ms ±   2.7 ms    [User: 86.1 ms, System: 20.2 ms]
        Range (min … max):   100.2 ms … 110.5 ms    29 runs
    
    2. Default format includes object size (hitten the builtin formats):
    
        "git ls-tree -l <tree-ish>" vs "--format='%(mode) %(type) %(object) %(size:padded)%x09%(file)'"
    
        $hyperfine --warmup=10 "/opt/git/master/bin/git ls-tree -r -l HEAD"
        Benchmark 1: /opt/git/master/bin/git ls-tree -r -l HEAD
        Time (mean ± σ):     335.1 ms ±   6.5 ms    [User: 304.6 ms, System: 30.4 ms]
        Range (min … max):   327.5 ms … 348.4 ms    10 runs
    
        $hyperfine --warmup=10 "/opt/git/ls-tree-oid-only/bin/git ls-tree -r --format='%(mode) %(type) %(object) %(size:padded)%x09%(file)'  HEAD"
        Benchmark 1: /opt/git/ls-tree-oid-only/bin/git ls-tree -r --format='%(mode) %(type) %(object) %(size:padded)%x09%(file)'  HEAD
        Time (mean ± σ):     337.2 ms ±   8.2 ms    [User: 309.2 ms, System: 27.9 ms]
        Range (min … max):   328.8 ms … 349.4 ms    10 runs
    
    Links:
    	[1] https://public-inbox.org/git/RFC-patch-6.7-eac299f06ff-20211217T131635Z-avarab@gmail.com/
    
    Signed-off-by: Teng Long <dyroneteng@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    dyrone authored and gitster committed Jan 14, 2022
    Configuration menu
    Copy the full SHA
    d4c1fd2 View commit details
    Browse the repository at this point in the history

Commits on Jan 22, 2022

  1. clone, submodule: pass partial clone filters to submodules

    When cloning a repo with a --filter and with --recurse-submodules
    enabled, the partial clone filter only applies to
    the top-level repo. This can lead to unexpected bandwidth and disk
    usage for projects which include large submodules. For example, a user
    might wish to make a partial clone of Gerrit and would run:
    `git clone --recurse-submodules --filter=blob:5k
    https://gerrit.googlesource.com/gerrit`. However, only the superproject
    would be a partial clone; all the submodules would have all blobs
    downloaded regardless of their size. With this change, the same filter
    applies to submodules, meaning the expected bandwidth and disk savings
    apply consistently.
    
    Plumb the --filter argument from git-clone through git-submodule and
    git-submodule--helper, such that submodule clones also have the filter
    applied.
    
    This applies the same filter to the superproject and all submodules.
    Users who prefer the current behavior (i.e., a filter only on the
    superproject) would need to clone with `--no-recurse-submodules` and
    then manually initialize each submodule.
    
    Applying filters to submodules should be safe thanks to Jonathan Tan's
    recent work [1, 2, 3] eliminating the use of alternates as a method of
    accessing submodule objects, so any submodule object access now triggers
    a lazy fetch from the submodule's promisor remote if the accessed object
    is missing. This patch is an updated version of [4], which was created
    prior to Jonathan Tan's work.
    
    [1]: 8721e2e (Merge branch 'jt/partial-clone-submodule-1', 2021-07-16)
    [2]: 11e5d0a (Merge branch 'jt/grep-wo-submodule-odb-as-alternate',
    	2021-09-20)
    [3]: 162a13b (Merge branch 'jt/no-abuse-alternate-odb-for-submodules',
    	2021-10-25)
    [4]: https://lore.kernel.org/git/52bf9d45b8e2b72ff32aa773f2415bf7b2b86da2.1563322192.git.steadmon@google.com/
    
    Signed-off-by: Josh Steadmon <steadmon@google.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    steadmon authored and gitster committed Jan 22, 2022
    Configuration menu
    Copy the full SHA
    9e21083 View commit details
    Browse the repository at this point in the history

Commits on Jan 27, 2022

  1. grep.h: remove unused "regex_t regexp" from grep_opt

    This "regex_t" in grep_opt has not been used since
    f9b9faf (builtin-grep: allow more than one patterns., 2006-05-02),
    we still use a "regex_t" for compiling regexes, but that's in the
    "grep_pat" struct".
    
    Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    avar authored and gitster committed Jan 27, 2022
    Configuration menu
    Copy the full SHA
    52b5201 View commit details
    Browse the repository at this point in the history
  2. log tests: check if grep_config() is called by "log"-like cmds

    Extend the tests added in my 9df4676 (log: add exhaustive tests
    for pattern style options & config, 2017-05-20) to check not only
    whether "git log" handles "grep.patternType", but also "git show"
    etc.
    
    It's sufficient to check whether we match a "fixed" or a "basic" regex
    here to see if these codepaths correctly invoked grep_config(). We
    don't need to check the details of their regular expression matching
    as the "log" test does.
    
    Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    avar authored and gitster committed Jan 27, 2022
    Configuration menu
    Copy the full SHA
    36874cf View commit details
    Browse the repository at this point in the history
  3. grep tests: add missing "grep.patternType" config tests

    Extend the grep tests to assert that setting
    "grep.patternType=extended" followed by "grep.patternType=default"
    will behave as if "--basic-regexp" was provided, and not as
    "--extended-regexp". In a subsequent commit we'll need to treat
    "grep.patternType=default" as a special-case, but let's make sure we
    ignore it if it's being set to "default" following an earlier
    non-"default" "grep.patternType" setting.
    
    Let's also test what happens when we have a sequence of "extended"
    followed by "default" and "fixed". In that case the "fixed" should
    prevail, as well as tests to check that a "grep.extendedRegexp=true"
    followed by a "grep.extendedRegexp=false" behaves as though
    "grep.extendedRegexp" wasn't provided.
    
    Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    avar authored and gitster committed Jan 27, 2022
    Configuration menu
    Copy the full SHA
    5b439bc View commit details
    Browse the repository at this point in the history
  4. built-ins: trust the "prefix" from run_builtin()

    Change code in "builtin/grep.c" and "builtin/ls-tree.c" to trust the
    "prefix" passed from "run_builtin()". The "prefix" we get from setup.c
    is either going to be NULL or a string of length >0, never "".
    
    So we can drop the "prefix && *prefix" checks added for
    "builtin/grep.c" in 0d042fe (git-grep: show pathnames relative to
    the current directory, 2006-08-11), and for "builtin/ls-tree.c" in
    a69dd58 (ls-tree: chomp leading directories when run from a
    subdirectory, 2005-12-23).
    
    As seen in code in revision.c that was added in cd676a5 (diff
    --relative: output paths as relative to the current subdirectory,
    2008-02-12) we already have existing code that does away with this
    assertion.
    
    This makes it easier to reason about a subsequent change to the
    "prefix_length" code in grep.c in a subsequent commit, and since we're
    going to the trouble of doing that let's leave behind an assert() to
    promise this to any future callers.
    
    For "builtin/grep.c" it would be painful to pass the "prefix" down the
    callchain of:
    
        cmd_grep -> grep_tree -> grep_submodule -> grep_cache -> grep_oid ->
        grep_source_name
    
    So for the code that needs it in grep_source_name() let's add a
    "grep_prefix" variable similar to the existing "ls_tree_prefix".
    
    While at it let's move the code in cmd_ls_tree() around so that we
    assign to the "ls_tree_prefix" right after declaring the variables,
    and stop assigning to "prefix". We only subsequently used that
    variable later in the function after clobbering it. Let's just use our
    own "grep_prefix" instead.
    
    Let's also add an assert() in git.c, so that we'll make this promise
    about the "prefix" to any current and future callers, as well as to
    any readers of the code.
    
    Code history:
    
     * The strlen() in "grep.c" hasn't been used since 493b7a0 (grep:
       accept relative paths outside current working directory, 2009-09-05).
    
       When that code was added in 0d042fe (git-grep: show pathnames
       relative to the current directory, 2006-08-11) we used the length.
    
       But since 493b7a0 we haven't used it for anything except a
       boolean check that we could have done on the "prefix" member
       itself.
    
    Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    avar authored and gitster committed Jan 27, 2022
    Configuration menu
    Copy the full SHA
    6e58817 View commit details
    Browse the repository at this point in the history
  5. grep.c: don't pass along NULL callback value

    Change grep_cmd_config() to stop passing around the always-NULL "cb"
    value. When this code was added in 7e8f59d (grep: color patterns
    in output, 2009-03-07) it was non-NULL, but when that changed in
    15fabd1 (builtin/grep.c: make configuration callback more
    reusable, 2012-10-09) this code was left behind.
    
    In a subsequent change I'll start using the "cb" value, this will make
    it clear which functions we call need it, and which don't.
    
    Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    avar authored and gitster committed Jan 27, 2022
    Configuration menu
    Copy the full SHA
    1996304 View commit details
    Browse the repository at this point in the history
  6. grep API: call grep_config() after grep_init()

    The grep_init() function used the odd pattern of initializing the
    passed-in "struct grep_opt" with a statically defined "grep_defaults"
    struct, which would be modified in-place when we invoked
    grep_config().
    
    So we effectively (b) initialized config, (a) then defaults, (c)
    followed by user options. Usually those are ordered as "a", "b" and
    "c" instead.
    
    As the comments being removed here show the previous behavior needed
    to be carefully explained as we'd potentially share the populated
    configuration among different instances of grep_init(). In practice we
    didn't do that, but now that it can't be a concern anymore let's
    remove those comments.
    
    This does not change the behavior of any of the configuration
    variables or options. That would have been the case if we didn't move
    around the grep_config() call in "builtin/log.c". But now that we call
    "grep_config" after "git_log_config" and "git_format_config" we'll
    need to pass in the already initialized "struct grep_opt *".
    
    See 6ba9bb7 (grep: copy struct in one fell swoop, 2020-11-29) and
    7687a05 (grep: move the configuration parsing logic to grep.[ch],
    2012-10-09) for the commits that added the comments.
    
    The memcpy() pattern here will be optimized away and follows the
    convention of other *_init() functions. See 5726a6b (*.c *_init():
    define in terms of corresponding *_INIT macro, 2021-07-01).
    
    Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    avar authored and gitster committed Jan 27, 2022
    Configuration menu
    Copy the full SHA
    3573b8d View commit details
    Browse the repository at this point in the history
  7. grep.h: make "grep_opt.pattern_type_option" use its enum

    Change the "pattern_type_option" member of "struct grep_opt" to use
    the enum type we use for it.
    
    Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    avar authored and gitster committed Jan 27, 2022
    Configuration menu
    Copy the full SHA
    d2b419d View commit details
    Browse the repository at this point in the history
  8. grep.c: do "if (bool && memchr())" not "if (memchr() && bool)"

    Change code in compile_regexp() to check the cheaper boolean
    "!opt->pcre2" condition before the "memchr()" search.
    
    This doesn't noticeably optimize anything, but makes the code more
    obvious and conventional. The line wrapping being added here also
    makes a subsequent commit smaller.
    
    Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    avar authored and gitster committed Jan 27, 2022
    Configuration menu
    Copy the full SHA
    947435d View commit details
    Browse the repository at this point in the history
  9. grep: simplify config parsing and option parsing

    Simplify the parsing of "grep.patternType" and
    "grep.extendedRegexp". This changes no behavior, but gets rid of
    complex parsing logic that isn't needed anymore.
    
    When "grep.patternType" was introduced in 84befcd (grep: add a
    grep.patternType configuration setting, 2012-08-03) we promised that:
    
     1. You can set "grep.patternType", and "[setting it to] 'default'
        will return to the default matching behavior".
    
        In that context "the default" meant whatever the configuration
        system specified before that change, i.e. via grep.extendedRegexp.
    
     2. We'd support the existing "grep.extendedRegexp" option, but ignore
        it when the new "grep.patternType" option is set. We said we'd
        only ignore the older "grep.extendedRegexp" option "when the
        `grep.patternType` option is set to a value other than
        'default'".
    
    In a preceding commit we changed grep_config() to be called after
    grep_init(), which means that much of the complexity here can go
    away.
    
    As before both "grep.patternType" and "grep.extendedRegexp" are
    last-one-wins variable, with "grep.extendedRegexp" yielding to
    "grep.patternType", except when "grep.patternType=default".
    
    Note that this applies as we parse the config, i.e. a sequence of:
    
        -c grep.patternType=perl
        -c grep.extendedRegexp=true \
        -c grep.patternType=default
    
    should select ERE due to "grep.extendedRegexp=true and
    grep.patternType=default". We can determine this as we parse the
    config, because:
    
     * If we see "grep.extendedRegexp" we set "extended_regexp_option" to
       its boolean value.
    
     * If we see "grep.extendedRegexp" but
       "grep.patternType=[default|<unset>]" is in effect we *don't* set
       the internal "pattern_type_option" to update the pattern type.
    
     * If we see "grep.patternType!=default" we can set our internal
       "pattern_type_option" directly, it doesn't matter what the state of
       "extended_regexp_option" is, but we don't forget what it was, in
       case we see a "grep.patternType=default" again.
    
     * If we see a "grep.patternType=default" we can set the pattern to
       ERE or BRE depending on whether we last saw a
       "grep.extendedRegexp=true" or
       "grep.extendedRegexp=[false|<unset>]".
    
    With this change the "extended_regexp_option" member is only used
    within grep_config(), and in the current codebase we could equally
    track it as a "static" variable within that function, see [1] for a
    version for this patch that did that. We're keeping it a struct member
    to make that function reentrant, in case it ends up mattering in the
    future.
    
    The command-line parsing in cmd_grep() can then completely ignore
    "grep.extendedRegexp". Whatever effect it had before that step won't
    matter if we see -G, -E, -P etc.
    
    See my 07a3d41 (grep: remove regflags from the public grep_opt
    API, 2017-06-29) for addition of the two comments being removed here,
    i.e. the complexity noted in that commit is now going away.
    
    1. https://lore.kernel.org/git/patch-v8-09.10-c211bb0c69d-20220118T155211Z-avarab@gmail.com/
    
    Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    avar authored and gitster committed Jan 27, 2022
    Configuration menu
    Copy the full SHA
    0e54b0d View commit details
    Browse the repository at this point in the history
  10. SQUASH???

    gitster committed Jan 27, 2022
    Configuration menu
    Copy the full SHA
    72dfa29 View commit details
    Browse the repository at this point in the history

Commits on Jan 28, 2022

  1. receive-pack: check if client is alive before completing the push

    Abort the push operation (i.e. do not migrate the objects from temporary
    to permanent storage) if the client has disconnected while the
    pre-receive hook was running.
    
    This reduces the risk of inconsistencies on network errors or if the
    user hits ctrl-c while the pre-receive hook is running.
    
    Send a keepalive packet (empty) on sideband 2 (the one to report
    progress). If the client has exited the write() operation should fail
    and the push will be aborted. This only works when sideband*
    capabilities are advertised by the client.
    
    Note: if the write() operation fails, receive-pack will likely be killed
    via SIGPIPE and even so, since the client is likely gone already, the
    error strings will go nowhere. I only added them for code consistency.
    
    Signed-off-by: Robin Jarry <robin.jarry@6wind.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    rjarry authored and gitster committed Jan 28, 2022
    Configuration menu
    Copy the full SHA
    d77c4bb View commit details
    Browse the repository at this point in the history

Commits on Jan 31, 2022

  1. Documentation: add extensions.worktreeConfig details

    The extensions.worktreeConfig extension was added in 58b284a (worktree:
    add per-worktree config files, 2018-10-21) and was somewhat documented
    in Documentation/git-config.txt. However, the extensions.worktreeConfig
    value was not specified further in the list of possible config keys. The
    location of the config.worktree file is not specified, and there are
    some precautions that should be mentioned clearly, but are only
    mentioned in git-worktree.txt.
    
    Expand the documentation to help users discover the complexities of
    extensions.worktreeConfig by adding details and cross links in these
    locations (relative to Documentation/):
    
    - config/extensions.txt
    - git-config.txt
    - git-worktree.txt
    
    The updates focus on items such as
    
    * $GIT_DIR/config.worktree takes precedence over $GIT_COMMON_DIR/config.
    
    * The core.worktree and core.bare=true settings are incorrect to have in
      the common config file when extensions.worktreeConfig is enabled.
    
    * The sparse-checkout settings core.sparseCheckout[Cone] are recommended
      to be set in the worktree config.
    
    As documented in 1166419 ("Revert "check_repository_format_gently():
    refuse extensions for old repositories"", 2020-07-15), this extension
    must be considered regardless of the repository format version for
    historical reasons.
    
    A future change will update references to extensions.worktreeConfig
    within git-sparse-checkout.txt, but a behavior change is needed before
    making those updates.
    
    Helped-by: Elijah Newren <newren@gmail.com>
    Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
    Reviewed-by: Elijah Newren <newren@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    derrickstolee authored and gitster committed Jan 31, 2022
    Configuration menu
    Copy the full SHA
    5ba4c12 View commit details
    Browse the repository at this point in the history
  2. worktree: create init_worktree_config()

    Upgrading a repository to use extensions.worktreeConfig is non-trivial.
    There are several steps involved, including moving some config settings
    from the common config file to the main worktree's config.worktree file.
    The previous change updated the documentation with all of these details.
    
    Commands such as 'git sparse-checkout set' upgrade the repository to use
    extensions.worktreeConfig without following these steps, causing some
    user pain in some special cases.
    
    Create a helper method, init_worktree_config(), that will be used in a
    later change to fix this behavior within 'git sparse-checkout set'. The
    method is carefully documented in worktree.h.
    
    Note that we do _not_ upgrade the repository format version to 1 during
    this process. The worktree config extension must be considered by Git
    and third-party tools even if core.repositoryFormatVersion is 0 for
    historical reasons documented in 1166419 ("Revert
    "check_repository_format_gently(): refuse extensions for old
    repositories"", 2020-07-15). This is a special case for this extension,
    and newer extensions (such as extensions.objectFormat) still need to
    upgrade the repository format version.
    
    Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
    Reviewed-by: Elijah Newren <newren@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    derrickstolee authored and gitster committed Jan 31, 2022
    Configuration menu
    Copy the full SHA
    c702a06 View commit details
    Browse the repository at this point in the history
  3. config: add repo_config_set_worktree_gently()

    Some config settings, such as those for sparse-checkout, are likely
    intended to only apply to one worktree at a time. To make this write
    easier, add a new config API method, repo_config_set_worktree_gently().
    
    This method will attempt to write to the worktree-specific config, but
    will instead write to the common config file if worktree config is not
    enabled.  The next change will introduce a consumer of this method.
    
    Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
    Reviewed-by: Elijah Newren <newren@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    derrickstolee authored and gitster committed Jan 31, 2022
    Configuration menu
    Copy the full SHA
    43e0ef6 View commit details
    Browse the repository at this point in the history
  4. sparse-checkout: set worktree-config correctly

    The previous change added repo_config_set_worktree_gently() to assist
    writing config values into the config.worktree file, if enabled. An
    earlier change added init_worktree_config() as a helper to initialize
    extensions.worktreeConfig if not already enabled.
    
    Let the sparse-checkout builtin use these helpers instead of attempting to
    initialize the worktree config on its own. This changes behavior of 'git
    sparse-checkout set' in a few important ways:
    
     1. Git will no longer upgrade the repository format, since this is not
        a requirement for understanding extensions.worktreeConfig.
    
     2. If the main worktree is bare, then this command will not put the
        worktree in a broken state.
    
    The main reason to use worktree-specific config for the sparse-checkout
    builtin was to avoid enabling sparse-checkout patterns in one and
    causing a loss of files in another. If a worktree does not have a
    sparse-checkout patterns file, then the sparse-checkout logic will not
    kick in on that worktree.
    
    Reported-by: Sean Allred <allred.sean@gmail.com>
    Helped-by: Eric Sunshine <sunshine@sunshineco.com>
    Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
    Reviewed-by: Elijah Newren <newren@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    derrickstolee authored and gitster committed Jan 31, 2022
    Configuration menu
    Copy the full SHA
    bc169c7 View commit details
    Browse the repository at this point in the history
  5. worktree: copy sparse-checkout patterns and config on add

    When adding a new worktree, it is reasonable to expect that we want to
    use the current set of sparse-checkout settings for that new worktree.
    This is particularly important for repositories where the worktree would
    become too large to be useful. This is even more important when using
    partial clone as well, since we want to avoid downloading the missing
    blobs for files that should not be written to the new worktree.
    
    The only way to create such a worktree without this intermediate step of
    expanding the full worktree is to copy the sparse-checkout patterns and
    config settings during 'git worktree add'. Each worktree has its own
    sparse-checkout patterns, and the default behavior when the
    sparse-checkout file is missing is to include all paths at HEAD. Thus,
    we need to have patterns from somewhere, they might as well be the
    current worktree's patterns. These are then modified independently in
    the future.
    
    In addition to the sparse-checkout file, copy the worktree config file
    if worktree config is enabled and the file exists. This will copy over
    any important settings to ensure the new worktree behaves the same as
    the current one. The only exception we must continue to make is that
    core.bare and core.worktree should become unset in the worktree's config
    file.
    
    Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
    Reviewed-by: Elijah Newren <newren@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    derrickstolee authored and gitster committed Jan 31, 2022
    Configuration menu
    Copy the full SHA
    2b5fcef View commit details
    Browse the repository at this point in the history
  6. i18n: factorize more 'incompatible options' messages

    Find more incompatible options to factorize.
    
    When more than two options are mutually exclusive, print the ones
    which are actually on the command line.
    
    Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    jnavila authored and gitster committed Jan 31, 2022
    Configuration menu
    Copy the full SHA
    380e9a3 View commit details
    Browse the repository at this point in the history
  7. SQUASH???

    gitster committed Jan 31, 2022
    Configuration menu
    Copy the full SHA
    471920e View commit details
    Browse the repository at this point in the history
  8. i18n: factorize "invalid value" messages

    Use the same message when an invalid value is passed to a command line
    option or a configuration variable.
    
    Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    jnavila authored and gitster committed Jan 31, 2022
    Configuration menu
    Copy the full SHA
    8196df3 View commit details
    Browse the repository at this point in the history
  9. i18n: remove from i18n strings that do not hold translatable parts

    Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    jnavila authored and gitster committed Jan 31, 2022
    Configuration menu
    Copy the full SHA
    2c45d31 View commit details
    Browse the repository at this point in the history
  10. i18n: fix some misformated placeholders in command synopsis

     * add '<>' around arguments where missing
     * convert plurals into '...' forms
    
    This applies the style guide for documentation.
    
    Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
    Reviewed-by: Phillip Wood <phillip.wood123@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    jnavila authored and gitster committed Jan 31, 2022
    Configuration menu
    Copy the full SHA
    758e8a2 View commit details
    Browse the repository at this point in the history

Commits on Feb 1, 2022

  1. object-file.c: split up declaration of unrelated variables

    Split up the declaration of the "ret" and "re_allocated"
    variables. It's not our usual style to group variable declarations
    simply because they share a type, we'd only prefer to do so when the
    two are closely related (e.g. "int i, j"). This change makes a
    subsequent and meaningful change's diff smaller.
    
    Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    avar authored and gitster committed Feb 1, 2022
    Configuration menu
    Copy the full SHA
    1ed500c View commit details
    Browse the repository at this point in the history
  2. object-file API: return "void", not "int" from hash_object_file()

    The hash_object_file() function added in abdc3fc (Add
    hash_sha1_file(), 2006-10-14) did not have a meaningful return value,
    and it never has.
    
    One was seemingly added to avoid adding braces to the "ret = "
    assignments being modified here. Let's instead assign "0" to the "ret"
    variables at the beginning of the relevant functions, and have them
    return "void".
    
    Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    avar authored and gitster committed Feb 1, 2022
    Configuration menu
    Copy the full SHA
    6d146b4 View commit details
    Browse the repository at this point in the history
  3. object-file API: add a format_object_header() function

    Add a convenience function to wrap the xsnprintf() command that
    generates loose object headers. This code was copy/pasted in various
    parts of the codebase, let's define it in one place and re-use it from
    there.
    
    All except one caller of it had a valid "enum object_type" for us,
    it's only write_object_file_prepare() which might need to deal with
    "git hash-object --literally" and a potential garbage type. Let's have
    the primary API use an "enum object_type", and define a *_literally()
    function that can take an arbitrary "const char *" for the type.
    
    See [1] for the discussion that prompted this patch, i.e. new code in
    object-file.c that wanted to copy/paste the xsnprintf() invocation.
    
    In the case of fast-import.c the callers unfortunately need to cast
    back & forth between "unsigned char *" and "char *", since
    format_object_header() ad encode_in_pack_object_header() take
    different signedness.
    
    1. https://lore.kernel.org/git/211213.86bl1l9bfz.gmgdl@evledraar.gmail.com/
    
    Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    avar authored and gitster committed Feb 1, 2022
    Configuration menu
    Copy the full SHA
    94ab7d4 View commit details
    Browse the repository at this point in the history
  4. object-file API: have write_object_file() take "enum object_type"

    Change the write_object_file() function to take an "enum object_type"
    instead of a "const char *type". Its callers either passed
    {commit,tree,blob,tag}_type and can pass the corresponding OBJ_* type
    instead, or were hardcoding strings like "blob".
    
    This avoids the back & forth fragility where the callers of
    write_object_file() would have the enum type, and convert it
    themselves via type_name(). We do have to now do that conversion
    ourselves before calling write_object_file_prepare(), but those
    codepaths will be similarly adjusted in subsequent commits.
    
    Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    avar authored and gitster committed Feb 1, 2022
    Configuration menu
    Copy the full SHA
    f540dce View commit details
    Browse the repository at this point in the history
  5. object-file API: provide a hash_object_file_oideq()

    Provide a new hash_object_file_oideq() for those callers of
    check_object_signature() that don't care about its streaming
    interface. I.e. at the start of that function we do:
    
    	if (map) {
    		hash_object_file(r->hash_algo, map, size, type, real_oid);
    		return !oideq(oid, real_oid) ? -1 : 0;
    	}
    
    These callers always provide a "map" (or "buf[fer]"). Let's have them
    call this simpler hash_object_file_oideq() function instead.
    
    None of them use a non-NULL "real_oid" argument, but let's provide it
    like check_object_signature() did. This'll make it easy to have these
    emit better error messages in the future as was done in
    96e41f5 (fsck: report invalid object type-path combinations,
    2021-10-01), i.e. the die() calls here can emit not only the OID we
    expected, but also what we got.
    
    Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    avar authored and gitster committed Feb 1, 2022
    Configuration menu
    Copy the full SHA
    4593f34 View commit details
    Browse the repository at this point in the history
  6. object-file API: replace some use of check_object_signature()

    Add a "hash_object_file_literally()" function to go with the existing
    "hash_object_file()" function. This is currently a wrapper for its
    sibling, but this change will allow us to change it to take an "enum
    object_type" in a subsequent commit.
    
    The only caller that wanted to pass a custom type to
    "check_object_signature()" was the "git fsck" via its
    "read_loose_object()", which is being changed here.
    
    There was an existing hash_object_file_literally() which I'm renaming
    to "hash_write_object_file_literally()", that function is only used
    for "hash-object --literally". That renaming is being done because it
    would be confusing to have a "hash_object_file_literally()" and a
    "hash_object_file()" that do very different things.
    
    Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    avar authored and gitster committed Feb 1, 2022
    Configuration menu
    Copy the full SHA
    4db518b View commit details
    Browse the repository at this point in the history
  7. object-file API: have hash_object_file() take "enum object_type"

    Change the hash_object_file() function to take an "enum
    object_type".
    
    Almost all of its callers were passing either
    "{commit,tree,blob,tag}_type", or the result of a call to
    type_name(). Let's instead benefit from type checking and use the enum
    directly.
    
    "Almost" because one caller here will now pass OBJ_BAD. The previous
    "NULL" value was not used, as "check_object_signature()" will never
    use its "type" argument when given a NULL "map" argument, which that
    caller in "parse_object()" also does. We'll deal with it in a
    subsequent commit, but for now it'll pass an "OBJ_BAD" placeholder.
    
    Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    avar authored and gitster committed Feb 1, 2022
    Configuration menu
    Copy the full SHA
    1563068 View commit details
    Browse the repository at this point in the history
  8. object-file API: replace check_object_signature() with stream_*

    Change the task of the the check_object_signature() function so that
    it no longer confusingly does two unrelated things.
    
    Now the "!map" branch of it is exposed as a renamed
    stream_object_signature(). In preceding commits we migrated all of the
    "if (map)" callers over to "hash_object_file_oideq()" or
    "hash_object_file_literally()" followed by "!oideq(...)".
    
    This makes the caller in parse_object() less confusing, as we'll now
    no longer need to pass NULL for "map" and "OBJ_BAD" for the unused
    "type" argument. The "verify_packfile()" caller is arguably a bit
    worse off than before, but as we're only using this function in a
    couple of places now a bit more verbosity there is acceptable.
    
    Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    avar authored and gitster committed Feb 1, 2022
    Configuration menu
    Copy the full SHA
    8ddbcf3 View commit details
    Browse the repository at this point in the history
  9. object-file.c: add a literal version of write_object_file_prepare()

    Split off a *_literally() variant of the write_object_file_prepare()
    function. To do this create a new "hash_object_body()" static helper.
    
    We now defer the type_name() call until the very last moment in
    format_object_header() for those callers that aren't "hash-object
    --literally".
    
    Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    avar authored and gitster committed Feb 1, 2022
    Configuration menu
    Copy the full SHA
    799be44 View commit details
    Browse the repository at this point in the history
  10. object-file API: pass an enum to read_object_with_reference()

    Change the read_object_with_reference() function to take an "enum
    object_type". It was not prepared to handle an arbitrary "const
    char *type", as it was itself calling type_from_string().
    
    Let's change the only caller that passes in user data to use
    type_from_string(), and convert the rest to use e.g. "OBJ_TREE"
    instead of "tree_type".
    
    The "cat-file" caller is not on the codepath that
    handles"--allow-unknown", so the type_from_string() there is safe. Its
    use of type_from_string() doesn't functionally differ from that of the
    pre-image.
    
    Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    avar authored and gitster committed Feb 1, 2022
    Configuration menu
    Copy the full SHA
    54c7ff5 View commit details
    Browse the repository at this point in the history
  11. branch: add --recurse-submodules option for branch creation

    To improve the submodules UX, we would like to teach Git to handle
    branches in submodules. Start this process by teaching "git branch" the
    --recurse-submodules option so that "git branch --recurse-submodules
    topic" will create the `topic` branch in the superproject and its
    submodules.
    
    Although this commit does not introduce breaking changes, it does not
    work well with existing --recurse-submodules commands because "git
    branch --recurse-submodules" writes to the submodule ref store, but most
    commands only consider the superproject gitlink and ignore the submodule
    ref store. For example, "git checkout --recurse-submodules" will check
    out the commits in the superproject gitlinks (and put the submodules in
    detached HEAD) instead of checking out the submodule branches.
    
    Because of this, this commit introduces a new configuration value,
    `submodule.propagateBranches`. The plan is for Git commands to
    prioritize submodule ref store information over superproject gitlinks if
    this value is true. Because "git branch --recurse-submodules" writes to
    submodule ref stores, for the sake of clarity, it will not function
    unless this configuration value is set.
    
    This commit also includes changes that support working with submodules
    from a superproject commit because "branch --recurse-submodules" (and
    future commands) need to read .gitmodules and gitlinks from the
    superproject commit, but submodules are typically read from the
    filesystem's .gitmodules and the index's gitlinks. These changes are:
    
    * add a submodules_of_tree() helper that gives the relevant
      information of an in-tree submodule (e.g. path and oid) and
      initializes the repository
    * add is_tree_submodule_active() by adding a treeish_name parameter to
      is_submodule_active()
    * add the "submoduleNotUpdated" advice to advise users to update the
      submodules in their trees
    
    Incidentally, fix an incorrect usage string that combined the 'list'
    usage of git branch (-l) with the 'create' usage; this string has been
    incorrect since its inception, a8dfd5e (Make builtin-branch.c use
    parse_options., 2007-10-07).
    
    Helped-by: Jonathan Tan <jonathantanmy@google.com>
    Signed-off-by: Glen Choo <chooglen@google.com>
    Reviewed-by: Jonathan Tan <jonathantanmy@google.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    chooglen authored and gitster committed Feb 1, 2022
    Configuration menu
    Copy the full SHA
    ab7bdda View commit details
    Browse the repository at this point in the history
  12. branch.c: use 'goto cleanup' in setup_tracking() to fix memory leaks

    Signed-off-by: Glen Choo <chooglen@google.com>
    Reviewed-by: Jonathan Tan <jonathantanmy@google.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    chooglen authored and gitster committed Feb 1, 2022
    Configuration menu
    Copy the full SHA
    847e0ed View commit details
    Browse the repository at this point in the history

Commits on Feb 2, 2022

  1. Merge branch 'en/remerge-diff' into en/merge-trees

    * en/remerge-diff:
      diff-merges: avoid history simplifications when diffing merges
      merge-ort: mark conflict/warning messages from inner merges as omittable
      show, log: include conflict/warning messages in --remerge-diff headers
      diff: add ability to insert additional headers for paths
      merge-ort: format messages slightly different for use in headers
      merge-ort: mark a few more conflict messages as omittable
      merge-ort: capture and print ll-merge warnings in our preferred fashion
      ll-merge: make callers responsible for showing warnings
      log: clean unneeded objects during `log --remerge-diff`
      show, log: provide a --remerge-diff capability
    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    52b4a07 View commit details
    Browse the repository at this point in the history
  2. merge-tree: rename merge_trees() to trivial_merge_trees()

    merge-recursive.h defined its own merge_trees() function, different than
    the one found in builtin/merge-tree.c.  That was okay in the past, but
    we want merge-tree to be able to use the merge-ort functions, which will
    end up including merge-recursive.h.  Rename the function found in
    builtin/merge-tree.c to avoid the conflict.
    
    Signed-off-by: Elijah Newren <newren@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    newren authored and gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    d53e4dc View commit details
    Browse the repository at this point in the history
  3. merge-tree: move logic for existing merge into new function

    In preparation for adding a non-trivial merge capability to merge-tree,
    move the existing merge logic for trivial merges into a new function.
    
    Signed-off-by: Elijah Newren <newren@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    newren authored and gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    8b8b776 View commit details
    Browse the repository at this point in the history
  4. merge-tree: add option parsing and initial shell for real merge function

    Let merge-tree accept a `--write-tree` parameter for choosing real
    merges instead of trivial merges, and accept an optional
    `--trivial-merge` option to get the traditional behavior.  Note that
    these accept different numbers of arguments, though, so these names
    need not actually be used.
    
    Note that real merges differ from trivial merges in that they handle:
      - three way content merges
      - recursive ancestor consolidation
      - renames
      - proper directory/file conflict handling
      - etc.
    Basically all the stuff you'd expect from `git merge`, just without
    updating the index and working tree.  The initial shell added here does
    nothing more than die with "real merges are not yet implemented", but
    that will be fixed in subsequent commits.
    
    Signed-off-by: Elijah Newren <newren@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    newren authored and gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    26634d4 View commit details
    Browse the repository at this point in the history
  5. merge-tree: implement real merges

    This adds the ability to perform real merges rather than just trivial
    merges (meaning handling three way content merges, recursive ancestor
    consolidation, renames, proper directory/file conflict handling, and so
    forth).  However, unlike `git merge`, the working tree and index are
    left alone and no branch is updated.
    
    The only output is:
      - the toplevel resulting tree printed on stdout
      - exit status of 0 (clean), 1 (conflicts present), anything else
        (merge could not be performed; unknown if clean or conflicted)
    
    This output is meant to be used by some higher level script, perhaps in
    a sequence of steps like this:
    
       NEWTREE=$(git merge-tree --write-tree $BRANCH1 $BRANCH2)
       test $? -eq 0 || die "There were conflicts..."
       NEWCOMMIT=$(git commit-tree $NEWTREE -p $BRANCH1 -p $BRANCH2)
       git update-ref $BRANCH1 $NEWCOMMIT
    
    Note that higher level scripts may also want to access the
    conflict/warning messages normally output during a merge, or have quick
    access to a list of files with conflicts.  That is not available in this
    preliminary implementation, but subsequent commits will add that
    ability.
    
    This also marks the traditional trivial merge of merge-tree as
    deprecated.  The trivial merge not only had limited applicability, the
    output format was also difficult to work with (and its format
    undocumented), and will generally be less performant than real merges.
    
    Signed-off-by: Elijah Newren <newren@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    newren authored and gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    b22e7bb View commit details
    Browse the repository at this point in the history
  6. Introduce a variant of the warning() function that takes a FILE *

    We are about to teach `diff_warn_rename_limit()` to write into a file
    instead of `stderr`. That function wants to call `warning()` when
    writing to `stderr`, though, allowing for the `warn_routine` to be
    overridden.
    
    Let's introduce a helper for that.
    
    Note: Since there is currently no need to provide similar functions for
    `error()` or `die()`, let alone for the `_errno` variants, we will leave
    that to a date when the need for those should arise, if ever.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    Signed-off-by: Elijah Newren <newren@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    dscho authored and gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    de0c743 View commit details
    Browse the repository at this point in the history
  7. diff: allow diff_warn_rename_limit to write somewhere besides stderr

    diff_warn_rename_limit() is hardcoded to write to stderr.  Make it
    accept a file stream parameter to make it more flexible.
    
    Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
    Signed-off-by: Elijah Newren <newren@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    dscho authored and gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    11c5ce2 View commit details
    Browse the repository at this point in the history
  8. merge-ort: split out a separate display_update_messages() function

    This patch includes no new code; it simply moves a bunch of lines into a
    new function.  As such, there are no functional changes.  This is just a
    preparatory step to allow the printed messages to be handled differently
    by other callers, such as in `git merge-tree --write-tree`.
    
    (Patch best viewed with
         --color-moved --color-moved-ws=allow-indentation-change
     to see that it is a simple code movement.)
    
    Signed-off-by: Elijah Newren <newren@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    newren authored and gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    10b930d View commit details
    Browse the repository at this point in the history
  9. merge-ort: allow update messages to be written to different file stream

    This modifies the new display_update_messages() function to allow
    printing to somewhere other than stdout.  It also consolidates the
    location of the diff_warn_rename_limit() message with the rest of the
    CONFLICT and other update messages to all go to the same stream.
    
    Signed-off-by: Elijah Newren <newren@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    newren authored and gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    e93cb88 View commit details
    Browse the repository at this point in the history
  10. merge-tree: support including merge messages in output

    When running `git merge-tree --write-tree`, we previously would only
    return an exit status reflecting the cleanness of a merge, and print out
    the toplevel tree of the resulting merge.  Merges also have
    informational messages, such as:
      * "Auto-merging <PATH>"
      * "CONFLICT (content): ..."
      * "CONFLICT (file/directory)"
      * etc.
    In fact, when non-content conflicts occur (such as file/directory,
    modify/delete, add/add with differing modes, rename/rename (1to2),
    etc.), these informational messages may be the only notification the
    user gets since these conflicts are not representable in the contents
    of the file.
    
    Add a --[no-]messages option so that callers can request these messages
    be included at the end of the output.  Include such messages by default
    when there are conflicts, and omit them by default when the merge is
    clean.
    
    Signed-off-by: Elijah Newren <newren@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    newren authored and gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    ea09a08 View commit details
    Browse the repository at this point in the history
  11. merge-ort: provide a merge_get_conflicted_files() helper function

    After a merge, this function allows the user to extract the same
    information that would be printed by `ls-files -u`, which means
    files with their mode, oid, and stage.
    
    Signed-off-by: Elijah Newren <newren@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    newren authored and gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    46d1456 View commit details
    Browse the repository at this point in the history
  12. merge-tree: provide a list of which files have conflicts

    Callers of `git merge-tree --write-tree` will often want to know which
    files had conflicts.  While they could potentially attempt to parse the
    CONFLICT notices printed, those messages are not meant to be machine
    readable.  Provide a simpler mechanism of just printing the files (in
    the same format as `git ls-files` with quoting, but restricted to
    unmerged files) in the output before the free-form messages.
    
    Signed-off-by: Elijah Newren <newren@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    newren authored and gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    ed6b436 View commit details
    Browse the repository at this point in the history
  13. merge-tree: provide easy access to ls-files -u style info

    Much like `git merge` updates the index with information of the form
        (mode, oid, stage, name)
    provide this output for conflicted files for merge-tree as well.
    Provide an --exclude-modes-oids-stages/-l option for users to exclude
    the mode, oid, and stage and only get the list of conflicted filenames.
    
    Signed-off-by: Elijah Newren <newren@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    newren authored and gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    c048a4b View commit details
    Browse the repository at this point in the history
  14. merge-tree: allow ls-files -u style info to be NUL terminated

    Much as `git ls-files` has a -z option, let's add one to merge-tree so
    that the conflict-info section can be NUL terminated (and avoid quoting
    of unusual filenames).
    
    Signed-off-by: Elijah Newren <newren@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    newren authored and gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    bf8f5f5 View commit details
    Browse the repository at this point in the history
  15. merge-tree: add a --allow-unrelated-histories flag

    Folks may want to merge histories that have no common ancestry; provide
    a flag with the same name as used by `git merge` to allow this.
    
    Signed-off-by: Elijah Newren <newren@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    newren authored and gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    dca8a41 View commit details
    Browse the repository at this point in the history
  16. git-merge-tree.txt: add a section on potentional usage mistakes

    Signed-off-by: Elijah Newren <newren@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    newren authored and gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    bc113d9 View commit details
    Browse the repository at this point in the history
  17. Merge branch 'js/test-unset-trace2-parents' into jch

    Avoid tests that are run under GIT_TRACE2 set from failing
    unnecessarily.
    
    * js/test-unset-trace2-parents:
      test-lib: unset trace2 parent envvars
    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    1010ec7 View commit details
    Browse the repository at this point in the history
  18. Merge branch 'pb/pull-rebase-autostash-fix' into jch

    "git pull --rebase" ignored the rebase.autostash configuration
    variable when the remote history is a descendant of our history,
    which has been corrected.
    
    * pb/pull-rebase-autostash-fix:
      pull --rebase: honor rebase.autostash when fast-forwarding
    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    ed7299c View commit details
    Browse the repository at this point in the history
  19. Merge branch 'jc/find-header' into jch

    Code clean-up.
    
    * jc/find-header:
      receive-pack.c: consolidate find header logic
    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    7525c77 View commit details
    Browse the repository at this point in the history
  20. Merge branch 'jh/p4-fix-use-of-process-error-exception' into jch

    * jh/p4-fix-use-of-process-error-exception:
      git-p4: fix instantiation of CalledProcessError
    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    f8e397d View commit details
    Browse the repository at this point in the history
  21. Merge branch 'jh/p4-spawning-external-commands-cleanup' into jch

    * jh/p4-spawning-external-commands-cleanup:
      git-p4: don't print shell commands as python lists
      git-p4: pass command arguments as lists instead of using shell
      git-p4: don't select shell mode using the type of the command argument
    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    5223314 View commit details
    Browse the repository at this point in the history
  22. Merge branch 'rs/grep-expr-cleanup' into jch

    Code clean-up.
    
    * rs/grep-expr-cleanup:
      grep: use grep_and_expr() in compile_pattern_and()
      grep: extract grep_binexp() from grep_or_expr()
      grep: use grep_not_expr() in compile_pattern_not()
      grep: use grep_or_expr() in compile_pattern_or()
    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    6592911 View commit details
    Browse the repository at this point in the history
  23. Merge branch 'rs/apply-symlinks-use-strset' into jch

    "git apply" (ab)used the util pointer of the string-list to keep
    track of how each symbolic link needs to be handled, which has been
    simplified by using strset.
    
    * rs/apply-symlinks-use-strset:
      apply: use strsets to track symlinks
    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    e65474e View commit details
    Browse the repository at this point in the history
  24. Merge branch 'jc/qsort-s-alignment-fix' into jch

    Fix a hand-rolled alloca() imitation that may have violated
    alignment requirement of data being sorted in compatibility
    implementation of qsort_s() and stable qsort().
    
    * jc/qsort-s-alignment-fix:
      stable-qsort: avoid using potentially unaligned access
      compat/qsort_s.c: avoid using potentially unaligned access
    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    232d48e View commit details
    Browse the repository at this point in the history
  25. Merge branch 'ab/cat-file' into jch

    Assorted updates to "git cat-file", especially "-h".
    
    * ab/cat-file:
      cat-file: s/_/-/ in typo'd usage_msg_optf() message
      cat-file: don't whitespace-pad "(...)" in SYNOPSIS and usage output
      cat-file: use GET_OID_ONLY_TO_DIE in --(textconv|filters)
      object-name.c: don't have GET_OID_ONLY_TO_DIE imply *_QUIETLY
      cat-file: correct and improve usage information
      cat-file: fix remaining usage bugs
      cat-file: make --batch-all-objects a CMDMODE
      cat-file: move "usage" variable to cmd_cat_file()
      cat-file docs: fix SYNOPSIS and "-h" output
      parse-options API: add a usage_msg_optf()
      cat-file tests: test messaging on bad objects/paths
      cat-file tests: test bad usage
    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    348b0e9 View commit details
    Browse the repository at this point in the history
  26. Merge branch 'jc/reflog-parse-options' into jch

    Use the parse-options API in "git reflog" command.
    
    * jc/reflog-parse-options:
      builtin/reflog.c: use parse-options api for expire, delete subcommands
    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    e9cf89b View commit details
    Browse the repository at this point in the history
  27. Merge branch 'ms/update-index-racy' into jch

    "git update-index --refresh" has been taught to deal better with
    racy timestamps (just like "git status" already does).
    
    * ms/update-index-racy:
      update-index: refresh should rewrite index in case of racy timestamps
      t7508: add tests capturing racy timestamp handling
      t7508: fix bogus mtime verification
      test-lib: introduce API for verifying file mtime
    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    c81942a View commit details
    Browse the repository at this point in the history
  28. Merge branch 'en/merge-ort-restart-optim-fix' into jch

    The merge-ort misbehaved when merge.renameLimit configuration is
    set too low and failed to find all renames.
    
    * en/merge-ort-restart-optim-fix:
      merge-ort: avoid assuming all renames detected
    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    103e669 View commit details
    Browse the repository at this point in the history
  29. Merge branch 'jt/conditional-config-on-remote-url' into jch

    The conditional inclusion mechanism of configuration files using
    "[includeIf <condition>]" learns to base its decision on the
    URL of the remote repository the repository interacts with.
    
    * jt/conditional-config-on-remote-url:
      config: include file if remote URL matches a glob
      config: make git_config_include() static
    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    c574d3c View commit details
    Browse the repository at this point in the history
  30. Merge branch 'po/readme-mention-contributor-hints' into jch

    Doc update.
    
    * po/readme-mention-contributor-hints:
      README.md: add CodingGuidelines and a link for Translators
    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    6d58801 View commit details
    Browse the repository at this point in the history
  31. Merge branch 'tl/doc-cli-options-first' into jch

    We explain that revs come first before the pathspec among command
    line arguments, but did not spell out that dashed options come
    before other args, which has been corrected.
    
    * tl/doc-cli-options-first:
      git-cli.txt: clarify "options first and then args"
    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    66fbae8 View commit details
    Browse the repository at this point in the history
  32. Merge branch 'pw/add-p-hunk-split-fix' into jch

    "git add -p" rewritten in C regressed hunk splitting in some cases,
    which has been corrected.
    
    * pw/add-p-hunk-split-fix:
      builtin add -p: fix hunk splitting
      t3701: clean up hunk splitting tests
    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    927cbec View commit details
    Browse the repository at this point in the history
  33. Merge branch 'gc/fetch-negotiate-only-early-return' into jch

    "git fetch --negotiate-only" is an internal command used by "git
    push" to figure out which part of our history is missing from the
    other side.  It should never recurse into submodules even when
    fetch.recursesubmodules configuration variable is set, nor it
    should trigger "gc".  The code has been tightened up to ensure it
    only does common ancestry discovery and nothing else.
    
    * gc/fetch-negotiate-only-early-return:
      fetch: help translators by reusing the same message template
      fetch --negotiate-only: do not update submodules
      fetch: skip tasks related to fetching objects
      fetch: use goto cleanup in cmd_fetch()
    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    dcfabf6 View commit details
    Browse the repository at this point in the history
  34. Merge branch 'jc/name-rev-stdin' into jch

    "git name-rev --stdin" does not behave like usual "--stdin" at
    all.  Start the process of renaming it to "--annotate-stdin".
    
    * jc/name-rev-stdin:
      name-rev.c: use strbuf_getline instead of limited size buffer
      name-rev: deprecate --stdin in favor of --annotate-stdin
    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    0df1839 View commit details
    Browse the repository at this point in the history
  35. Merge branch 'fs/ssh-signing-crlf' into jch

    The code path that verifies signatures made with ssh were made to
    work better on a system with CRLF line endings.
    
    * fs/ssh-signing-crlf:
      gpg-interface: trim CR from ssh-keygen
    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    60884e2 View commit details
    Browse the repository at this point in the history
  36. Merge branch 'ab/config-based-hooks-2' into jch

    More "config-based hooks".
    
    * ab/config-based-hooks-2:
      run-command: remove old run_hook_{le,ve}() hook API
      receive-pack: convert push-to-checkout hook to hook.h
      read-cache: convert post-index-change to use hook.h
      commit: convert {pre-commit,prepare-commit-msg} hook to hook.h
      git-p4: use 'git hook' to run hooks
      send-email: use 'git hook run' for 'sendemail-validate'
      git hook run: add an --ignore-missing flag
      hooks: convert worktree 'post-checkout' hook to hook library
      hooks: convert non-worktree 'post-checkout' hook to hook library
      merge: convert post-merge to use hook.h
      am: convert applypatch-msg to use hook.h
      rebase: convert pre-rebase to use hook.h
      hook API: add a run_hooks_l() wrapper
      am: convert {pre,post}-applypatch to use hook.h
      gc: use hook library for pre-auto-gc hook
      hook API: add a run_hooks() wrapper
      hook: add 'run' subcommand
    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    e67a274 View commit details
    Browse the repository at this point in the history
  37. Merge branch 'en/plug-leaks-in-merge' into jch

    Leakfix.
    
    * en/plug-leaks-in-merge:
      merge: fix memory leaks in cmd_merge()
      merge-ort: fix memory leak in merge_ort_internal()
    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    904138c View commit details
    Browse the repository at this point in the history
  38. Merge branch 'jt/sparse-checkout-leading-dir-fix' into jch

    "git sparse-checkout init" failed to write into $GIT_DIR/info
    directory when the repository was created without one, which has
    been corrected to auto-create it.
    
    * jt/sparse-checkout-leading-dir-fix:
      sparse-checkout: create leading directory
    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    de7c743 View commit details
    Browse the repository at this point in the history
  39. Merge branch 'jt/clone-not-quite-empty' into jch

    Cloning from a repository that does not yet have any branches or
    tags but has other refs resulted in a "remote transport reported
    error", which has been corrected.
    
    * jt/clone-not-quite-empty:
      clone: support unusual remote ref configurations
    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    479a7a8 View commit details
    Browse the repository at this point in the history
  40. Merge branch 'js/sparse-vs-split-index' into jch

    Mark in various places in the code that the sparse index and the
    split index features are mutually incompatible.
    
    * js/sparse-vs-split-index:
      split-index: it really is incompatible with the sparse index
      t1091: disable split index
      sparse-index: sparse index is disallowed when split index is active
    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    e115833 View commit details
    Browse the repository at this point in the history
  41. Merge branch 'jc/mem-pool-alignment' into jch

    Update the logic to compute alignment requirement for our mem-pool.
    
    * jc/mem-pool-alignment:
      mem-pool: don't assume uintmax_t is aligned enough for all types
    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    4f331b3 View commit details
    Browse the repository at this point in the history
  42. ### match next

    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    6dac95a View commit details
    Browse the repository at this point in the history
  43. Merge branch 'bc/clarify-eol-attr' into jch

    Doc and test update around the eol attribute.
    source: <20220111021507.531736-1-sandals@crustytoothpaste.net>
    
    * bc/clarify-eol-attr:
      docs: correct documentation about eol attribute
      t0027: add tests for eol without text in .gitattributes
    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    49b5dc4 View commit details
    Browse the repository at this point in the history
  44. Merge branch 'hn/reftable-coverity-fixes' into jch

    Problems identified by Coverity in the reftable code have been
    corrected.
    
    * hn/reftable-coverity-fixes:
      reftable: add print functions to the record types
      reftable: make reftable_record a tagged union
      reftable: remove outdated file reftable.c
      reftable: implement record equality generically
      reftable: make reftable-record.h function signatures const correct
      reftable: handle null refnames in reftable_ref_record_equal
      reftable: drop stray printf in readwrite_test
      reftable: order unittests by complexity
      reftable: all xxx_free() functions accept NULL arguments
      reftable: fix resource warning
      reftable: ignore remove() return value in stack_test.c
      reftable: check reftable_stack_auto_compact() return value
      reftable: fix resource leak blocksource.c
      reftable: fix resource leak in block.c error path
      reftable: fix OOB stack write in print functions
    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    1aa4501 View commit details
    Browse the repository at this point in the history
  45. Merge branch 'js/use-builtin-add-i' into jch

    "git add -i" was rewritten in C some time ago and has been in
    testing; the reimplementation is now exposed to general public by
    default.
    
    * js/use-builtin-add-i:
      add -i: default to the built-in implementation
      t2016: require the PERL prereq only when necessary
    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    0293774 View commit details
    Browse the repository at this point in the history
  46. Merge branch 'en/remerge-diff' into jch

    "git log --remerge-diff" shows the difference from mechanical merge
    result and the merge result that is actually recorded.
    
    * en/remerge-diff:
      diff-merges: avoid history simplifications when diffing merges
      merge-ort: mark conflict/warning messages from inner merges as omittable
      show, log: include conflict/warning messages in --remerge-diff headers
      diff: add ability to insert additional headers for paths
      merge-ort: format messages slightly different for use in headers
      merge-ort: mark a few more conflict messages as omittable
      merge-ort: capture and print ll-merge warnings in our preferred fashion
      ll-merge: make callers responsible for showing warnings
      log: clean unneeded objects during `log --remerge-diff`
      show, log: provide a --remerge-diff capability
    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    e0634b7 View commit details
    Browse the repository at this point in the history
  47. Merge branch 'ab/ambiguous-object-name' into jch

    Error output given in response to an ambiguous object name has been
    improved.
    source: <cover-v8-0.7-00000000000-20220127T052116Z-avarab@gmail.com>
    
    * ab/ambiguous-object-name:
      object-name: re-use "struct strbuf" in show_ambiguous_object()
      object-name: iterate ambiguous objects before showing header
      object-name: show date for ambiguous tag objects
      object-name: make ambiguous object output translatable
      object-name: explicitly handle bad tags in show_ambiguous_object()
      object-name: explicitly handle OBJ_BAD in show_ambiguous_object()
      object-name tests: add tests for ambiguous object blind spots
    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    1a5e353 View commit details
    Browse the repository at this point in the history
  48. Merge branch 'bc/csprng-mktemps' into jch

    Pick a better random number generator and use it when we prepare
    temporary filenames.
    
    Are we solving the right problem?
    cf. <220118.86zgntpegy.gmgdl@evledraar.gmail.com>
    source: <20220117215617.843190-1-sandals@crustytoothpaste.net>
    
    * bc/csprng-mktemps:
      wrapper: use a CSPRNG to generate random file names
      wrapper: add a helper to generate numbers from a CSPRNG
    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    6d7b464 View commit details
    Browse the repository at this point in the history
  49. Merge branch 'tb/midx-bitmap-corruption-fix' into jch

    A bug that made multi-pack bitmap and the object order out-of-sync
    (hence the .midx data gets corrupted) has been fixed.
    
    * tb/midx-bitmap-corruption-fix:
      pack-bitmap.c: gracefully fallback after opening pack/MIDX
      midx: read `RIDX` chunk when present
      t/lib-bitmap.sh: parameterize tests over reverse index source
      t5326: move tests to t/lib-bitmap.sh
      t5326: extract `test_rev_exists`
      t5326: drop unnecessary setup
      pack-revindex.c: instrument loading on-disk reverse index
      midx.c: make changing the preferred pack safe
      t5326: demonstrate bitmap corruption after permutation
    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    9b71d5a View commit details
    Browse the repository at this point in the history
  50. Merge branch 'rs/parse-options-lithelp-help' into jch

    Comment update.
    source: <c6ab4408-1091-4d14-849e-afe5f3053e8b@web.de>
    
    * rs/parse-options-lithelp-help:
      parse-options: document bracketing of argh
    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    a0d1658 View commit details
    Browse the repository at this point in the history
  51. Merge branch 'ab/auto-detect-zlib-compress2' into jch

    Notice older zlib to enable our replacement uncompress2()
    automatically.
    
    * ab/auto-detect-zlib-compress2:
      compat: auto-detect if zlib has uncompress2()
    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    cc3e9e1 View commit details
    Browse the repository at this point in the history
  52. Merge branch 'gh/doc-typos' into jch

    source: <20220126121426.53799-1-greg@hurrell.net>
    
    * gh/doc-typos:
      Documentation/config/pgp.txt: add missing apostrophe
      Documentation/config/pgp.txt: replace stray <TAB> character with <SPC>
    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    a68f09e View commit details
    Browse the repository at this point in the history
  53. Merge branch 'ab/no-errno-from-resolve-ref-unsafe' into jch

    source: <cover-v4-0.2-00000000000-20220126T143427Z-avarab@gmail.com>
    
    * ab/no-errno-from-resolve-ref-unsafe:
      refs API: remove "failure_errno" from refs_resolve_ref_unsafe()
      sequencer: don't use die_errno() on refs_resolve_ref_unsafe() failure
    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    467f1ec View commit details
    Browse the repository at this point in the history
  54. Merge branch 'jc/doc-log-messages' into jch

    Update the contributor-facing documents on proposed log messages.
    
    * jc/doc-log-messages:
      SubmittingPatches: explain why we care about log messages
      CodingGuidelines: hint why we value clearly written log messages
      SubmittingPatches: write problem statement in the log in the present tense
    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    1c3ffe8 View commit details
    Browse the repository at this point in the history
  55. Merge branch 'rc/negotiate-only-typofix' into jch

    source: <20220128143602.31842-1-robert@coup.net.nz>
    
    * rc/negotiate-only-typofix:
      fetch: fix negotiate-only error message
    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    f3f4033 View commit details
    Browse the repository at this point in the history
  56. Merge branch 'en/sparse-checkout-leakfix' into jch

    source: <pull.1189.git.git.1643335098710.gitgitgadget@gmail.com>
    
    * en/sparse-checkout-leakfix:
      sparse-checkout: fix a couple minor memory leaks
    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    5b44536 View commit details
    Browse the repository at this point in the history
  57. Merge branch 'en/fetch-negotiation-default-fix' into jch

    source: <pull.1131.v3.git.1643734828.gitgitgadget@gmail.com>
    
    * en/fetch-negotiation-default-fix:
      repo-settings: rename the traditional default fetch.negotiationAlgorithm
      repo-settings: fix error handling for unknown values
      repo-settings: fix checking for fetch.negotiationAlgorithm=default
    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    e2a55cc View commit details
    Browse the repository at this point in the history
  58. Merge branch 'js/diff-filter-negation-fix' into jch

    source: <pull.1127.v3.git.1643371370.gitgitgadget@gmail.com>
    
    * js/diff-filter-negation-fix:
      diff-filter: be more careful when looking for negative bits
      diff.c: move the diff filter bits definitions up a bit
      docs(diff): lose incorrect claim about `diff-files --diff-filter=A`
    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    5d31f95 View commit details
    Browse the repository at this point in the history
  59. Merge branch 'js/no-more-legacy-stash' into jch

    source: <pull.1133.git.1643321031.gitgitgadget@gmail.com>
    
    * js/no-more-legacy-stash:
      stash: stop warning about the obsolete `stash.useBuiltin` config setting
      stash: remove documentation for `stash.useBuiltin`
      add: remove support for `git-legacy-stash`
      git-sh-setup: remove remnant bits referring to `git-legacy-stash`
    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    39b5533 View commit details
    Browse the repository at this point in the history
  60. Merge branch 'rj/receive-pack-abort-upon-disconnect' into jch

    source: <20220128194811.3396281-1-robin.jarry@6wind.com>
    
    * rj/receive-pack-abort-upon-disconnect:
      receive-pack: check if client is alive before completing the push
    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    543fca9 View commit details
    Browse the repository at this point in the history
  61. Merge branch 'tg/fetch-prune-exit-code-fix' into jch

    source: <20220131133047.1885074-1-t.gummerer@gmail.com>
    
    * tg/fetch-prune-exit-code-fix:
      fetch --prune: exit with error if pruning fails
    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    0381b35 View commit details
    Browse the repository at this point in the history
  62. Merge branch 'ds/sparse-checkout-requires-per-worktree-config' into jch

    "git sparse-checkout" wants to work with per-worktree configration,
    but did not work well in a worktree attached to a bare repository.
    source: <pull.1101.v5.git.1643641259.gitgitgadget@gmail.com>
    
    * ds/sparse-checkout-requires-per-worktree-config:
      worktree: copy sparse-checkout patterns and config on add
      sparse-checkout: set worktree-config correctly
      config: add repo_config_set_worktree_gently()
      worktree: create init_worktree_config()
      Documentation: add extensions.worktreeConfig details
    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    284a85a View commit details
    Browse the repository at this point in the history
  63. Merge branch 'ab/do-not-hide-failures-in-git-dot-pm' into jch

    source: <patch-1.1-86353c3b366-20220201T205218Z-avarab@gmail.com>
    
    * ab/do-not-hide-failures-in-git-dot-pm:
      perl Git.pm: don't ignore signalled failure in _cmd_close()
    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    b829607 View commit details
    Browse the repository at this point in the history
  64. Merge branch 'cb/clear-quarantine-early-on-all-ref-update-errors' int…

    …o jch
    
    source: <20220129063538.24038-1-bojun.cbj@gmail.com>
    
    * cb/clear-quarantine-early-on-all-ref-update-errors:
      receive-pack: purge temporary data if no command is ready to run
    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    69a2760 View commit details
    Browse the repository at this point in the history
  65. Merge branch 'gc/branch-recurse-submodules' into jch

    "git branch" learned the "--recurse-submodules" option.
    
    * gc/branch-recurse-submodules:
      branch.c: use 'goto cleanup' in setup_tracking() to fix memory leaks
      branch: add --recurse-submodules option for branch creation
      builtin/branch: consolidate action-picking logic in cmd_branch()
      branch: add a dry_run parameter to create_branch()
      branch: make create_branch() always create a branch
      branch: move --set-upstream-to behavior to dwim_and_setup_tracking()
    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    81f7508 View commit details
    Browse the repository at this point in the history
  66. Merge branch 'tk/subtree-merge-not-ff-only' into jch

    source: <20220201172601.262718-1-aclopte@gmail.com>
    
    * tk/subtree-merge-not-ff-only:
      subtree: force merge commit
    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    2169875 View commit details
    Browse the repository at this point in the history
  67. Merge branch 'hn/reftable-tests' into jch

    source: <pull.1209.git.git.1643651420.gitgitgadget@gmail.com>
    
    * hn/reftable-tests:
      t5312: prepare for reftable
      t1405: mark test that checks existence as REFFILES
      t1405: explictly delete reflogs for reftable
    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    d8c29e1 View commit details
    Browse the repository at this point in the history
  68. Merge branch 'sy/modernize-t-lib-read-tree-m-3way' into jch

    * sy/modernize-t-lib-read-tree-m-3way:
      t/lib-read-tree-m-3way: indent with tabs
      t/lib-read-tree-m-3way: modernize style
    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    45c2986 View commit details
    Browse the repository at this point in the history
  69. Merge branch 'jz/patch-id-hunk-header-parsing-fix' into jch

    * jz/patch-id-hunk-header-parsing-fix:
      patch-id: fix scan_hunk_header on diffs with 1 line of before/after
      patch-id: fix antipatterns in tests
    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    a0a8c70 View commit details
    Browse the repository at this point in the history
  70. Merge branch 'sy/diff-usage-typofix' into jch

    * sy/diff-usage-typofix:
      builtin/diff.c: fix "git-diff" usage string typo
    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    73b74f6 View commit details
    Browse the repository at this point in the history
  71. Merge branch 'ab/complete-show-all-commands' into jch

    * ab/complete-show-all-commands:
      completion: add a GIT_COMPLETION_SHOW_ALL_COMMANDS
      completion tests: re-source git-completion.bash in a subshell
    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    b76aa42 View commit details
    Browse the repository at this point in the history
  72. Merge branch 'll/doc-mktree-typofix' into seen

    * ll/doc-mktree-typofix:
      fix typo in git-mktree.txt
    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    e5af02a View commit details
    Browse the repository at this point in the history
  73. Merge branch 'en/merge-tree' into seen

    * en/merge-tree:
      git-merge-tree.txt: add a section on potentional usage mistakes
      merge-tree: add a --allow-unrelated-histories flag
      merge-tree: allow `ls-files -u` style info to be NUL terminated
      merge-tree: provide easy access to `ls-files -u` style info
      merge-tree: provide a list of which files have conflicts
      merge-ort: provide a merge_get_conflicted_files() helper function
      merge-tree: support including merge messages in output
      merge-ort: allow update messages to be written to different file stream
      merge-ort: split out a separate display_update_messages() function
      diff: allow diff_warn_rename_limit to write somewhere besides stderr
      Introduce a variant of the `warning()` function that takes a `FILE *`
      merge-tree: implement real merges
      merge-tree: add option parsing and initial shell for real merge function
      merge-tree: move logic for existing merge into new function
      merge-tree: rename merge_trees() to trivial_merge_trees()
    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    1016e4d View commit details
    Browse the repository at this point in the history
  74. Merge branch 'cb/save-term-across-editor-invocation' into seen

    Some editors are reported to leave the terminal in funny state
    after they exit on Windows.  Work it around by saving and restoring
    the terminal state when needed.
    
    * cb/save-term-across-editor-invocation:
      fixup! editor: allow for saving/restoring terminal state
      editor: allow for saving/restoring terminal state
      terminal: teach save_term to fail when not foreground
    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    3fbdf05 View commit details
    Browse the repository at this point in the history
  75. Merge branch 'ab/only-single-progress-at-once' into seen

    Further tweaks on progress API.
    
    Getting there.
    source: <cover-v8-0.7-00000000000-20211228T150728Z-avarab@gmail.com>
    
    * ab/only-single-progress-at-once:
      *.c: use isatty(0|2), not isatty(STDIN_FILENO|STDERR_FILENO)
      pack-bitmap-write.c: don't return without stop_progress()
      progress.c: add temporary variable from progress struct
      progress.c tests: test some invalid usage
      progress.c tests: make start/stop commands on stdin
      progress.c test helper: add missing braces
      leak tests: fix a memory leak in "test-progress" helper
    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    03c08d4 View commit details
    Browse the repository at this point in the history
  76. Merge branch 'es/superproject-aware-submodules' into seen

    A configuration variable in a submodule points at the location of
    the superproject it is bound to (RFC).
    
    * es/superproject-aware-submodules:
      submodule: use config to find superproject worktree
      submodule: record superproject gitdir during 'update'
      submodule: record superproject gitdir during absorbgitdirs
      introduce submodule.superprojectGitDir record
      t7400-submodule-basic: modernize inspect() helper
    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    0273a98 View commit details
    Browse the repository at this point in the history
  77. Merge branch 'pw/fix-some-issues-in-reset-head' into seen

    Use an internal call to reset_head() helper function instead of
    spawning "git checkout" in "rebase", and update code paths that are
    involved in the change.
    source: <pull.1049.v3.git.1643202349.gitgitgadget@gmail.com>
    
    * pw/fix-some-issues-in-reset-head:
      rebase -m: don't fork git checkout
      rebase --apply: set ORIG_HEAD correctly
      rebase --apply: fix reflog
      reset_head(): take struct rebase_head_opts
      rebase: cleanup reset_head() calls
      create_autostash(): remove unneeded parameter
      reset_head(): make default_reflog_action optional
      reset_head(): factor out ref updates
      reset_head(): remove action parameter
      rebase --apply: don't run post-checkout hook if there is an error
      rebase: do not remove untracked files on checkout
      rebase: pass correct arguments to post-checkout hook
      t5403: refactor rebase post-checkout hook tests
      rebase: factor out checkout for up to date branch
    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    a90c6eb View commit details
    Browse the repository at this point in the history
  78. Merge branch 'jh/builtin-fsmonitor-part2' (early part) into seen

    * 'jh/builtin-fsmonitor-part2' (early part): (29 commits)
      t7527: test status with untracked-cache and fsmonitor--daemon
      fsmonitor: force update index after large responses
      fsmonitor--daemon: use a cookie file to sync with file system
      fsmonitor--daemon: periodically truncate list of modified files
      t/perf/p7519: add fsmonitor--daemon test cases
      t/perf/p7519: speed up test on Windows
      t/helper/test-chmtime: skip directories on Windows
      t/perf: avoid copying builtin fsmonitor files into test repo
      t7527: create test for fsmonitor--daemon
      t/helper/fsmonitor-client: create IPC client to talk to FSMonitor Daemon
      help: include fsmonitor--daemon feature flag in version info
      fsmonitor--daemon: implement handle_client callback
      compat/fsmonitor/fsm-listen-darwin: implement FSEvent listener on MacOS
      compat/fsmonitor/fsm-listen-darwin: add macos header files for FSEvent
      compat/fsmonitor/fsm-listen-win32: implement FSMonitor backend on Windows
      fsmonitor--daemon: create token-based changed path cache
      fsmonitor--daemon: define token-ids
      fsmonitor--daemon: add pathname classification
      fsmonitor--daemon: implement 'start' command
      fsmonitor--daemon: implement 'run' command
      ...
    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    958bdbf View commit details
    Browse the repository at this point in the history
  79. Merge branch 'bs/forbid-i18n-of-protocol-token-in-fetch-pack' into seen

    L10n support for a few error messages.
    
    * bs/forbid-i18n-of-protocol-token-in-fetch-pack:
      fixup! fetch-pack: parameterize message containing 'ready' keyword
      fetch-pack: parameterize message containing 'ready' keyword
    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    13f4467 View commit details
    Browse the repository at this point in the history
  80. Merge branch 'jh/builtin-fsmonitor-part2' into seen

    Built-in fsmonitor (part 2).
    
    * jh/builtin-fsmonitor-part2:
      fixup! t7527: create test for fsmonitor--daemon
      fixup! t/perf/p7519: speed up test on Windows
    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    d5a6ec1 View commit details
    Browse the repository at this point in the history
  81. Merge branch 'tl/ls-tree-oid-only' into seen

    "git ls-tree" learns "--oid-only" option, similar to "--name-only",
    and more generalized "--format" option.
    source: <cover.1641978175.git.dyroneteng@gmail.com>
    
    * tl/ls-tree-oid-only:
      ls-tree.c: introduce "--format" option
      cocci: allow padding with `strbuf_addf()`
      ls-tree.c: introduce struct "show_tree_data"
      ls-tree.c: support --object-only option for "git-ls-tree"
      ls-tree: optimize naming and handling of "return" in show_tree()
      ls-tree: use "size_t", not "int" for "struct strbuf"'s "len"
      ls-tree: use "enum object_type", not {blob,tree,commit}_type
      ls-tree: add missing braces to "else" arms
      ls-tree: remove commented-out code
    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    c20613c View commit details
    Browse the repository at this point in the history
  82. Merge branch 'ld/sparse-index-bash-completion' into seen

    The command line completion (in contrib/) learns to complete
    arguments give to "git sparse-checkout" command.
    source: <pull.1108.v3.git.1641841193.gitgitgadget@gmail.com>
    
    * ld/sparse-index-bash-completion:
      sparse-checkout: limit tab completion to a single level
      sparse-checkout: custom tab completion
      sparse-checkout: custom tab completion tests
    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    440b654 View commit details
    Browse the repository at this point in the history
  83. Merge branch 'jz/rev-list-exclude-first-parent-only' into seen

    "git log" and friends learned an option --exclude-first-parent-only
    to propagate UNINTERESTING bit down only along the first-parent
    chain, just like --first-parent option shows commits that lack the
    UNINTERESTING bit only along the first-parent chain.
    source: <20220111213941.30129-1-jerry@skydio.com>
    
    * jz/rev-list-exclude-first-parent-only:
      git-rev-list: add --exclude-first-parent-only flag
    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    97914e8 View commit details
    Browse the repository at this point in the history
  84. Merge branch 'vd/sparse-clean-etc' into seen

    "git update-index", "git checkout-index", and "git clean" are
    taught to work better with the sparse checkout feature.
    
    * vd/sparse-clean-etc:
      update-index: reduce scope of index expansion in do_reupdate
      update-index: integrate with sparse index
      update-index: add tests for sparse-checkout compatibility
      checkout-index: integrate with sparse index
      checkout-index: add --ignore-skip-worktree-bits option
      checkout-index: expand sparse checkout compatibility tests
      clean: integrate with sparse index
      reset: reorder wildcard pathspec conditions
      reset: fix validation in sparse index test
    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    3b8eca5 View commit details
    Browse the repository at this point in the history
  85. Merge branch 'en/present-despite-skipped' into seen

    In sparse-checkouts, files mis-marked as missing from the working tree
    could lead to later problems.  Such files were hard to discover, and
    harder to correct.  Automatically detecting and correcting the marking
    of such files has been added to avoid these problems.
    source: <pull.1114.v2.git.1642175983.gitgitgadget@gmail.com>
    
    * en/present-despite-skipped:
      Accelerate clear_skip_worktree_from_present_files() by caching
      Update documentation related to sparsity and the skip-worktree bit
      repo_read_index: clear SKIP_WORKTREE bit from files present in worktree
      unpack-trees: fix accidental loss of user changes
      t1011: add testcase demonstrating accidental loss of user modifications
    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    f7f5460 View commit details
    Browse the repository at this point in the history
  86. Merge branch 'ps/avoid-unnecessary-hook-invocation-with-packed-refs' …

    …into seen
    
    Because a deletion of ref would need to remove it from both the
    loose ref store and the packed ref store, a delete-ref operation
    that logically removes one ref may end up invoking ref-transaction
    hook twice, which has been corrected.
    source: <cover.1642406989.git.ps@pks.im>
    
    * ps/avoid-unnecessary-hook-invocation-with-packed-refs:
      refs: skip hooks when deleting uncovered packed refs
      refs: do not execute reference-transaction hook on packing refs
      refs: demonstrate excessive execution of the reference-transaction hook
      refs: allow skipping the reference-transaction hook
      refs: allow passing flags when beginning transactions
      refs: extract packed_refs_delete_refs() to allow control of transaction
    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    75dbad8 View commit details
    Browse the repository at this point in the history
  87. Merge branch 'ab/grep-patterntype' into seen

    Some code clean-up in the "git grep" machinery.
    
    Looking good, except for the last step.
    source: <cover-v9-0.9-00000000000-20220127T115058Z-avarab@gmail.com>
    
    * ab/grep-patterntype:
      SQUASH???
      grep: simplify config parsing and option parsing
      grep.c: do "if (bool && memchr())" not "if (memchr() && bool)"
      grep.h: make "grep_opt.pattern_type_option" use its enum
      grep API: call grep_config() after grep_init()
      grep.c: don't pass along NULL callback value
      built-ins: trust the "prefix" from run_builtin()
      grep tests: add missing "grep.patternType" config tests
      log tests: check if grep_config() is called by "log"-like cmds
      grep.h: remove unused "regex_t regexp" from grep_opt
    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    de08ace View commit details
    Browse the repository at this point in the history
  88. Merge branch 'rs/bisect-executable-not-found' into seen

    source: <fead25d6-6f5f-487a-ad4c-0657fe9785fd@www.fastmail.com>
    
    * rs/bisect-executable-not-found:
      bisect--helper: double-check run command on exit code 126 and 127
      bisect: document run behavior with exit codes 126 and 127
      bisect--helper: release strbuf and strvec on run error
      bisect--helper: report actual bisect_state() argument on error
    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    41aef92 View commit details
    Browse the repository at this point in the history
  89. Merge branch 'js/apply-partial-clone-filters-recursively' into seen

    "git clone --filter=... --recurse-submodules" only makes the
    top-level a partial clone, while submodules are fully cloned.  This
    behaviour is changed to pass the same filter down to the submodules.
    source: <50ebf7bd39adf34fa4ada27cd433d81b5381abe5.1642735881.git.steadmon@google.com>
    
    * js/apply-partial-clone-filters-recursively:
      clone, submodule: pass partial clone filters to submodules
    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    cd52bb4 View commit details
    Browse the repository at this point in the history
  90. Merge branch 'js/scalar-global-options' into seen

    source: <pull.1130.v2.git.1643380317358.gitgitgadget@gmail.com>
    
    * js/scalar-global-options:
      scalar: accept -C and -c options before the subcommand
    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    61e0226 View commit details
    Browse the repository at this point in the history
  91. Merge branch 'ja/i18n-common-messages' into seen

    source: <pull.1123.v4.git.1643666870.gitgitgadget@gmail.com>
    
    * ja/i18n-common-messages:
      i18n: fix some misformated placeholders in command synopsis
      i18n: remove from i18n strings that do not hold translatable parts
      i18n: factorize "invalid value" messages
      SQUASH???
      i18n: factorize more 'incompatible options' messages
    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    77f1140 View commit details
    Browse the repository at this point in the history
  92. Merge branch 'ab/object-file-api-updates' into seen

    source: <cover-00.10-00000000000-20220201T144803Z-avarab@gmail.com>
    
    * ab/object-file-api-updates:
      object-file API: pass an enum to read_object_with_reference()
      object-file.c: add a literal version of write_object_file_prepare()
      object-file API: replace check_object_signature() with stream_*
      object-file API: have hash_object_file() take "enum object_type"
      object-file API: replace some use of check_object_signature()
      object-file API: provide a hash_object_file_oideq()
      object-file API: have write_object_file() take "enum object_type"
      object-file API: add a format_object_header() function
      object-file API: return "void", not "int" from hash_object_file()
      object-file.c: split up declaration of unrelated variables
    gitster committed Feb 2, 2022
    Configuration menu
    Copy the full SHA
    fde6c44 View commit details
    Browse the repository at this point in the history

Commits on Feb 3, 2022

  1. refs.h: make all flags arguments unsigned

    As discussed in
    https://lore.kernel.org/git/xmqqbkzrkevo.fsf@gitster.g/ , we don't
    want to treat the sign bit specially, so make all flags in refs.h
    unsigned.
    
    Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
    hanwen committed Feb 3, 2022
    Configuration menu
    Copy the full SHA
    54dfe8d View commit details
    Browse the repository at this point in the history
  2. Uniformize flag argument naming to flags or unused_flags

    In a couple of shadowing cases, use `ref_flags` for
    clarity.
    
    Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
    hanwen committed Feb 3, 2022
    Configuration menu
    Copy the full SHA
    e94a923 View commit details
    Browse the repository at this point in the history