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

BRANCHES.md: Add explanation of branches and using forks #17

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

Commits on Dec 9, 2018

  1. t7300: git clean -dfx must show an error with long paths

    In particular on Windows, where the default maximum path length is quite
    small, but there are ways to circumvent that limit in many cases, it is
    very important that users be given an indication why their command
    failed because of too long paths when it did.
    
    This test case makes sure that a warning is issued that would have
    helped the user who reported Git for Windows' issue 521:
    
    	git-for-windows#521
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    9a7ddc0 View commit details
    Browse the repository at this point in the history
  2. mingw: support spawning programs containing spaces in their names

    The CreateProcessW() function does not really support spaces in its
    first argument, lpApplicationName. But it supports passing NULL as
    lpApplicationName, which makes it figure out the application from the
    (possibly quoted) first argument of lpCommandLine.
    
    Let's use that trick (if we are certain that the first argument matches
    the executable's path) to support launching programs whose path contains
    spaces.
    
    This fixes https://github.com/git-for-windows/git/issue/692
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    62915ce View commit details
    Browse the repository at this point in the history
  3. fscache: add key for GIT_TRACE_FSCACHE

    Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    jeffhostetler authored and dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    ec05260 View commit details
    Browse the repository at this point in the history
  4. fscache: remember not-found directories

    Teach FSCACHE to remember "not found" directories.
    
    This is a performance optimization.
    
    FSCACHE is a performance optimization available for Windows.  It
    intercepts Posix-style lstat() calls into an in-memory directory
    using FindFirst/FindNext.  It improves performance on Windows by
    catching the first lstat() call in a directory, using FindFirst/
    FindNext to read the list of files (and attribute data) for the
    entire directory into the cache, and short-cut subsequent lstat()
    calls in the same directory.  This gives a major performance
    boost on Windows.
    
    However, it does not remember "not found" directories.  When STATUS
    runs and there are missing directories, the lstat() interception
    fails to find the parent directory and simply return ENOENT for the
    file -- it does not remember that the FindFirst on the directory
    failed. Thus subsequent lstat() calls in the same directory, each
    re-attempt the FindFirst.  This completely defeats any performance
    gains.
    
    This can be seen by doing a sparse-checkout on a large repo and
    then doing a read-tree to reset the skip-worktree bits and then
    running status.
    
    This change reduced status times for my very large repo by 60%.
    
    Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    jeffhostetler authored and dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    530b8eb View commit details
    Browse the repository at this point in the history
  5. fscache: add a test for the dir-not-found optimization

    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    8190caa View commit details
    Browse the repository at this point in the history
  6. mingw: ensure that core.longPaths is handled *always*

    A ton of Git commands simply do not read (or at least parse) the core.*
    settings. This is not good, as Git for Windows relies on the
    core.longPaths setting to be read quite early on.
    
    So let's just make sure that all commands read the config and give
    platform_core_config() a chance.
    
    This patch teaches tons of Git commands to respect the config setting
    `core.longPaths = true`, including `pack-refs`, thereby fixing
    git-for-windows#1218
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    9c5559b View commit details
    Browse the repository at this point in the history
  7. dir.c: make add_excludes aware of fscache during status

    Teach read_directory_recursive() and add_excludes() to
    be aware of optional fscache and avoid trying to open()
    and fstat() non-existant ".gitignore" files in every
    directory in the worktree.
    
    The current code in add_excludes() calls open() and then
    fstat() for a ".gitignore" file in each directory present
    in the worktree.  Change that when fscache is enabled to
    call lstat() first and if present, call open().
    
    This seems backwards because both lstat needs to do more
    work than fstat.  But when fscache is enabled, fscache will
    already know if the .gitignore file exists and can completely
    avoid the IO calls.  This works because of the lstat diversion
    to mingw_lstat when fscache is enabled.
    
    This reduced status times on a 350K file enlistment of the
    Windows repo on a NVMe SSD by 0.25 seconds.
    
    Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
    jeffhostetler authored and dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    d14e5aa View commit details
    Browse the repository at this point in the history
  8. add: use preload-index and fscache for performance

    Teach "add" to use preload-index and fscache features
    to improve performance on very large repositories.
    
    During an "add", a call is made to run_diff_files()
    which calls check_remove() for each index-entry.  This
    calls lstat().  On Windows, the fscache code intercepts
    the lstat() calls and builds a private cache using the
    FindFirst/FindNext routines, which are much faster.
    
    Somewhat independent of this, is the preload-index code
    which distributes some of the start-up costs across
    multiple threads.
    
    We need to keep the call to read_cache() before parsing the
    pathspecs (and hence cannot use the pathspecs to limit any preload)
    because parse_pathspec() is using the index to determine whether a
    pathspec is, in fact, in a submodule. If we would not read the index
    first, parse_pathspec() would not error out on a path that is inside
    a submodule, and t7400-submodule-basic.sh would fail with
    
    	not ok 47 - do not add files from a submodule
    
    We still want the nice preload performance boost, though, so we simply
    call read_cache_preload(&pathspecs) after parsing the pathspecs.
    
    Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    jeffhostetler authored and dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    eaf3956 View commit details
    Browse the repository at this point in the history
  9. fscache: make fscache_enabled() public

    Make fscache_enabled() function public rather than static.
    Remove unneeded fscache_is_enabled() function.
    Change is_fscache_enabled() macro to call fscache_enabled().
    
    is_fscache_enabled() now takes a pathname so that the answer
    is more precise and mean "is fscache enabled for this pathname",
    since fscache only stores repo-relative paths and not absolute
    paths, we can avoid attempting lookups for absolute paths.
    
    Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
    jeffhostetler authored and dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    c12ef2f View commit details
    Browse the repository at this point in the history
  10. dir.c: regression fix for add_excludes with fscache

    Fix regression described in:
    git-for-windows#1392
    
    which was introduced in:
    git-for-windows@b235337
    
    Problem Symptoms
    ================
    When the user has a .gitignore file that is a symlink, the fscache
    optimization introduced above caused the stat-data from the symlink,
    rather that of the target file, to be returned.  Later when the ignore
    file was read, the buffer length did not match the stat.st_size field
    and we called die("cannot use <path> as an exclude file")
    
    Optimization Rationale
    ======================
    The above optimization calls lstat() before open() primarily to ask
    fscache if the file exists.  It gets the current stat-data as a side
    effect essentially for free (since we already have it in memory).
    If the file does not exist, it does not need to call open().  And
    since very few directories have .gitignore files, we can greatly
    reduce time spent in the filesystem.
    
    Discussion of Fix
    =================
    The above optimization calls lstat() rather than stat() because the
    fscache only intercepts lstat() calls.  Calls to stat() stay directed
    to the mingw_stat() completly bypassing fscache.  Furthermore, calls
    to mingw_stat() always call {open, fstat, close} so that symlinks are
    properly dereferenced, which adds *additional* open/close calls on top
    of what the original code in dir.c is doing.
    
    Since the problem only manifests for symlinks, we add code to overwrite
    the stat-data when the path is a symlink.  This preserves the effect of
    the performance gains provided by the fscache in the normal case.
    
    Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
    jeffhostetler authored and dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    cedc1e0 View commit details
    Browse the repository at this point in the history
  11. fetch-pack.c: enable fscache for stats under .git/objects

    When I do git fetch, git call file stats under .git/objects for each
    refs. This takes time when there are many refs.
    
    By enabling fscache, git takes file stats by directory traversing and that
    improved the speed of fetch-pack for repository having large number of
    refs.
    
    In my windows workstation, this improves the time of `git fetch` for
    chromium repository like below. I took stats 3 times.
    
    * With this patch
    TotalSeconds: 9.9825165
    TotalSeconds: 9.1862075
    TotalSeconds: 10.1956256
    Avg: 9.78811653333333
    
    * Without this patch
    TotalSeconds: 15.8406702
    TotalSeconds: 15.6248053
    TotalSeconds: 15.2085938
    Avg: 15.5580231
    
    Signed-off-by: Takuto Ikuta <tikuta@chromium.org>
    Takuto Ikuta authored and dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    f89b620 View commit details
    Browse the repository at this point in the history
  12. checkout.c: enable fscache for checkout again

    This is retry of git-for-windows#1419.
    
    I added flush_fscache macro to flush cached stats after disk writing
    with tests for regression reported in git-for-windows#1438 and git-for-windows#1442.
    
    git checkout checks each file path in sorted order, so cache flushing does not
    make performance worse unless we have large number of modified files in
    a directory containing many files.
    
    Using chromium repository, I tested `git checkout .` performance when I
    delete 10 files in different directories.
    With this patch:
    TotalSeconds: 4.307272
    TotalSeconds: 4.4863595
    TotalSeconds: 4.2975562
    Avg: 4.36372923333333
    
    Without this patch:
    TotalSeconds: 20.9705431
    TotalSeconds: 22.4867685
    TotalSeconds: 18.8968292
    Avg: 20.7847136
    
    I confirmed this patch passed all tests in t/ with core_fscache=1.
    
    Signed-off-by: Takuto Ikuta <tikuta@chromium.org>
    Takuto Ikuta authored and dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    b287ad8 View commit details
    Browse the repository at this point in the history
  13. Enable the filesystem cache (fscache) in refresh_index().

    On file systems that support it, this can dramatically speed up operations
    like add, commit, describe, rebase, reset, rm that would otherwise have to
    lstat() every file to "re-match" the stat information in the index to that
    of the file system.
    
    On a synthetic repo with 1M files, "git reset" dropped from 52.02 seconds to
    14.42 seconds for a savings of 72%.
    
    Signed-off-by: Ben Peart <benpeart@microsoft.com>
    benpeart authored and dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    a7d5d11 View commit details
    Browse the repository at this point in the history
  14. Merge branch 'program-data-config'

    This branch introduces support for reading the "Windows-wide" Git
    configuration from `%PROGRAMDATA%\Git\config`. As these settings are
    intended to be shared between *all* Git-related software, that config
    file takes an even lower precedence than `$(prefix)/etc/gitconfig`.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    b944e77 View commit details
    Browse the repository at this point in the history
  15. mingw: introduce code to detect whether we're inside a Windows container

    This will come in handy in the next commit.
    
    Signed-off-by: JiSeop Moon <zcube@zcube.kr>
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    ZCube authored and dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    e811cb5 View commit details
    Browse the repository at this point in the history
  16. mingw: when running in a Windows container, try to rename() harder

    It is a known issue that a rename() can fail with an "Access denied"
    error at times, when copying followed by deleting the original file
    works. Let's just fall back to that behavior.
    
    Signed-off-by: JiSeop Moon <zcube@zcube.kr>
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    ZCube authored and dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    c526207 View commit details
    Browse the repository at this point in the history
  17. mingw: move the file_attr_to_st_mode() function definition

    In preparation for making this function a bit more complicated (to allow
    for special-casing the `ContainerMappedDirectories` in Windows
    containers, which look like a symbolic link, but are not), let's move it
    out of the header.
    
    Signed-off-by: JiSeop Moon <zcube@zcube.kr>
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    ZCube authored and dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    7a47304 View commit details
    Browse the repository at this point in the history
  18. mingw: Windows Docker volumes are *not* symbolic links

    ... even if they may look like them.
    
    As looking up the target of the "symbolic link" (just to see whether it
    starts with `/ContainerMappedDirectories/`) is pretty expensive, we
    do it when we can be *really* sure that there is a possibility that this
    might be the case.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    Signed-off-by: JiSeop Moon <zcube@zcube.kr>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    4cde96b View commit details
    Browse the repository at this point in the history
  19. status: carry the --no-lock-index option for backwards-compatibility

    When a third-party tool periodically runs `git status` in order to keep
    track of the state of the working tree, it is a bad idea to lock the
    index: it might interfere with interactive commands executed by the
    user, e.g. when the user wants to commit files.
    
    Git for Windows introduced the `--no-lock-index` option a long time ago
    to fix that (it made it into Git for Windows v2.9.2(3)) by simply
    avoiding to write that file.
    
    The downside is that the periodic `git status` calls will be a little
    bit more wasteful because they may have to refresh the index repeatedly,
    only to throw away the updates when it exits. This cannot really be
    helped, though, as tools wanting to get a periodic update of the status
    have no way to predict when the user may want to lock the index herself.
    
    Sadly, a competing approach was submitted (by somebody who apparently
    has less work on their plate than this maintainer) that made it into
    v2.15.0 but is *different*: instead of a `git status`-only option, it is
    an option that comes *before* the Git command and is called differently,
    too.
    
    Let's give previous users a chance to upgrade to newer Git for Windows
    versions by handling the `--no-lock-index` option, still, though with a
    big fat warning.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    9cf38f3 View commit details
    Browse the repository at this point in the history
  20. status: reinstate --show-ignored-directory as a deprecated option

    It was a bad idea to just remove that option from Git for Windows
    v2.15.0, as early users of that (still experimental) option would have
    been puzzled what they are supposed to do now.
    
    So let's reintroduce the flag, but make sure to show the user good
    advice how to fix this going forward.
    
    We'll remove this option in a more orderly fashion either in v2.16.0 or
    in v2.17.0.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    6605306 View commit details
    Browse the repository at this point in the history
  21. status: verify that --show-ignored-directory prints a warning

    The option is deprecated now, and we better make sure that keeps saying
    so until we finally remove it.
    
    Suggested by Kevin Willford.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    cf9bef9 View commit details
    Browse the repository at this point in the history
  22. mingw: change core.fsyncObjectFiles = 1 by default

    From the documentation of said setting:
    
    	This boolean will enable fsync() when writing object files.
    
    	This is a total waste of time and effort on a filesystem that
    	orders data writes properly, but can be useful for filesystems
    	that do not use journalling (traditional UNIX filesystems) or
    	that only journal metadata and not file contents (OS X’s HFS+,
    	or Linux ext3 with "data=writeback").
    
    The most common file system on Windows (NTFS) does not guarantee that
    order, therefore a sudden loss of power (or any other event causing an
    unclean shutdown) would cause corrupt files (i.e. files filled with
    NULs). Therefore we need to change the default.
    
    Note that the documentation makes it sound as if this causes really bad
    performance. In reality, writing loose objects is something that is done
    only rarely, and only a handful of files at a time.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    fcb2f9d View commit details
    Browse the repository at this point in the history
  23. mingw: kill child processes in a gentler way

    The TerminateProcess() function does not actually leave the child
    processes any chance to perform any cleanup operations. This is bad
    insofar as Git itself expects its signal handlers to run.
    
    A symptom is e.g. a left-behind .lock file that would not be left behind
    if the same operation was run, say, on Linux.
    
    To remedy this situation, we use an obscure trick: we inject a thread
    into the process that needs to be killed and to let that thread run the
    ExitProcess() function with the desired exit status. Thanks J Wyman for
    describing this trick.
    
    The advantage is that the ExitProcess() function lets the atexit
    handlers run. While this is still different from what Git expects (i.e.
    running a signal handler), in practice Git sets up signal handlers and
    atexit handlers that call the same code to clean up after itself.
    
    In case that the gentle method to terminate the process failed, we still
    fall back to calling TerminateProcess(), but in that case we now also
    make sure that processes spawned by the spawned process are terminated;
    TerminateProcess() does not give the spawned process a chance to do so
    itself.
    
    Please note that this change only affects how Git for Windows tries to
    terminate processes spawned by Git's own executables. Third-party
    software that *calls* Git and wants to terminate it *still* need to make
    sure to imitate this gentle method, otherwise this patch will not have
    any effect.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    d78ffaa View commit details
    Browse the repository at this point in the history
  24. mingw: really handle SIGINT

    Previously, we did not install any handler for Ctrl+C, but now we really
    want to because the MSYS2 runtime learned the trick to call the
    ConsoleCtrlHandler when Ctrl+C was pressed.
    
    With this, hitting Ctrl+C while `git log` is running will only terminate
    the Git process, but not the pager. This finally matches the behavior on
    Linux and on macOS.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    55abc1a View commit details
    Browse the repository at this point in the history
  25. mingw: demonstrate that all file handles are inherited by child proce…

    …sses
    
    When spawning child processes, we really should be careful which file
    handles we let them inherit.
    
    This is doubly important on Windows, where we cannot rename, delete, or
    modify files if there is still a file handle open.
    
    Sadly, we have to guard this test inside #ifdef WIN32: we need to use
    the value of the HANDLE directly, and that concept does not exist on
    Linux/Unix.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    ab8ce43 View commit details
    Browse the repository at this point in the history
  26. mingw: work around incorrect standard handles

    For some reason, when being called via TortoiseGit the standard handles,
    or at least what is returned by _get_osfhandle(0) for standard input,
    can take on the value (HANDLE)-2 (which is not a legal value, according
    to the documentation).
    
    Even if this value is not documented anywhere, CreateProcess() seems to
    work fine without complaints if hStdInput set to this value.
    
    In contrast, the upcoming code to restrict which file handles get
    inherited by spawned processes would result in `ERROR_INVALID_PARAMETER`
    when including such handle values in the list.
    
    To help this, special-case the value (HANDLE)-2 returned by
    _get_osfhandle() and replace it with INVALID_HANDLE_VALUE, which will
    hopefully let the handle inheritance restriction work even when called
    from TortoiseGit.
    
    This fixes git-for-windows#1481
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    7edf2d2 View commit details
    Browse the repository at this point in the history
  27. Merge branch 'spawn-with-spaces'

    This topic branch conflicts with the next change that will change the
    way we call `CreateProcessW()`. So let's merge it early, to avoid merge
    conflicts during a merge (because we would have to resolve this with
    every single merging-rebase).
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    f07044f View commit details
    Browse the repository at this point in the history
  28. mingw: spawned processes need to inherit only standard handles

    By default, CreateProcess() does not inherit any open file handles,
    unless the bInheritHandles parameter is set to TRUE. Which we do need to
    set because we need to pass in stdin/stdout/stderr to talk to the child
    processes. Sadly, this means that all file handles (unless marked via
    O_NOINHERIT) are inherited.
    
    This lead to problems in GVFS Git, where a long-running read-object hook
    is used to hydrate missing objects, and depending on the circumstances,
    might only be called *after* Git opened a file handle.
    
    Ideally, we would not open files without O_NOINHERIT unless *really*
    necessary (i.e. when we want to pass the opened file handle as standard
    handle into a child process), but apparently it is all-too-easy to
    introduce incorrect open() calls: this happened, and prevented updating
    a file after the read-object hook was started because the hook still
    held a handle on said file.
    
    Happily, there is a solution: as described in the "Old New Thing"
    https://blogs.msdn.microsoft.com/oldnewthing/20111216-00/?p=8873 there
    is a way, starting with Windows Vista, that lets us define precisely
    which handles should be inherited by the child process.
    
    And since we bumped the minimum Windows version for use with Git for
    Windows to Vista with v2.10.1 (i.e. a *long* time ago), we can use this
    method. So let's do exactly that.
    
    We need to make sure that the list of handles to inherit does not
    contain duplicates; Otherwise CreateProcessW() would fail with
    ERROR_INVALID_ARGUMENT.
    
    While at it, stop setting errno to ENOENT unless it really is the
    correct value.
    
    Also, fall back to not limiting handle inheritance under certain error
    conditions (e.g. on Windows 7, which is a lot stricter in what handles
    you can specify to limit to).
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    533841b View commit details
    Browse the repository at this point in the history
  29. Merge branch 'program-data-config'

    This branch introduces support for reading the "Windows-wide" Git
    configuration from `%PROGRAMDATA%\Git\config`. As these settings are
    intended to be shared between *all* Git-related software, that config
    file takes an even lower precedence than `$(prefix)/etc/gitconfig`.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    0518afe View commit details
    Browse the repository at this point in the history
  30. Merge pull request git-for-windows#1897 from piscisaureus/symlink-attr

    Specify symlink type in .gitattributes
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    0b869d1 View commit details
    Browse the repository at this point in the history
  31. transport-helper: prefer Git's builtins over dashed form

    This helps with minimal installations such as MinGit that refuse to
    waste .zip real estate by shipping identical copies of builtins (.zip
    files do not support hard links).
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    d0a3677 View commit details
    Browse the repository at this point in the history
  32. mingw: explicitly specify with which cmd to prefix the cmdline

    The main idea of this patch is that even if we have to look up the
    absolute path of the script, if only the basename was specified as
    argv[0], then we should use that basename on the command line, too, not
    the absolute path.
    
    This patch will also help with the upcoming patch where we automatically
    substitute "sh ..." by "busybox sh ..." if "sh" is not in the PATH but
    "busybox" is: we will do that by substituting the actual executable, but
    still keep prepending "sh" to the command line.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    0670f53 View commit details
    Browse the repository at this point in the history
  33. mingw: when path_lookup() failed, try BusyBox

    BusyBox comes with a ton of applets ("applet" being the identical
    concept to Git's "builtins"). And similar to Git's builtins, the applets
    can be called via `busybox <command>`, or the BusyBox executable can be
    copied/hard-linked to the command name.
    
    The similarities do not end here. Just as with Git's builtins, it is
    problematic that BusyBox' hard-linked applets cannot easily be put into
    a .zip file: .zip archives have no concept of hard-links and therefore
    would store identical copies (and also extract identical copies,
    "inflating" the archive unnecessarily).
    
    To counteract that issue, MinGit already ships without hard-linked
    copies of the builtins, and the plan is to do the same with BusyBox'
    applets: simply ship busybox.exe as single executable, without
    hard-linked applets.
    
    To accommodate that, Git is being taught by this commit a very special
    trick, exploiting the fact that it is possible to call an executable
    with a command-line whose argv[0] is different from the executable's
    name: when `sh` is to be spawned, and no `sh` is found in the PATH, but
    busybox.exe is, use that executable (with unchanged argv).
    
    Likewise, if any executable to be spawned is not on the PATH, but
    busybox.exe is found, parse the output of `busybox.exe --help` to find
    out what applets are included, and if the command matches an included
    applet name, use busybox.exe to execute it.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    5bbbc84 View commit details
    Browse the repository at this point in the history
  34. test-run-command: learn to run (parts of) the testsuite

    Instead of relying on the presence of `make`, or `prove`, we might just
    as well use our own facilities to run the test suite.
    
    This helps e.g. when trying to verify a Git for Windows installation
    without requiring to download a full Git for Windows SDK (which would use
    up 600+ megabytes of bandwidth, and over a gigabyte of disk space).
    
    Of course, it still requires the test helpers to be build *somewhere*,
    and the Git version should at least roughly match the version from which
    the test suite comes.
    
    At the same time, this new way to run the test suite allows to validate
    that a BusyBox-backed MinGit works as expected (verifying that BusyBox'
    functionality is enough to at least pass the test suite).
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    6db8762 View commit details
    Browse the repository at this point in the history
  35. test-lib: avoid unnecessary Perl invocation

    It is a bit strange, and even undesirable, to require Perl just to run
    the test suite even when NO_PERL was set.
    
    This patch does not fix this problem by any stretch of imagination.
    However, it fixes *the* Perl invocation that *every single* test script
    has to run.
    
    While at it, it makes the source code also more grep'able, as the code
    that unsets some, but not all, GIT_* environment variables just became a
    *lot* more explicit. And all that while still reducing the total number
    of lines.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    8d59cae View commit details
    Browse the repository at this point in the history
  36. tests: replace mingw_test_cmp with a helper in C

    This helper is slightly more performant than the script with MSYS2's
    Bash. And a lot more readable.
    
    To accommodate t1050, which wants to compare files weighing in with 3MB
    (falling outside of t1050's malloc limit of 1.5MB), we simply lift the
    allocation limit by setting the environment variable GIT_ALLOC_LIMIT to
    zero when calling the helper.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    a7891ac View commit details
    Browse the repository at this point in the history
  37. test-tool: learn to act as a drop-in replacement for iconv

    It is convenient to assume that everybody who wants to build & test Git
    has access to a working `iconv` executable (after all, we already pretty
    much require libiconv).
    
    However, that limits esoteric test scenarios such as Git for Windows',
    where an end user installation has to ship with `iconv` for the sole
    purpose of being testable. That payload serves no other purpose.
    
    So let's just have a test helper (to be able to test Git, the test
    helpers have to be available, after all) to act as `iconv` replacement.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    b2a90fd View commit details
    Browse the repository at this point in the history
  38. tests(mingw): if iconv is unavailable, use test-helper --iconv

    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    5adeb2e View commit details
    Browse the repository at this point in the history
  39. tests: use t/diff-lib/* consistently

    The idea of copying README and COPYING into t/diff-lib/ was to step away
    from using files from outside t/ in tests. Let's really make sure that
    we use the files from t/diff-lib/ instead of other versions of those
    files.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    00db67f View commit details
    Browse the repository at this point in the history
  40. gitattributes: mark .png files as binary

    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    536aae6 View commit details
    Browse the repository at this point in the history
  41. tests: move test PNGs into t/diff-lib/

    We already have a directory where we store files intended for use by
    multiple test scripts. The same directory is a better home for the
    test-binary-*.png files than t/.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    b2eeb16 View commit details
    Browse the repository at this point in the history
  42. tests: only override sort & find if there are usable ones in /usr/bin/

    The idea is to allow running the test suite on MinGit with BusyBox
    installed in /mingw64/bin/sh.exe. In that case, we will want to exclude
    sort & find (and other Unix utilities) from being bundled.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    9d6e2ff View commit details
    Browse the repository at this point in the history
  43. tests: use the correct path separator with BusyBox

    BusyBox-w32 is a true Win32 application, i.e. it does not come with a
    POSIX emulation layer.
    
    That also means that it does *not* use the Unix convention of separating
    the entries in the PATH variable using colons, but semicolons.
    
    However, there are also BusyBox ports to Windows which use a POSIX
    emulation layer such as Cygwin's or MSYS2's runtime, i.e. using colons
    as PATH separators.
    
    As a tell-tale, let's use the presence of semicolons in the PATH
    variable: on Unix, it is highly unlikely that it contains semicolons,
    and on Windows (without POSIX emulation), it is virtually guaranteed, as
    everybody should have both $SYSTEMROOT and $SYSTEMROOT/system32 in their
    PATH.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    822386e View commit details
    Browse the repository at this point in the history
  44. mingw: only use Bash-ism builtin pwd -W when available

    Traditionally, Git for Windows' SDK uses Bash as its default shell.
    However, other Unix shells are available, too. Most notably, the Win32
    port of BusyBox comes with `ash` whose `pwd` command already prints
    Windows paths as Git for Windows wants them, while there is not even a
    `builtin` command.
    
    Therefore, let's be careful not to override `pwd` unless we know that
    the `builtin` command is available.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    b6df125 View commit details
    Browse the repository at this point in the history
  45. tests (mingw): remove Bash-specific pwd option

    The -W option is only understood by MSYS2 Bash's pwd command. We already
    make sure to override `pwd` by `builtin pwd -W` for MINGW, so let's not
    double the effort here.
    
    This will also help when switching the shell to another one (such as
    BusyBox' ash) whose pwd does *not* understand the -W option.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    6433ebc View commit details
    Browse the repository at this point in the history
  46. test-lib: add BUSYBOX prerequisite

    When running with BusyBox, we will want to avoid calling executables on
    the PATH that are implemented in BusyBox itself.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    97b562b View commit details
    Browse the repository at this point in the history
  47. t0021: use Windows path when appropriate

    Since c6b0831 (docs: warn about possible '=' in clean/smudge filter
    process values, 2016-12-03), t0021 writes out a file with quotes in its
    name, and MSYS2's path conversion heuristics mistakes that to mean that
    we are not talking about a path here.
    
    Therefore, we need to use Windows paths, as the test-helper is a Win32
    program that would otherwise have no idea where to look for the file.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    db0fb82 View commit details
    Browse the repository at this point in the history
  48. t1300: mark all test cases with funny filenames as !MINGW

    On Windows, it is impossible to create a file whose name contains a
    quote character. We already excluded test cases using such files from
    running on Windows when git.exe itself was tested.
    
    However, we still had two test cases that try to create such a file, and
    redirect stdin from such a file, respectively. This *seems* to work in
    Git for Windows' Bash due to an obscure feature inherited from Cygwin:
    illegal filename characters are simply mapped into/from a private UTF-8
    page. Pure Win32 programs (such as git.exe) *still* cannot work with
    those files, of course, but at least Unix shell scripts pretend to be
    able to.
    
    This entire strategy breaks down when switching to any Unix shell
    lacking support for that private UTF-8 page trick, e.g. BusyBox-w32's
    ash. So let's just exclude test cases that test whether the Unix shell
    can redirect to/from files with "funny names" those from running on
    Windows, too.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    dc0c367 View commit details
    Browse the repository at this point in the history
  49. t4124: avoid using "normal" diff mode

    Everybody and their dogs, cats and other pets settled on using unified
    diffs. It is a really quaint holdover from a long-gone era that GNU diff
    outputs "normal" diff by default.
    
    Yet, t4124 relied on that mode.
    
    This mode is so out of fashion in the meantime, though, that e.g.
    BusyBox' diff decided not even to bother to support it. It only supports
    unified diffs.
    
    So let's just switch away from "normal" diffs and use unified diffs, as
    we really are only interested in the `+` lines.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    1a31105 View commit details
    Browse the repository at this point in the history
  50. t5003: use binary file from t/diff-lib/

    At some stage, t5003-archive-zip wants to add a file that is not ASCII.
    To that end, it uses /bin/sh. But that file may actually not exist (it
    is too easy to forget that not all the world is Unix/Linux...)! Besides,
    we already have perfectly fine binary files intended for use solely by
    the tests. So let's use one of them instead.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    efdb04f View commit details
    Browse the repository at this point in the history
  51. t5003: skip unzip -a tests with BusyBox

    BusyBox' unzip is working pretty well. But Git's tests want to abuse it
    to not only extract files, but to convert their line endings on the fly,
    too. BusyBox' unzip does not support that, and it would appear that
    it would require rather intrusive changes.
    
    So let's just work around this by skipping the test case that uses
    `unzip -a` and the subsequent test cases expecting `unzip -a`'s output.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    5686584 View commit details
    Browse the repository at this point in the history
  52. t5532: workaround for BusyBox on Windows

    While it may seem super convenient to some old Unix hands to simpy
    require Perl to be available when running the test suite, this is a
    major hassle on Windows, where we want to verify that Perl is not,
    actually, required in a NO_PERL build.
    
    As a super ugly workaround, we "install" a script into /usr/bin/perl
    reading like this:
    
    	#!/bin/sh
    
    	# We'd much rather avoid requiring Perl altogether when testing
    	# an installed Git. Oh well, that's why we cannot have nice
    	# things.
    	exec c:/git-sdk-64/usr/bin/perl.exe "$@"
    
    The problem with that is that BusyBox assumes that the #! line in a
    script refers to an executable, not to a script. So when it encounters
    the line #!/usr/bin/perl in t5532's proxy-get-cmd, it barfs.
    
    Let's help this situation by simply executing the Perl script with the
    "interpreter" specified explicitly.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    00da44d View commit details
    Browse the repository at this point in the history
  53. t5605: special-case hardlink test for BusyBox-w32

    When t5605 tries to verify that files are hardlinked (or that they are
    not), it uses the `-links` option of the `find` utility.
    
    BusyBox' implementation does not support that option, and BusyBox-w32's
    lstat() does not even report the number of hard links correctly (for
    performance reasons).
    
    So let's just switch to a different method that actually works on
    Windows.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    f70e182 View commit details
    Browse the repository at this point in the history
  54. t5813: allow for $PWD to be a Windows path

    Git for Windows uses MSYS2's Bash to run the test suite, which comes
    with benefits but also at a heavy price: on the plus side, MSYS2's
    POSIX emulation layer allows us to continue pretending that we are on a
    Unix system, e.g. use Unix paths instead of Windows ones, yet this is
    bought at a rather noticeable performance penalty.
    
    There *are* some more native ports of Unix shells out there, though,
    most notably BusyBox-w32's ash. These native ports do not use any POSIX
    emulation layer (or at most a *very* thin one, choosing to avoid
    features such as fork() that are expensive to emulate on Windows), and
    they use native Windows paths (usually with forward slashes instead of
    backslashes, which is perfectly legal in almost all use cases).
    
    And here comes the problem: with a $PWD looking like, say,
    C:/git-sdk-64/usr/src/git/t/trash directory.t5813-proto-disable-ssh
    Git's test scripts get quite a bit confused, as their assumptions have
    been shattered. Not only does this path contain a colon (oh no!), it
    also does not start with a slash.
    
    This is a problem e.g. when constructing a URL as t5813 does it:
    ssh://remote$PWD. Not only is it impossible to separate the "host" from
    the path with a $PWD as above, even prefixing $PWD by a slash won't
    work, as /C:/git-sdk-64/... is not a valid path.
    
    As a workaround, detect when $PWD does not start with a slash on
    Windows, and simply strip the drive prefix, using an obscure feature of
    Windows paths: if an absolute Windows path starts with a slash, it is
    implicitly prefixed by the drive prefix of the current directory. As we
    are talking about the current directory here, anyway, that strategy
    works.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    4c2274b View commit details
    Browse the repository at this point in the history
  55. t7063: when running under BusyBox, avoid unsupported find option

    BusyBox' find implementation does not understand the -ls option, so
    let's not use it when we're running inside BusyBox.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    71383c7 View commit details
    Browse the repository at this point in the history
  56. t9200: skip tests when $PWD contains a colon

    On Windows, the current working directory is pretty much guaranteed to
    contain a colon. If we feed that path to CVS, it mistakes it for a
    separator between host and port, though.
    
    This has not been a problem so far because Git for Windows uses MSYS2's
    Bash using a POSIX emulation layer that also pretends that the current
    directory is a Unix path (at least as long as we're in a shell script).
    
    However, that is rather limiting, as Git for Windows also explores other
    ports of other Unix shells. One of those is BusyBox-w32's ash, which is
    a native port (i.e. *not* using any POSIX emulation layer, and certainly
    not emulating Unix paths).
    
    So let's just detect if there is a colon in $PWD and punt in that case.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    ee1158d View commit details
    Browse the repository at this point in the history
  57. t9350: skip ISO-8859-1 test when the environment is always-UTF-8

    In the BusyBox-w32 version that is currently under consideration for
    MinGit for Windows (to reduce the .zip size, and to avoid problems with
    the MSYS2 runtime), the UTF-16 environment present in Windows is
    considered to be authoritative, and the 8-bit version is always in UTF-8
    encoding.
    
    As a consequence, the ISO-8859-1 test in t9350-fast-export (which tries
    to set GIT_AUTHOR_NAME to a ISO-8859-1 encoded value) *must* fail in
    that setup.
    
    So let's detect when it would fail (due to an environment being purely
    kept UTF-8 encoded), and skip that test in that case.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    1407d2f View commit details
    Browse the repository at this point in the history
  58. mingw: add a Makefile target to copy test artifacts

    The Makefile target `install-mingit-test-artifacts` simply copies stuff
    and things directly into a MinGit directory, including an init.bat
    script to set everything up so that the tests can be run in a cmd
    window.
    
    Sadly, Git's test suite still relies on a Perl interpreter even if
    compiled with NO_PERL=YesPlease. We punt for now, installing a small
    script into /usr/bin/perl that hands off to an existing Perl of a Git
    for Windows SDK.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    43b837a View commit details
    Browse the repository at this point in the history
  59. mingw (git_terminal_prompt): work around BusyBox & WSL issues

    When trying to query the user directly via /dev/tty, both WSL's bash and
    BusyBox' bash emulation seem to have problems printing the value that
    they just read. The bash just stops in those instances, does not even
    execute any commands after the echo command.
    
    Let's just work around this by running the Bash snippet only in MSYS2's
    Bash: its `SHELL` variable has the `.exe` suffix, and neither WSL's nor
    BusyBox' bash set the `SHELL` variable to a path with that suffix. In
    the latter case, we simply exit with code 127 (indicating that the
    command was not found) and fall back to the CONIN$/CONOUT$ method
    quietly.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    8ecb406 View commit details
    Browse the repository at this point in the history
  60. mingw (git_terminal_prompt): do fall back to CONIN$/CONOUT$ method

    To support Git Bash running in a MinTTY, we use a dirty trick to access
    the MSYS2 pseudo terminal: we execute a Bash snippet that accesses
    /dev/tty.
    
    The idea was to fall back to writing to/reading from CONOUT$/CONIN$ if
    that Bash call failed because Bash was not found.
    
    However, we should fall back even in other error conditions, because we
    have not successfully read the user input. Let's make it so.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    f3fc9fc View commit details
    Browse the repository at this point in the history
  61. mingw (git_terminal_prompt): turn on echo explictly

    It turns out that when running in a Powershell window, we need to turn
    on ENABLE_ECHO_INPUT because the default would be *not* to echo
    anything.
    
    This also ensures that we use the input mode where all input is read
    until the user hits the Return key.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    d5d8030 View commit details
    Browse the repository at this point in the history
  62. Add a Code of Conduct

    It is better to state clearly expectations and intentions than to assume
    quietly that everybody agrees.
    
    This Code of Conduct is the Open Code of Conduct as per
    http://todogroup.org/opencodeofconduct/ (the only modifications are the
    adjustments to reflect that there is no "response team" in addition to the
    Git for Windows maintainer, and the addition of the link to the Open Code
    of Conduct itself).
    
    [Completely revamped, based on the Covenant 1.4 by Brendan Forster]
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    6739192 View commit details
    Browse the repository at this point in the history
  63. CONTRIBUTING.md: add guide for first-time contributors

    Getting started contributing to Git can be difficult on a Windows
    machine. CONTRIBUTING.md contains a guide to getting started, including
    detailed steps for setting up build tools, running tests, and
    submitting patches to upstream.
    
    [includes an example by Pratik Karki how to submit v2, v3, v4, etc.]
    
    Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
    derrickstolee authored and dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    c9d3afc View commit details
    Browse the repository at this point in the history
  64. README.md: Add a Windows-specific preamble

    Includes touch-ups by Philip Oakley.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    2f82cdd View commit details
    Browse the repository at this point in the history
  65. Add an issue template

    With improvements by Clive Chan, Adric Norris, Ben Bodenmiller and
    Philip Oakley.
    
    Helped-by: Clive Chan <cc@clive.io>
    Helped-by: Adric Norris <landstander668@gmail.com>
    Helped-by: Ben Bodenmiller <bbodenmiller@hotmail.com>
    Helped-by: Philip Oakley <philipoakley@iee.org>
    Signed-off-by: Brendan Forster <brendan@github.com>
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    shiftkey authored and dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    9a2d815 View commit details
    Browse the repository at this point in the history
  66. Modify the GitHub Pull Request template (to reflect Git for Windows)

    Git for Windows accepts pull requests; Core Git does not. Therefore we
    need to adjust the template (because it only matches core Git's
    project management style, not ours).
    
    Also: direct Git for Windows enhancements to their contributions page,
    space out the text for easy reading, and clarify that the mailing list
    is plain text, not HTML.
    
    Signed-off-by: Philip Oakley <philipoakley@iee.org>
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    Philip Oakley authored and dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    73fe6ac View commit details
    Browse the repository at this point in the history
  67. .github: Add configuration for the Sentiment Bot

    The sentiment bot will help detect when things get too heated.
    Hopefully.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    09b9181 View commit details
    Browse the repository at this point in the history
  68. Document how $HOME is set on Windows

    Git documentation refers to $HOME and $XDG_CONFIG_HOME often, but does not specify how or where these values come from on Windows where neither is set by default. The new documentation reflects the behavior of setup_windows_environment() in compat/mingw.c.
    
    Signed-off-by: Alejandro Barreto <alejandro.barreto@ni.com>
    alejandro5042 authored and dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    8f945d2 View commit details
    Browse the repository at this point in the history
  69. sha1-name.c: add get_oidf() which acts like get_oid()

    Compared to `get_oid()`, `get_oidf()` has as parameters
    a pointer to `object_id`, a printf format string and
    additional arguments. This will help simplify the code
    in subsequent commits.
    
    Original-idea-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    Signed-off-by: Paul-Sebastian Ungureanu <ungureanupaulsebastian@gmail.com>
    ungps authored and dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    6a9ad54 View commit details
    Browse the repository at this point in the history
  70. strbuf.c: add strbuf_join_argv()

    Implement `strbuf_join_argv()` to join arguments
    into a strbuf.
    
    Signed-off-by: Paul-Sebastian Ungureanu <ungureanupaulsebastian@gmail.com>
    ungps authored and dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    fbf4f6d View commit details
    Browse the repository at this point in the history
  71. stash: improve option parsing test coverage

    In preparation for converting the stash command incrementally to
    a builtin command, this patch improves test coverage of the option
    parsing. Both for having too many parameters, or too few.
    
    Signed-off-by: Joel Teichroeb <joel@teichroeb.net>
    Signed-off-by: Paul-Sebastian Ungureanu <ungureanupaulsebastian@gmail.com>
    klusark authored and dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    41edcfa View commit details
    Browse the repository at this point in the history
  72. t3903: modernize style

    Remove whitespaces after redirection operators and wrap
    long lines.
    
    Signed-off-by: Paul-Sebastian Ungureanu <ungureanupaulsebastian@gmail.com>
    ungps authored and dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    3fe172d View commit details
    Browse the repository at this point in the history
  73. stash: rename test cases to be more descriptive

    Rename some test cases' labels to be more descriptive and under 80
    characters per line.
    
    Signed-off-by: Paul-Sebastian Ungureanu <ungureanupaulsebastian@gmail.com>
    ungps authored and dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    13b7a8e View commit details
    Browse the repository at this point in the history
  74. stash: add tests for git stash show config

    This commit introduces tests for `git stash show`
    config. It tests all the cases where `stash.showStat`
    and `stash.showPatch` are unset or set to true / false.
    
    Signed-off-by: Paul-Sebastian Ungureanu <ungureanupaulsebastian@gmail.com>
    ungps authored and dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    2306034 View commit details
    Browse the repository at this point in the history
  75. stash: mention options in show synopsis

    Mention in the documentation, that `show` accepts any
    option known to `git diff`.
    
    Signed-off-by: Paul-Sebastian Ungureanu <ungureanupaulsebastian@gmail.com>
    ungps authored and dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    23f071b View commit details
    Browse the repository at this point in the history
  76. stash: convert apply to builtin

    Add a builtin helper for performing stash commands. Converting
    all at once proved hard to review, so starting with just apply
    lets conversion get started without the other commands being
    finished.
    
    The helper is being implemented as a drop in replacement for
    stash so that when it is complete it can simply be renamed and
    the shell script deleted.
    
    Delete the contents of the apply_stash shell function and replace
    it with a call to stash--helper apply until pop is also
    converted.
    
    Signed-off-by: Joel Teichroeb <joel@teichroeb.net>
    Signed-off-by: Paul-Sebastian Ungureanu <ungureanupaulsebastian@gmail.com>
    klusark authored and dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    5c7c5dc View commit details
    Browse the repository at this point in the history
  77. stash: convert drop and clear to builtin

    Add the drop and clear commands to the builtin helper. These two
    are each simple, but are being added together as they are quite
    related.
    
    We have to unfortunately keep the drop and clear functions in the
    shell script as functions are called with parameters internally
    that are not valid when the commands are called externally. Once
    pop is converted they can both be removed.
    
    Signed-off-by: Joel Teichroeb <joel@teichroeb.net>
    Signed-off-by: Paul-Sebastian Ungureanu <ungureanupaulsebastian@gmail.com>
    klusark authored and dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    1393382 View commit details
    Browse the repository at this point in the history
  78. stash: convert branch to builtin

    Add stash branch to the helper and delete the apply_to_branch
    function from the shell script.
    
    Checkout does not currently provide a function for checking out
    a branch as cmd_checkout does a large amount of sanity checks
    first that we require here.
    
    Signed-off-by: Joel Teichroeb <joel@teichroeb.net>
    Signed-off-by: Paul-Sebastian Ungureanu <ungureanupaulsebastian@gmail.com>
    klusark authored and dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    ade7490 View commit details
    Browse the repository at this point in the history
  79. stash: convert pop to builtin

    Add stash pop to the helper and delete the pop_stash, drop_stash,
    assert_stash_ref functions from the shell script now that they
    are no longer needed.
    
    Signed-off-by: Joel Teichroeb <joel@teichroeb.net>
    Signed-off-by: Paul-Sebastian Ungureanu <ungureanupaulsebastian@gmail.com>
    klusark authored and dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    e2271f9 View commit details
    Browse the repository at this point in the history
  80. stash: convert list to builtin

    Add stash list to the helper and delete the list_stash function
    from the shell script.
    
    Signed-off-by: Paul-Sebastian Ungureanu <ungureanupaulsebastian@gmail.com>
    ungps authored and dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    eac6893 View commit details
    Browse the repository at this point in the history
  81. stash: convert show to builtin

    Add stash show to the helper and delete the show_stash, have_stash,
    assert_stash_like, is_stash_like and parse_flags_and_rev functions
    from the shell script now that they are no longer needed.
    
    In shell version, although `git stash show` accepts `--index` and
    `--quiet` options, it ignores them. In C, both options are passed
    further to `git diff`.
    
    Signed-off-by: Paul-Sebastian Ungureanu <ungureanupaulsebastian@gmail.com>
    ungps authored and dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    7393592 View commit details
    Browse the repository at this point in the history
  82. stash: convert store to builtin

    Add stash store to the helper and delete the store_stash function
    from the shell script.
    
    Signed-off-by: Paul-Sebastian Ungureanu <ungureanupaulsebastian@gmail.com>
    ungps authored and dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    e2e5b02 View commit details
    Browse the repository at this point in the history
  83. stash: convert create to builtin

    Add stash create to the helper.
    
    Signed-off-by: Paul-Sebastian Ungureanu <ungureanupaulsebastian@gmail.com>
    ungps authored and dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    78f8dbb View commit details
    Browse the repository at this point in the history
  84. stash: convert push to builtin

    Add stash push to the helper.
    
    Signed-off-by: Paul-Sebastian Ungureanu <ungureanupaulsebastian@gmail.com>
    ungps authored and dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    27d51c5 View commit details
    Browse the repository at this point in the history
  85. stash: make push -q quiet

    There is a change in behaviour with this commit. When there was
    no initial commit, the shell version of stash would still display
    a message. This commit makes `push` to not display any message if
    `--quiet` or `-q` is specified. Add tests for `--quiet`.
    
    Signed-off-by: Paul-Sebastian Ungureanu <ungureanupaulsebastian@gmail.com>
    ungps authored and dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    12ee120 View commit details
    Browse the repository at this point in the history
  86. stash: convert save to builtin

    Add stash save to the helper and delete functions which are no
    longer needed (`show_help()`, `save_stash()`, `push_stash()`,
    `create_stash()`, `clear_stash()`, `untracked_files()` and
    `no_changes()`).
    
    Signed-off-by: Paul-Sebastian Ungureanu <ungureanupaulsebastian@gmail.com>
    ungps authored and dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    03c4ea1 View commit details
    Browse the repository at this point in the history
  87. stash: convert stash--helper.c into stash.c

    The old shell script `git-stash.sh`  was removed and replaced
    entirely by `builtin/stash.c`. In order to do that, `create` and
    `push` were adapted to work without `stash.sh`. For example, before
    this commit, `git stash create` called `git stash--helper create
    --message "$*"`. If it called `git stash--helper create "$@"`, then
    some of these changes wouldn't have been necessary.
    
    This commit also removes the word `helper` since now stash is
    called directly and not by a shell script.
    
    Signed-off-by: Paul-Sebastian Ungureanu <ungureanupaulsebastian@gmail.com>
    ungps authored and dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    8c6af6c View commit details
    Browse the repository at this point in the history
  88. stash: optimize get_untracked_files() and check_changes()

    This commits introduces a optimization by avoiding calling the
    same functions again. For example, `git stash push -u`
    would call at some points the following functions:
    
     * `check_changes()` (inside `do_push_stash()`)
     * `do_create_stash()`, which calls: `check_changes()` and
    `get_untracked_files()`
    
    Note that `check_changes()` also calls `get_untracked_files()`.
    So, `check_changes()` is called 2 times and `get_untracked_files()`
    3 times.
    
    The old function `check_changes()` now consists of two functions:
    `get_untracked_files()` and `check_changes_tracked_files()`.
    
    These are the call chains for `push` and `create`:
    
     * `push_stash()` -> `do_push_stash()` -> `do_create_stash()`
    
     * `create_stash()` -> `do_create_stash()`
    
    To prevent calling the same functions over and over again,
    `check_changes()` inside `do_create_stash()` is now placed
    in the caller functions (`create_stash()` and `do_push_stash()`).
    This way `check_changes()` and `get_untracked files()` are called
    only one time.
    
    https://public-inbox.org/git/20180818223329.GJ11326@hank.intra.tgummerer.com/
    
    Signed-off-by: Paul-Sebastian Ungureanu <ungureanupaulsebastian@gmail.com>
    ungps authored and dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    75ef422 View commit details
    Browse the repository at this point in the history
  89. stash: replace all write-tree child processes with API calls

    This commit replaces spawning `git write-tree` with API calls.
    
    Signed-off-by: Paul-Sebastian Ungureanu <ungureanupaulsebastian@gmail.com>
    ungps authored and dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    d7e7c7a View commit details
    Browse the repository at this point in the history
  90. Add back the original, scripted git stash

    This simply copies the version as of v2.19.0-rc0 verbatim. As of now,
    it is not hooked up.
    
    The next commit will change the builtin `stash` to hand off to the
    scripted `git stash` when `stash.useBuiltin=false`.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    74fc81e View commit details
    Browse the repository at this point in the history
  91. stash: optionally use the scripted version again

    We recently converted the `git stash` command from Unix shell scripts
    to builtins.
    
    Just like we have `rebase.useBuiltin` to fall back to the scripted
    rebase, to give end users a way out when they discover a bug in the
    builtin command, this commit adds support for `stash.useBuiltin`.
    
    This is necessary because Git for Windows wants to ship the builtin
    stash earlier than core Git: Git for Windows v2.19.0 will come with
    the option of a drastically faster (if a lot less battle-tested)
    `git stash`.
    
    As the file name `git-stash` is already in use, let's rename the
    scripted backend to `git-legacy-stash`.
    
    To make the test suite pass with `stash.useBuiltin=false`, this commit
    also backports rudimentary support for `-q` (but only *just* enough
    to appease the test suite), and adds a super-ugly hack to force exit
    code 129 for `git stash -h`.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    c82c409 View commit details
    Browse the repository at this point in the history
  92. rebase: move reset_head() into a better spot

    In the next commit, we want to make use of it in `run_am()` (i.e.
    running the `--am` backend directly, without detouring to Unix shell
    script code) which in turn will be called from `run_specific_rebase()`.
    
    So let's move it before that latter function.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    65feab2 View commit details
    Browse the repository at this point in the history
  93. rebase: avoid double reflog entry when switching branches

    When switching a branch *and* updating said branch to a different
    revision, let's avoid a double entry by first updating the branch and
    then adjusting the symbolic ref HEAD.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    ed5596b View commit details
    Browse the repository at this point in the history
  94. builtin rebase: call git am directly

    While the scripted `git rebase` still has to rely on the
    `git-rebase--am.sh` script to implement the glue between the `rebase`
    and the `am` commands, we can go a more direct route in the builtin
    rebase and avoid using a shell script altogether.
    
    This reduces the chances of Git for Windows running into trouble due to
    problems with the POSIX emulation layer (known as "MSYS2 runtime",
    itself a derivative of the Cygwin runtime): when no shell script is
    called, the POSIX emulation layer is avoided altogether.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    35d8b65 View commit details
    Browse the repository at this point in the history
  95. Merge 'ps/stash-in-c'

    This merges the builtin stash.
    
    Upstream Git did not integrate it into any stable integration branch
    yet, but the performance improvements are substantial enough,
    especially on Windows, that we really, really, really want to have it
    early.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    dba4358 View commit details
    Browse the repository at this point in the history
  96. Merge 'builtin-rebase--am'

    This patch teaches the builtin rebase to avoid the scripted --am backend
    and call `git format-patch` and `git am` directly.
    
    Meaning: apart from the --merge and the --preserve-merges backends, `git
    rebase` is now implemented in pure C, with no need to ask the Unix shell
    interpreter for help.
    
    This brings us really close to a fully builtin `git rebase`: the
    --preserve-merges mode is about to be deprecated (as soon as the
    --rebase-merges mode has proven stable and robust enough), and there are
    plans to scrap the `git-rebase--merge` backend in favor of teaching the
    interactive rebase enough tricks to run the --merge mode, too.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    ef0a72e View commit details
    Browse the repository at this point in the history
  97. Add back the original, scripted interactive rebase backend

    This simply copies the version as of v2.19.0-rc0 verbatim. As of now,
    it is not hooked up (because it needs a couple more changes to work);
    The next commit will use the scripted interactive rebase backend from
    `git rebase` again when `rebase.useBuiltin=false`.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    04eed6a View commit details
    Browse the repository at this point in the history
  98. non-builtin rebase: use non-builtin interactive backend

    We recently converted both the `git rebase` and the `git rebase -i`
    command from Unix shell scripts to builtins.
    
    The former has a safety valve allowing to fall back to the scripted
    `rebase`, just in case that there is a bug in the builtin `rebase`:
    setting the config variable `rebase.useBuiltin` to `false` will
    fall back to using the scripted version.
    
    The latter did not have such a safety hatch.
    
    Let's reinstate the scripted interactive rebase backend so that `rebase.useBuiltin=false` will not use the builtin interactive rebase,
    just in case that an end user runs into a bug with the builtin version
    and needs to get out of the fix really quickly.
    
    This is necessary because Git for Windows wants to ship the builtin
    rebase/interactive rebase earlier than core Git: Git for Windows
    v2.19.0 will come with the option of a drastically faster (if a lot
    less battle-tested) `git rebase`/`git rebase -i`.
    
    As the file name `git-rebase--interactive` is already in use, let's
    rename the scripted backend to `git-legacy-rebase--interactive`.
    
    A couple of additional touch-ups are needed (such as teaching the
    builtin `rebase--interactive`, which assumed the role of the
    `rebase--helper`, to perform the two tricks to skip the unnecessary
    picks and to generate a new todo list) to make things work again.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    d9a5e30 View commit details
    Browse the repository at this point in the history
  99. Merge branch 'make-builtin-stash-and-rebase-opt-ins'

    This branch adds back the scripted versions, then adds the option to
    use the builtin versions of `stash` and `rebase` by setting
    `stash.useBuiltin=true` and `rebase.useBuiltin=true`, respectively,
    (the latter already worked for the top-level `git rebase` command and
    the `--am` backend, and now it also works for the interactive backend).
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    ba0a77b View commit details
    Browse the repository at this point in the history
  100. t0001: fix on case-insensitive filesystems

    On a case-insensitive filesystem, such as HFS+ or NTFS, it is possible
    that the idea Bash has of the current directory differs in case from
    what Git thinks it is. That's totally okay, though, and we should not
    expect otherwise.
    
    Reported by Jameson Miller.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    d01b278 View commit details
    Browse the repository at this point in the history
  101. Merge branch 'ready-for-upstream'

    This is the branch thicket of patches in Git for Windows that are
    considered ready for upstream. To keep them in a ready-to-submit shape,
    they are kept as close to the beginning of the branch thicket as
    possible.
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    6db792c View commit details
    Browse the repository at this point in the history
  102. Merge branch 'gitk-and-git-gui-patches'

    These are Git for Windows' Git GUI and gitk patches. We will have to
    decide at some point what to do about them, but that's a little lower
    priority (as Git GUI seems to be unmaintained for the time being, and
    the gitk maintainer keeps a very low profile on the Git mailing list,
    too).
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    e9113df View commit details
    Browse the repository at this point in the history
  103. Merge branch 'msvc'

    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    jeffhostetler authored and dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    1085e81 View commit details
    Browse the repository at this point in the history
  104. Merge branch 'visual-studio'

    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    jeffhostetler authored and dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    f0a14e7 View commit details
    Browse the repository at this point in the history
  105. Merge branch 'fscache'

    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    a4acd7c View commit details
    Browse the repository at this point in the history
  106. Merge branch 'long-paths'

    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    dc2d604 View commit details
    Browse the repository at this point in the history
  107. Merge branch 'msys2'

    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    8102053 View commit details
    Browse the repository at this point in the history
  108. Configuration menu
    Copy the full SHA
    405b6a8 View commit details
    Browse the repository at this point in the history
  109. Merge pull request git-for-windows#1897 from piscisaureus/symlink-attr

    Specify symlink type in .gitattributes
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    36adb85 View commit details
    Browse the repository at this point in the history
  110. Merge branch 'program-data-config'

    This branch introduces support for reading the "Windows-wide" Git
    configuration from `%PROGRAMDATA%\Git\config`. As these settings are
    intended to be shared between *all* Git-related software, that config
    file takes an even lower precedence than `$(prefix)/etc/gitconfig`.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    592b4a9 View commit details
    Browse the repository at this point in the history
  111. Merge pull request microsoft#305 from dscho/msysgit_issues_182

    Allow `add -p` and `add -i` with a large number of files
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    0692990 View commit details
    Browse the repository at this point in the history
  112. Merge branch 'clean-long-paths'

    This addresses git-for-windows#521
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    a2975af View commit details
    Browse the repository at this point in the history
  113. Merge branch 'spawn-with-spaces'

    This change lets us spawn .bat scripts whose paths contain spaces.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    31d8440 View commit details
    Browse the repository at this point in the history
  114. Merge pull request git-for-windows#994 from jeffhostetler/jeffhostetl…

    …er/fscache_nfd
    
    fscache: add not-found directory cache to fscache
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    4e5cb14 View commit details
    Browse the repository at this point in the history
  115. Merge branch 'core-longpaths-everywhere'

    Git for Windows supports the core.longPaths config setting to allow
    writing/reading long paths via the \\?\ trick for a long time now.
    
    However, for that support to work, it is absolutely necessary that
    git_default_config() is given a chance to parse the config. Otherwise
    Git will be non the wiser.
    
    So let's make sure that as many commands that previously failed to
    parse the core.* settings now do that, implicitly enabling long path
    support in a lot more places.
    
    Note: this is not a perfect solution, and it cannot be, as there is
    a chicken-and-egg problem in reading the config itself...
    
    This fixes git-for-windows#1218
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    4b53397 View commit details
    Browse the repository at this point in the history
  116. Merge pull request git-for-windows#971 from jeffhostetler/jeffhostetl…

    …er/add_preload_fscache
    
    add: use preload-index and fscache for performance
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    968bdfd View commit details
    Browse the repository at this point in the history
  117. Merge pull request git-for-windows#1344 from jeffhostetler/perf_add_e…

    …xcludes_with_fscache
    
    dir.c: make add_excludes aware of fscache during status
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    cd673f0 View commit details
    Browse the repository at this point in the history
  118. Merge pull request git-for-windows#1426 from atetubou/fetch_pack

    fetch-pack.c: enable fscache for stats under .git/objects
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    ba3dd8c View commit details
    Browse the repository at this point in the history
  119. Merge pull request git-for-windows#1468 from atetubou/fscache_checkou…

    …t_flush
    
    checkout.c: enable fscache for checkout again
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    9926f51 View commit details
    Browse the repository at this point in the history
  120. Merge pull request git-for-windows#1827 from benpeart/fscache_refresh…

    …_index
    
    Enable the filesystem cache (fscache) in refresh_index().
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    4a5f17f View commit details
    Browse the repository at this point in the history
  121. Merge 'docker-volumes-are-no-symlinks'

    This was pull request git-for-windows#1645 from ZCube/master
    
    Support windows container.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    6b69250 View commit details
    Browse the repository at this point in the history
  122. Merge branch 'status-no-lock-index'

    This branch allows third-party tools to call `git status
    --no-lock-index` to avoid lock contention with the interactive Git usage
    of the actual human user.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    9bbf3ff View commit details
    Browse the repository at this point in the history
  123. Merge pull request git-for-windows#1354 from dscho/phase-out-show-ign…

    …ored-directory-gracefully
    
    Phase out `--show-ignored-directory` gracefully
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    f371bb2 View commit details
    Browse the repository at this point in the history
  124. Merge branch 'fsync-object-files-always'

    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    a72b117 View commit details
    Browse the repository at this point in the history
  125. Merge pull request git-for-windows#1170 from dscho/mingw-kill-process

    Handle Ctrl+C in Git Bash nicely
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    4268a9c View commit details
    Browse the repository at this point in the history
  126. Merge branch 'inherit-only-stdhandles'

    When spawning child processes, we do want them to inherit the standard
    handles so that we can talk to them. We do *not* want them to inherit
    any other handle, as that would hold a lock to the respective files
    (preventing them from being renamed, modified or deleted), and the child
    process would not know how to access that handle anyway.
    
    Happily, there is an API to make that happen. It is supported in Windows
    Vista and later, which is exactly what we promise to support in Git for
    Windows for the time being.
    
    This also means that we lift, at long last, the target Windows version
    from Windows XP to Windows Vista.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    fc791ae View commit details
    Browse the repository at this point in the history
  127. Merge branch 'busybox-w32'

    This topic branch brings slightly experimental changes supporting Git
    for Windows to use BusyBox-w32 to execute its shell scripts as well as
    its test suite.
    
    The test suite can be run by installing the test artifacts into a MinGit
    that has busybox.exe (and using Git for Windows' SDK's Perl for now, as
    the test suite requires Perl even when NO_PERL is set, go figure) by
    using the `install-mingit-test-artifacts` Makefile target with the
    DESTDIR variable pointing to the top-level directory of the MinGit
    installation.
    
    To facilitate running the test suite (without having `make` available,
    as `make.exe` is not part of MinGit), this branch brings an experimental
    patch to the `test-run-command` helper to run Git's test suite. It is
    still very experimental, though: in this developer's tests it seemed
    that the `poll()` emulation required for `run_parallel_processes()` to
    work sometimes hiccups on Windows, causing infinite "hangs". It is also
    possible that BusyBox itself has problems writing to the pipes opened by
    `test-run-command` (and merging this branch will help investigate
    further). Caveat emptor.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    1138dc2 View commit details
    Browse the repository at this point in the history
  128. Merge branch 'fix-terminal-prompt'

    This fixes the issue identified in
    
    	git-for-windows#1498
    
    where Git would not fall back to reading credentials from a Win32
    Console when the credentials could not be read from the terminal via the
    Bash hack (that is necessary to support running in a MinTTY).
    
    Tested in a Powershell window.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    ef66be4 View commit details
    Browse the repository at this point in the history
  129. Merge 'readme' into HEAD

    Add a README.md for GitHub goodness.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    98a28b5 View commit details
    Browse the repository at this point in the history
  130. Merge 'builtin-stash-rebase-v3'

    To avoid having to play tricks as in earlier rounds, we bit the sour
    apple and rebased the `builtin-stash-rebase-v3` branch thicket onto the
    commit starting Git for Windows' merging-rebase.
    
    (The merging-rebase pulls in the previous branch thicket via a "fake
    merge", i.e. a merge commit that does not actually apply any changes
    from the merged commit history. This has the unfortunate side effect of
    confusing `merge` into thinking that any branch that was merged into an
    earlier round does not need to be merged again.)
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    jamill authored and dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    7784b9d View commit details
    Browse the repository at this point in the history
  131. Merge pull request git-for-windows#1859 from dscho/funny-cased-cwd

    Fix t0001 when the current working directory differs in case from the canonical form
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    637f39d View commit details
    Browse the repository at this point in the history
  132. fscache: use FindFirstFileExW to avoid retrieving the short name

    Use FindFirstFileExW with FindExInfoBasic to avoid forcing NTFS to look up
    the short name.  Also switch to a larger (64K vs 4K) buffer using
    FIND_FIRST_EX_LARGE_FETCH to minimize round trips to the kernel.
    
    In a repo with ~200K files, this drops warm cache status times from 3.19
    seconds to 2.67 seconds for a 16% savings.
    
    Signed-off-by: Ben Peart <benpeart@microsoft.com>
    benpeart authored and dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    2160075 View commit details
    Browse the repository at this point in the history
  133. status: disable and free fscache at the end of the status command

    At the end of the status command, disable and free the fscache so that we
    don't leak the memory and so that we can dump the fscache statistics.
    
    Signed-off-by: Ben Peart <benpeart@microsoft.com>
    benpeart authored and dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    364a814 View commit details
    Browse the repository at this point in the history
  134. fscache: add GIT_TEST_FSCACHE support

    Add support to fscache to enable running the entire test suite with the
    fscache enabled.
    
    Signed-off-by: Ben Peart <benpeart@microsoft.com>
    benpeart authored and dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    d499d08 View commit details
    Browse the repository at this point in the history
  135. At the end of the add command, disable and free the fscache so that w…

    …e don't
    
    leak the memory and so that we can dump the fscache statistics.
    
    Signed-off-by: Ben Peart <benpeart@microsoft.com>
    benpeart authored and dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    aae1e18 View commit details
    Browse the repository at this point in the history
  136. fscache: add fscache hit statistics

    Track fscache hits and misses for lstat and opendir requests.  Reporting of
    statistics is done when the cache is disabled for the last time and freed
    and is only reported if GIT_TRACE_FSCACHE is set.
    
    Sample output is:
    
    11:33:11.836428 compat/win32/fscache.c:433 fscache: lstat 3775, opendir 263, total requests/misses 4052/269
    
    Signed-off-by: Ben Peart <benpeart@microsoft.com>
    benpeart authored and dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    bfbe537 View commit details
    Browse the repository at this point in the history
  137. mem_pool: add GIT_TRACE_MEMPOOL support

    Add tracing around initializing and discarding mempools. In discard report
    on the amount of memory unused in the current block to help tune setting
    the initial_size.
    
    Signed-off-by: Ben Peart <benpeart@microsoft.com>
    benpeart authored and dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    ef63b3f View commit details
    Browse the repository at this point in the history
  138. fscache: fscache takes an initial size

    Update enable_fscache() to take an optional initial size parameter which is
    used to initialize the hashmap so that it can avoid having to rehash as
    additional entries are added.
    
    Add a separate disable_fscache() macro to make the code clearer and easier
    to read.
    
    Signed-off-by: Ben Peart <benpeart@microsoft.com>
    benpeart authored and dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    51fa7b9 View commit details
    Browse the repository at this point in the history
  139. fscache: update fscache to be thread specific instead of global

    The threading model for fscache has been to have a single, global cache.
    This puts requirements on it to be thread safe so that callers like
    preload-index can call it from multiple threads.  This was implemented
    with a single mutex and completion events which introduces contention
    between the calling threads.
    
    Simplify the threading model by making fscache thread specific.  This allows
    us to remove the global mutex and synchronization events entirely and instead
    associate a fscache with every thread that requests one. This works well with
    the current multi-threading which divides the cache entries into blocks with
    a separate thread processing each block.
    
    At the end of each worker thread, if there is a fscache on the primary
    thread, merge the cached results from the worker into the primary thread
    cache. This enables us to reuse the cache later especially when scanning for
    untracked files.
    
    In testing, this reduced the time spent in preload_index() by about 25% and
    also reduced the CPU utilization significantly.  On a repo with ~200K files,
    it reduced overall status times by ~12%.
    
    Signed-off-by: Ben Peart <benpeart@microsoft.com>
    benpeart authored and dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    1c973df View commit details
    Browse the repository at this point in the history
  140. fscache: teach fscache to use mempool

    Now that the fscache is single threaded, take advantage of the mem_pool as
    the allocator to significantly reduce the cost of allocations and frees.
    
    With the reduced cost of free, in future patches, we can start freeing the
    fscache at the end of commands instead of just leaking it.
    
    Signed-off-by: Ben Peart <benpeart@microsoft.com>
    benpeart authored and dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    4d0a394 View commit details
    Browse the repository at this point in the history
  141. Merge pull request git-for-windows#1908 from benpeart/FindFirstFileEx…

    …-gfw
    
    fscache: use FindFirstFileExW to avoid retrieving the short name
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    e986fe1 View commit details
    Browse the repository at this point in the history
  142. Merge pull request git-for-windows#1909 from benpeart/free-fscache-af…

    …ter-status-gfw
    
    status: disable and free fscache at the end of the status command
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    f1a0a9c View commit details
    Browse the repository at this point in the history
  143. Merge pull request git-for-windows#1911 from benpeart/git_test_fscach…

    …e-gfw
    
    fscache: add GIT_TEST_FSCACHE support
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    0209632 View commit details
    Browse the repository at this point in the history
  144. Merge pull request git-for-windows#1914 from benpeart/free-fscache-af…

    …ter-add-gfw
    
    At the end of the add command, disable and free the fscache
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    5d0267b View commit details
    Browse the repository at this point in the history
  145. Merge pull request git-for-windows#1910 from benpeart/fscache_statist…

    …ics-gfw
    
    fscache: add fscache hit statistics
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    a7a949e View commit details
    Browse the repository at this point in the history
  146. Merge remote-tracking branch 'benpeart/fscache-per-thread-gfw'

    This brings substantial wins in performance because the FSCache is now
    per-thread, being merged to the primary thread only at the end, so we do
    not have to lock (except while merging).
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    fb2fe7f View commit details
    Browse the repository at this point in the history
  147. mingw: add a helper function to attach GDB to the current process

    When debugging Git, the criss-cross spawning of processes can make
    things quite a bit difficult, especially when a Unix shell script is
    thrown in the mix that calls a `git.exe` that then segfaults.
    
    To help debugging such things, we introduce the `open_in_gdb()` function
    which can be called at a code location where the segfault happens (or as
    close as one can get); This will open a new MinTTY window with a GDB
    that already attached to the current process.
    
    Inspired by Derrick Stolee.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    52d7824 View commit details
    Browse the repository at this point in the history
  148. mingw: remove obsolete IPv6-related code

    To support IPv6, Git provided fall back functions for Windows versions that
    did not support IPv6. However, as Git dropped support for Windows XP and
    prior, those functions are not needed anymore.
    
    Removed those fallbacks by reverting commit[1] and using the functions
    directly (without 'ipv6_' prefix).
    
    [1] fe3b2b7.
    
    Signed-off-by: tanushree27 <tanushreetumane@gmail.com>
    tanushree27 authored and dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    4cbcc02 View commit details
    Browse the repository at this point in the history
  149. fscache: make fscache_enable() thread safe

    The recent change to make fscache thread specific relied on fscache_enable()
    being called first from the primary thread before being called in parallel
    from worker threads.  Make that more robust and protect it with a critical
    section to avoid any issues.
    
    Helped-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    Signed-off-by: Ben Peart <benpeart@microsoft.com>
    benpeart authored and dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    5033536 View commit details
    Browse the repository at this point in the history
  150. fscache: teach fscache to use NtQueryDirectoryFile

    Using FindFirstFileExW() requires the OS to allocate a 64K buffer for each
    directory and then free it when we call FindClose().  Update fscache to call
    the underlying kernel API NtQueryDirectoryFile so that we can do the buffer
    management ourselves.  That allows us to allocate a single buffer for the
    lifetime of the cache and reuse it for each directory.
    
    This change improves performance of 'git status' by 18% in a repo with ~200K
    files and 30k folders.
    
    Documentation for NtQueryDirectoryFile can be found at:
    
    https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/content/ntifs/nf-ntifs-ntquerydirectoryfile
    https://docs.microsoft.com/en-us/windows/desktop/FileIO/file-attribute-constants
    https://docs.microsoft.com/en-us/windows/desktop/fileio/reparse-point-tags
    
    To determine if the specified directory is a symbolic link, inspect the
    FileAttributes member to see if the FILE_ATTRIBUTE_REPARSE_POINT flag is
    set. If so, EaSize will contain the reparse tag (this is a so far
    undocumented feature, but confirmed by the NTFS developers). To
    determine if the reparse point is a symbolic link (and not some other
    form of reparse point), test whether the tag value equals the value
    IO_REPARSE_TAG_SYMLINK.
    
    Signed-off-by: Ben Peart <benpeart@microsoft.com>
    benpeart authored and dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    842a845 View commit details
    Browse the repository at this point in the history
  151. Merge pull request git-for-windows#1915 from dscho/open-in-gdb

    Add a helper function to start GDB that was already attached to the current process
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    0265f6b View commit details
    Browse the repository at this point in the history
  152. Merge pull request git-for-windows#1900 from tanushree27/remove-ipv6-…

    …fallback
    
    [Outreachy] Removed ipv6 fallback
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    a750df8 View commit details
    Browse the repository at this point in the history
  153. mingw: fix CPU reporting in git version --build-options

    We cannot rely on `uname -m` in Git for Windows' SDK to tell us what
    architecture we are compiling for, as we can compile both 32-bit and
    64-bit `git.exe` from a 64-bit SDK, but the `uname -m` in that SDK will
    always report `x86_64`.
    
    So let's go back to our original design. And make it explicitly
    Windows-specific.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    d69faaa View commit details
    Browse the repository at this point in the history
  154. Merge pull request git-for-windows#1934 from benpeart/fscache-thread-…

    …safe-enable-gfw
    
    fscache: make fscache_enable() thread safe
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    5487204 View commit details
    Browse the repository at this point in the history
  155. Merge pull request git-for-windows#1937 from benpeart/fscache-NtQuery…

    …DirectoryFile-gfw
    
     fscache: teach fscache to use NtQueryDirectoryFile
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    a2e7571 View commit details
    Browse the repository at this point in the history
  156. mingw: use ANSI or Unicode functions explicitly

    For many Win32 functions, there actually exist two variants: one with
    the `A` suffix that takes ANSI parameters (`char *` or `const char *`)
    and one with the `W` suffix that takes Unicode parameters (`wchar_t *`
    or `const wchar_t *`).
    
    Let's be precise what we want to use.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    02bcbfc View commit details
    Browse the repository at this point in the history
  157. Merge pull request git-for-windows#1958 from dscho/ansi-unicode

    mingw: safeguard against compiling with `-DUNICODE`
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    f4d245d View commit details
    Browse the repository at this point in the history
  158. http: add support selecting http version

    Usually we don't need to set libcurl to choose which version of the
    HTTP protocol to use to communicate with a server.
    But different versions of libcurl, the default value is not the same.
    
    CURL >= 7.62.0: CURL_HTTP_VERSION_2TLS
    CURL < 7.62: CURL_HTTP_VERSION_1_1
    
    In order to give users the freedom to control the HTTP version,
    we need to add a setting to choose which HTTP version to use.
    
    Signed-off-by: Force Charlie <charlieio@outlook.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    fcharlie authored and dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    e313ac7 View commit details
    Browse the repository at this point in the history
  159. Merge pull request git-for-windows#1968 from dscho/http-version

    http: add support selecting http version
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    6581cff View commit details
    Browse the repository at this point in the history
  160. fixup! stash: convert apply to builtin

    Pointed out by our cocci job.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 9, 2018
    Configuration menu
    Copy the full SHA
    9515583 View commit details
    Browse the repository at this point in the history

Commits on Dec 10, 2018

  1. pager: fix order of atexit() calls

    This is just a bug fix to git so that the pager won't close stdin/out
    before other atexit functions run. The easy way to repro the bug is to
    turn on GIT_TRACE_PERFORMANCE and run a command that runs the pager. Then
    notice you don't get your performance data at the end. With this fix, you
    do actually get the performance trace data.
    
    Signed-off-by: Ben Peart <Ben.Peart@microsoft.com>
    Ben Peart authored and dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    c7989fe View commit details
    Browse the repository at this point in the history
  2. reset --stdin: trim carriage return from the paths

    While using the reset --stdin feature on windows path added may have a
    \r at the end of the path that wasn't getting removed so didn't match
    the path in the index and wasn't reset.
    
    Signed-off-by: Kevin Willford <kewillf@microsoft.com>
    Kevin Willford authored and dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    d18382f View commit details
    Browse the repository at this point in the history
  3. Merge 'gvfs-preamble' into HEAD

    dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    4f86ed7 View commit details
    Browse the repository at this point in the history
  4. gvfs: start by adding the -gvfs suffix to the version

    Signed-off-by: Saeed Noursalehi <sanoursa@microsoft.com>
    sanoursa authored and dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    962c486 View commit details
    Browse the repository at this point in the history
  5. sparse-checkout: update files with a modify/delete conflict

    When using the sparse-checkout feature, the file might not be on disk
    because the skip-worktree bit is on.
    
    Signed-off-by: Kevin Willford <kewillf@microsoft.com>
    Kevin Willford authored and dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    dbe47e5 View commit details
    Browse the repository at this point in the history
  6. sparse-checkout: avoid writing entries with the skip-worktree bit

    When using the sparse-checkout feature git should not write to the working
    directory for files with the skip-worktree bit on.  With the skip-worktree
    bit on the file may or may not be in the working directory and if it is
    not we don't want or need to create it by calling checkout_entry.
    
    There are two callers of checkout_target.  Both of which check that the
    file does not exist before calling checkout_target.  load_current which
    make a call to lstat right before calling checkout_target and
    check_preimage which will only run checkout_taret it stat_ret is less than
    zero.  It sets stat_ret to zero and only if !stat->cached will it lstat
    the file and set stat_ret to something other than zero.
    
    This patch checks if skip-worktree bit is on in checkout_target and just
    returns so that the entry doesn't not end up in the working directory.
    This is so that apply will not create a file in the working directory,
    then update the index but not keep the working directory up to date with
    the changes that happened in the index.
    
    Signed-off-by: Kevin Willford <kewillf@microsoft.com>
    Kevin Willford authored and dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    2f03132 View commit details
    Browse the repository at this point in the history
  7. Fix reset when using the sparse-checkout feature.

    When using the sparse checkout feature the git reset command will add
    entries to the index that will have the skip-worktree bit off but will
    leave the working directory empty.  File data is lost because the index
    version of the files has been changed but there is nothing that is in
    the working directory.  This will cause the next status call to show
    either deleted for files modified or deleting or nothing for files
    added.  The added files should be shown as untracked and modified files
    should be shown as modified.
    
    To fix this when the reset is running if there is not a file in the
    working directory and if it will be missing with the new index entry or
    was not missing in the previous version, we create the previous index
    version of the file in the working directory so that status will report
    correctly and the files will be availble for the user to deal with.
    
    Signed-off-by: Kevin Willford <kewillf@microsoft.com>
    Kevin Willford authored and dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    f7203f8 View commit details
    Browse the repository at this point in the history
  8. fsck: use ERROR_MULTI_PACK_INDEX

    The multi-pack-index was added to the data verified by git-fsck in
    ea5ae6c "fsck: verify multi-pack-index". This implementation was
    based on the implementation for verifying the commit-graph, and a
    copy-paste error kept the ERROR_COMMIT_GRAPH flag as the bit set
    when an error appears in the multi-pack-index.
    
    Add a new flag, ERROR_MULTI_PACK_INDEX, and use that instead.
    
    Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
    derrickstolee authored and dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    7f99db2 View commit details
    Browse the repository at this point in the history
  9. gvfs: ensure that the version is based on a GVFS tag

    Signed-off-by: Johannes Schindelin <johasc@microsoft.com>
    dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    ca75317 View commit details
    Browse the repository at this point in the history
  10. gvfs: add a GVFS-specific header file

    This header file will accumulate GVFS-specific definitions.
    
    Signed-off-by: Kevin Willford <kewillf@microsoft.com>
    Kevin Willford authored and dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    186c9da View commit details
    Browse the repository at this point in the history
  11. gvfs: add the core.gvfs config setting

    This does not do anything yet. The next patches will add various values
    for that config setting that correspond to the various features
    offered/required by GVFS.
    
    Signed-off-by: Kevin Willford <kewillf@microsoft.com>
    Kevin Willford authored and dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    a6e94dd View commit details
    Browse the repository at this point in the history
  12. gvfs: add the feature to skip writing the index' SHA-1

    This takes a substantial amount of time, and if the user is reasonably
    sure that the files' integrity is not compromised, that time can be saved.
    
    Git no longer verifies the SHA-1 by default, anyway.
    
    Signed-off-by: Kevin Willford <kewillf@microsoft.com>
    Kevin Willford authored and dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    4ac26d8 View commit details
    Browse the repository at this point in the history
  13. gvfs: add the feature that blobs may be missing

    Signed-off-by: Kevin Willford <kewillf@microsoft.com>
    Kevin Willford authored and dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    09be583 View commit details
    Browse the repository at this point in the history
  14. Add a new run_hook_argv() function

    The two existing members of the run_hook*() family, run_hook_ve() and
    run_hook_le(), are good for callers that know the precise number of
    parameters already. Let's introduce a new sibling that takes an argv
    array for callers that want to pass a variable number of parameters.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    6a0e1ba View commit details
    Browse the repository at this point in the history
  15. gvfs: prevent files to be deleted outside the sparse checkout

    Prevent the sparse checkout to delete files that were marked with
    skip-worktree bit and are not in the sparse-checkout file.
    
    This is because everything with the skip-worktree bit turned on is being
    virtualized and will be removed with the change of HEAD.
    
    There was only one failing test when running with these changes that was
    checking to make sure the worktree narrows on checkout which was
    expected since we would no longer be narrowing the worktree.
    
    Signed-off-by: Kevin Willford <kewillf@microsoft.com>
    Kevin Willford authored and dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    ac7b245 View commit details
    Browse the repository at this point in the history
  16. gvfs: allow "virtualizing" objects

    The idea is to allow blob objects to be missing from the local repository,
    and to load them lazily on demand.
    
    After discussing this idea on the mailing list, we will rename the feature
    to "lazy clone" and work more on this.
    
    Signed-off-by: Ben Peart <Ben.Peart@microsoft.com>
    Ben Peart authored and dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    940d6b0 View commit details
    Browse the repository at this point in the history
  17. gvfs: optionally skip reachability checks/upload pack during fetch

    While performing a fetch with a virtual file system we know that there
    will be missing objects and we don't want to download them just because
    of the reachability of the commits.  We also don't want to download a
    pack file with commits, trees, and blobs since these will be downloaded
    on demand.
    
    This flag will skip the first connectivity check and by returning zero
    will skip the upload pack. It will also skip the second connectivity
    check but continue to update the branches to the latest commit ids.
    
    Signed-off-by: Kevin Willford <kewillf@microsoft.com>
    Kevin Willford authored and dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    7b0b2e0 View commit details
    Browse the repository at this point in the history
  18. Hydrate missing loose objects in check_and_freshen()

    Hydrate missing loose objects in check_and_freshen() when running
    virtualized. Add test cases to verify read-object hook works when
    running virtualized.
    
    This hook is called in check_and_freshen() rather than
    check_and_freshen_local() to make the hook work also with alternates.
    
    Helped-by: Kevin Willford <kewillf@microsoft.com>
    Signed-off-by: Ben Peart <Ben.Peart@microsoft.com>
    Ben Peart authored and dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    ec72be5 View commit details
    Browse the repository at this point in the history
  19. gvfs: ensure all filters and EOL conversions are blocked

    Ensure all filters and EOL conversions are blocked when running under
    GVFS so that our projected file sizes will match the actual file size
    when it is hydrated on the local machine.
    
    Signed-off-by: Ben Peart <Ben.Peart@microsoft.com>
    Ben Peart authored and dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    333e48f View commit details
    Browse the repository at this point in the history
  20. gvfs: add global command pre and post hook procs

    This adds hard-coded call to GVFS.hooks.exe before and after each Git
    command runs.
    
    To make sure that this is only called on repositories cloned with GVFS, we
    test for the tell-tale .gvfs.
    
    Signed-off-by: Ben Peart <Ben.Peart@microsoft.com>
    Ben Peart authored and dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    e2d9dad View commit details
    Browse the repository at this point in the history
  21. Allow hooks to be run before setup_git_directory()

    The use case here is to allow usage statistics to be gathered by
    running hooks before and after every hook, and to make that
    configurable via hooks.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    28d6fcf View commit details
    Browse the repository at this point in the history
  22. gvfs: introduce pre/post command hooks

    GVFS Git introduced pre-command and post-command hooks, to gather usage
    statistics and to be able to adjust the worktree if necessary.
    
    As run_hooks() implicitly calls setup_git_directory(), and that
    function does surprising things to the global state (sometimes even
    changing the current working directory), it cannot be used here.
    
    This commit introduces the pre-command/post-command hooks, based on
    the previous patches that culminate in support for running hooks early,
    i.e. before setup_git_directory() was called.
    
    Signed-off-by: Ben Peart <Ben.Peart@microsoft.com>
    Ben Peart authored and dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    88245cc View commit details
    Browse the repository at this point in the history
  23. Add support for read-object as a background process to retrieve missi…

    …ng objects
    
    This commit converts the existing read_object hook proc model for
    downloading missing blobs to use a background process that is started
    the first time git encounters a missing blob and stays running until git
    exits.  Git and the read-object process communicate via stdin/stdout and
    a versioned, capability negotiated interface as documented in
    Documentation/technical/read-object-protocol.txt.  The advantage of this
    over the previous hook proc is that it saves the overhead of spawning a
    new hook process for every missing blob.
    
    The model for the background process was refactored from the recent git
    LFS work.  I refactored that code into a shared module (sub-process.c/h)
    and then updated convert.c to consume the new library.  I then used the
    same sub-process module when implementing the read-object background
    process.
    
    Signed-off-by: Ben Peart <Ben.Peart@microsoft.com>
    Ben Peart authored and dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    ce8f580 View commit details
    Browse the repository at this point in the history
  24. t0400: verify that the hook is called correctly from a subdirectory

    Suggested by Ben Peart.
    
    Signed-off-by: Johannes Schindelin <johasc@microsoft.com>
    dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    c60a6f5 View commit details
    Browse the repository at this point in the history
  25. sha1_file: when writing objects, skip the read_object_hook

    If we are going to write an object there is no use in calling
    the read object hook to get an object from a potentially remote
    source.  We would rather just write out the object and avoid the
    potential round trip for an object that doesn't exist.
    
    This change adds a flag to the check_and_freshen() and
    freshen_loose_object() functions' signatures so that the hook
    is bypassed when the functions are called before writing loose
    objects. The check for a local object is still performed so we
    don't overwrite something that has already been written to one
    of the objects directories.
    
    Based on a patch by Kevin Willford.
    
    Signed-off-by: Johannes Schindelin <johasc@microsoft.com>
    dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    56d891c View commit details
    Browse the repository at this point in the history
  26. Pass PID of git process to hooks.

    Signed-off-by: Alejandro Pauly <alpauly@microsoft.com>
    alepauly authored and dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    9dafe07 View commit details
    Browse the repository at this point in the history
  27. Configuration menu
    Copy the full SHA
    5c6d739 View commit details
    Browse the repository at this point in the history
  28. pre-command: always respect core.hooksPath

    We need to respect that config setting even if we already know that we
    have a repository, but have not yet read the config.
    
    The regression test was written by Alejandro Pauly.
    
    Signed-off-by: Johannes Schindelin <johasc@microsoft.com>
    dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    5ef0cf2 View commit details
    Browse the repository at this point in the history
  29. Configuration menu
    Copy the full SHA
    d9dd272 View commit details
    Browse the repository at this point in the history
  30. Configuration menu
    Copy the full SHA
    bf4b74b View commit details
    Browse the repository at this point in the history
  31. Do not remove files outside the sparse-checkout

    Signed-off-by: Kevin Willford <kewillf@microsoft.com>
    Kevin Willford authored and dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    fee970c View commit details
    Browse the repository at this point in the history
  32. gvfs: refactor loading the core.gvfs config value

    This code change makes sure that the config value for core_gvfs
    is always loaded before checking it.
    
    Signed-off-by: Kevin Willford <kewillf@microsoft.com>
    Kevin Willford authored and dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    c84dffd View commit details
    Browse the repository at this point in the history
  33. status: add status serialization mechanism

    Teach STATUS to optionally serialize the results of a
    status computation to a file.
    
    Teach STATUS to optionally read an existing serialization
    file and simply print the results, rather than actually
    scanning.
    
    This is intended for immediate status results on extremely
    large repos and assumes the use of a service/daemon to
    maintain a fresh current status snapshot.
    
    Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
    jeffhostetler authored and dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    bba9922 View commit details
    Browse the repository at this point in the history
  34. cache-tree: remove use of strbuf_addf in update_one

    String formatting can be a performance issue when there are
    hundreds of thousands of trees.
    
    Change to stop using the strbuf_addf and just add the strings
    or characters individually.
    
    There are a limited number of modes so added a switch for the
    known ones and a default case if something comes through that
    are not a known one for git.
    
    In one scenario regarding a huge worktree, this reduces the
    time required for a `git checkout <branch>` from 44 seconds
    to 38 seconds, i.e. it is a non-negligible performance
    improvement.
    
    Signed-off-by: Kevin Willford <kewillf@microsoft.com>
    Kevin Willford authored and dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    060001e View commit details
    Browse the repository at this point in the history
  35. status: add status.aheadbehind setting

    Add "status.aheadbehind" config setting to change the default
    behavior of ALL git status formats.
    
    Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
    jeffhostetler authored and dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    0814630 View commit details
    Browse the repository at this point in the history
  36. Configuration menu
    Copy the full SHA
    d614310 View commit details
    Browse the repository at this point in the history
  37. Configuration menu
    Copy the full SHA
    5c2879f View commit details
    Browse the repository at this point in the history
  38. status: add warning when a/b calculation takes too long for long/norm…

    …al format
    
    Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
    jeffhostetler authored and dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    2d89233 View commit details
    Browse the repository at this point in the history
  39. status: ignore status.aheadbehind in porcelain formats

    Teach porcelain V[12] formats to ignore the status.aheadbehind
    config setting. They only respect the --[no-]ahead-behind
    command line argument.  This is for backwards compatibility
    with existing scripts.
    
    Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
    jeffhostetler authored and dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    ed7391f View commit details
    Browse the repository at this point in the history
  40. status: serialize to path

    Teach status serialization to take an optional pathname on
    the command line to direct that cache data be written there
    rather than to stdout.  When used this way, normal status
    results will still be written to stdout.
    
    When no path is given, only binary serialization data is
    written to stdout.
    
    Usage:
        git status --serialize[=<path>]
    
    Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
    jeffhostetler authored and dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    e0e928f View commit details
    Browse the repository at this point in the history
  41. status: reject deserialize in V2 and conflicts

    Teach status deserialize code to reject status cache
    when printing in porcelain V2 and there are unresolved
    conflicts in the cache file.  A follow-on task might
    extend the cache format to include this additiona data.
    
    See code for longer explanation.
    
    Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
    jeffhostetler authored and dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    9680d7f View commit details
    Browse the repository at this point in the history
  42. fetch: Warn about forced updates after branch list

    Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
    derrickstolee authored and dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    32d774f View commit details
    Browse the repository at this point in the history
  43. fetch: Add --[no-]show-forced-updates argument

    Also include fetch.showForcedUpdates config setting that is overridden
    by the command-line arguments. Shows a warning when skipping the work.
    
    Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
    derrickstolee authored and dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    e6b90e1 View commit details
    Browse the repository at this point in the history
  44. Configuration menu
    Copy the full SHA
    d43dec5 View commit details
    Browse the repository at this point in the history
  45. Configuration menu
    Copy the full SHA
    c452ae4 View commit details
    Browse the repository at this point in the history
  46. fetch: add documentation for --[no-]show-forced-updates

    Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
    derrickstolee authored and dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    c6feda7 View commit details
    Browse the repository at this point in the history
  47. Configuration menu
    Copy the full SHA
    9f52fe4 View commit details
    Browse the repository at this point in the history
  48. Add virtual file system settings and hook proc

    On index load, clear/set the skip worktree bits based on the virtual
    file system data. Use virtual file system data to update skip-worktree
    bit in unpack-trees. Use virtual file system data to exclude files and
    folders not explicitly requested.
    
    Signed-off-by: Ben Peart <benpeart@microsoft.com>
    benpeart authored and dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    c2ea892 View commit details
    Browse the repository at this point in the history
  49. Merge 'forced-updates-after-branch-list'

    Move the warning about `--[no-]show-forced-updates` to the end of the
    branch update list. Also, show a different message when a lot of time is
    spent walking the commits. (Note, this time will not include the loose
    object downloads for the tip commits, but may include some loose object
    downloads for the reachable commits.)
    dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    48a26f5 View commit details
    Browse the repository at this point in the history
  50. Update the virtualfilesystem support

    We now specify that it needs to be run from the root of the git work
    tree. This enables the hook to be found even if the current working
    directory is not the root of the repo (like when running 'git diff' with
    Beyond Compare configured as the diff tool.
    
    Also simpify how argv[] parameter is created.
    
    Signed-off-by: Ben Peart <benpeart@microsoft.com>
    benpeart authored and dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    df015a5 View commit details
    Browse the repository at this point in the history
  51. Merge 'virtual-file-system-support'

    Add virtual file system settings and hook proc.  On index load,
    clear/set the skip worktree bits based on the virtual file system data.
    Use virtual file system data to update skip-worktree bit in
    unpack-trees. Use virtual file system data to exclude files and folders
    not explicitly requested.
    
    Signed-off-by: Ben Peart <Ben.Peart@microsoft.com>
    dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    ea9855f View commit details
    Browse the repository at this point in the history
  52. commit: add generation to pop_most_recent_commit()

    The method pop_most_recent_commit() is confusingly named, in that it
    pops the most-recent commit, but also adds that commit's parents to
    the list. This is used by a few commit walks, especially the one in
    ref_newer(). 'git push' uses ref_newer() to check if a force-push is
    necessary, and in the case of a force-push being needed, the current
    algorithm walks every reachable commit. This is especially severe in
    the case of an amended commit: they have the same parent, but we still
    walk to the very end of the graph!
    
    Add a 'min_generation' parameter to pop_most_recent_commit() to limit
    the commits that are walked to those with generation number at least
    'min_generation'. This greatly reduces the number of commits walked by
    a force-push.
    
    There may be more work to improve this algorithm in the future, but for
    now this is enough for most cases. This direction has the benefit that
    it does not affect the non-force-push case at all. Future directions
    should consider improving that case as well.
    
    Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
    derrickstolee authored and dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    fa16bc0 View commit details
    Browse the repository at this point in the history
  53. Merge 'update/virtual-file-system'

    Update the virtualfilesystem support to specify it needs to be run from
    the root of the git work tree. This enables the hook to be found even if
    the current working directory is not the root of the repo (like when
    running 'git diff' with Beyond Compare configured as the diff tool).
    
    Also simplify how argv[] parameter is created to match the model
    currently accepted in master.
    dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    bbb9293 View commit details
    Browse the repository at this point in the history
  54. Merge 'gvfs/ds/generation-numbers-update'

    Revert the previous commits involving generation numbers and apply the
    commits that are in upstream `next`.
    dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    2926617 View commit details
    Browse the repository at this point in the history
  55. status: fix rename reporting when using serialization cache

    Fix "git status --deserialize" to correctly report both pathnames
    for renames.  Add a test case to verify.
    
    A change was made upstream that added an additional "rename_status"
    field to the "struct wt_status_change_data" structure.  It is used
    during the various print routines to decide if 2 pathnames need to
    be printed.
    
        5134ccd
        wt-status.c: rename rename-related fields in wt_status_change_data
    
    The fix here is to add that field to the status cache data.
    
    Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
    jeffhostetler authored and dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    52c31f5 View commit details
    Browse the repository at this point in the history
  56. status: add comments for ahead_behind_flags in serialization

    The "ahead_behind_flags" field of "struct wt_status" does not
    need to be stored in the serialization cache file, since it is
    a display property.  Update the code comments in both serialize
    and deserialize to reflect that.
    
    Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
    jeffhostetler authored and dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    8a9cfa1 View commit details
    Browse the repository at this point in the history
  57. serialize-status: serialize global and repo-local exclude file metadata

    Changes to the global or repo-local excludes files can change the
    results returned by "git status" for untracked files.  Therefore,
    it is important that the exclude-file values used during serialization
    are still current at the time of deserialization.
    
    Teach "git status --serialize" to report metadata on the user's global
    exclude file (which defaults to "$XDG_HOME/git/ignore") and for the
    repo-local excludes file (which is in ".git/info/excludes").  Serialize
    will record the pathnames and mtimes for these files in the serialization
    header (next to the mtime data for the .git/index file).
    
    Teach "git status --deserialize" to validate this new metadata.  If either
    exclude file has changed since the serialization-cache-file was written,
    then deserialize will reject the cache file and force a full/normal status
    run.
    
    Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
    jeffhostetler authored and dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    35fae6e View commit details
    Browse the repository at this point in the history
  58. Merge pull request microsoft#6 from jeffhostetler/gvfs-serialize-stat…

    …us-rename
    
    GVFS serialize status updates
    jeffhostetler authored and dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    e669dbd View commit details
    Browse the repository at this point in the history
  59. status: deserialization wait

    Teach `git status --deserialize` to either wait indefintely
    or immediately fail if the status serialization cache file
    is stale.
    
    Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
    jeffhostetler authored and dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    b8a0906 View commit details
    Browse the repository at this point in the history
  60. Merge pull request microsoft#1 from jeffhostetler/gvfs-serialize-exclude

    serialize-status: serialize global and repo-local exclude file metadata
    jeffhostetler authored and dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    aad187f View commit details
    Browse the repository at this point in the history
  61. virtualfilesystem: don't run the virtual file system hook if the inde…

    …x has been redirected
    
    Fixes microsoft#13
    
    Some git commands spawn helpers and redirect the index to a different
    location.  These include "difftool -d" and the sequencer
    (i.e. `git rebase -i`, `git cherry-pick` and `git revert`) and others.
    In those instances we don't want to update their temporary index with
    our virtualization data.
    
    Helped-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    Signed-off-by: Ben Peart <Ben.Peart@microsoft.com>
    benpeart authored and dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    c6ed96e View commit details
    Browse the repository at this point in the history
  62. Merge pull request microsoft#7 from jeffhostetler/gvfs-status-seriali…

    …ze-wait
    
    status: deserialization wait
    jeffhostetler authored and dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    4bf9218 View commit details
    Browse the repository at this point in the history
  63. virtualfilesystem: fix bug with symlinks being ignored

    The virtual file system code incorrectly treated symlinks as directories
    instead of regular files.  This meant symlinks were not included even if
    they are listed in the list of files returned by the core.virtualFilesystem
    hook proc.  Fixes microsoft#25
    
    Signed-off-by: Ben Peart <Ben.Peart@microsoft.com>
    benpeart authored and dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    578ca43 View commit details
    Browse the repository at this point in the history
  64. Merge pull request microsoft#15 from benpeart/difftool

    virtualfilesystem: don't run the virtual file system hook if the index has been redirected
    benpeart authored and dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    c208015 View commit details
    Browse the repository at this point in the history
  65. Merge pull request microsoft#27 from benpeart/virtualprojectionlinks

    virtualfilesystem: fix bug with symlinks being ignored
    benpeart authored and dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    d500192 View commit details
    Browse the repository at this point in the history
  66. trace2: create new combined trace facility

    Create a new unified tracing facility for git.  The eventual intent is to
    replace the current trace_printf* and trace_performance* routines with a
    unified set of git_trace2* routines.
    
    In addition to the usual printf-style API, trace2 provides higer-level
    event verbs with fixed-fields allowing structured data to be written.
    This makes post-processing and analysis easier for external tools.
    
    Trace2 defines 3 output targets.  These are set using the environment
    variables "GIT_TR2", "GIT_TR2_PERF", and "GIT_TR2_EVENT".  These may be
    set to "1" or to an absolute pathname (just like the current GIT_TRACE).
    
    * GIT_TR2 is intended to be a replacement for GIT_TRACE and logs command
      summary data.
    
    * GIT_TR2_PERF is intended as a replacement for GIT_TRACE_PERFORMANCE.
      It extends the output with columns for the command process, thread,
      repo, absolute and relative elapsed times.  It reports events for
      child process start/stop, thread start/stop, and per-thread function
      nesting.
    
    * GIT_TR2_EVENT is a new structured format. It writes event data as a
      series of JSON records.
    
    Calls to trace2 functions log to any of the 3 output targets enabled
    without the need to call different trace_printf* or trace_performance*
    routines.
    
    Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
    jeffhostetler authored and dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    769724e View commit details
    Browse the repository at this point in the history
  67. trace2: add trace2 tracing of major regions in wt-status

    Add trace2_region_enter() and trace2_region_leave() calls around the
    various phases of a status scan.  This gives elapsed time for each
    phase in the GIT_TR2_PERF and GIT_TR2_EVENT trace target.
    
    Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
    jeffhostetler authored and dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    a9f708e View commit details
    Browse the repository at this point in the history
  68. trace2: classify some child processes

    Classify editor, pager, and sub-process child processes.
    
    The former two can be used to identify interactive commands,
    for example.  A later effort could classify other types of
    commands, such as "gc", "hook", and etc.
    
    Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
    jeffhostetler authored and dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    e45bc60 View commit details
    Browse the repository at this point in the history
  69. trace2: add child classification for transport processes

    Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
    jeffhostetler authored and dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    f142a15 View commit details
    Browse the repository at this point in the history
  70. trace2: instrument reading and writing the index

    Add trace2 events when reading and writing the index.
    
    Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
    jeffhostetler authored and dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    3af982f View commit details
    Browse the repository at this point in the history
  71. gvfs:trace2: add region/data events for status deserialization

    Add trace2 region and data events describing attempts to deserialize
    status data using a status cache.
    
    A category:status, label:deserialize region is pushed around the
    deserialize code.
    
    Deserialization results when reading from a file are:
        category:status, path   = <path>
        category:status, polled = <number_of_attempts>
        category:status, result = "ok" | "reject"
    
    When reading from STDIN are:
        category:status, path   = "STDIN"
        category:status, result = "ok" | "reject"
    
    Status will fallback and run a normal status scan when a "reject"
    is reported (unless "--deserialize-wait=fail").  If "ok" is reported,
    status was able to use the status cache and avoid scanning the workdir.
    
    Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
    jeffhostetler authored and dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    99ada13 View commit details
    Browse the repository at this point in the history
  72. virtualfilesystem: check if directory is included

    Add check to see if a directory is included in the virtualfilesystem
    before checking the directory hashmap.  This allows a directory entry
    like foo/ to find all untracked files in subdirectories.
    Kevin Willford authored and dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    f10c0d7 View commit details
    Browse the repository at this point in the history
  73. gvfs:trace2: add trace2 tracing around read_object_process

    Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
    jeffhostetler authored and dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    3a564fa View commit details
    Browse the repository at this point in the history
  74. Merge pull request microsoft#33 virtualfilesystem - check if director…

    …y is included
    
    Add check to see if a directory is included in the virtualfilesystem
    before checking the directory hashmap. This allows a directory entry
    like foo/ to find all untracked files in subdirectories.
    Kevin Willford authored and dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    b0c591a View commit details
    Browse the repository at this point in the history
  75. pack-objects: add trace2 regions

    When studying the performance of 'git push' we would like to know
    how much time is spent at various parts of the command. One area
    that could cause performance trouble is 'git pack-objects'.
    
    Add trace2 regions around the three main actions taken in this
    command:
    
    1. Enumerate objects.
    2. Prepare pack.
    3. Write pack-file.
    
    Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
    derrickstolee authored and dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    d8b6284 View commit details
    Browse the repository at this point in the history
  76. Merge pull request microsoft#28 from jeffhostetler/gvfs-trace2-v1

    (Experimental) Trace2 base plus GVFS extensions
    jeffhostetler authored and dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    68fb1f2 View commit details
    Browse the repository at this point in the history
  77. Merge pull request microsoft#34 Add Trace2 regions to 'pack-objects'

    We want to make `git push` faster, but we need to know where the time is going!
    
    There are likely four places where the time is going:
    
    1. The info/refs call and force-update checking at the beginning.
    2. The `git pack-objects` call that creates a pack-file to send to the server.
    3. Sending the data to the server.
    4. Waiting for the server to verify the pack-file.
    
    This PR adds `trace2_region_` calls inside `git pack-objects` so we can track the time in item (2). The rest could be interpreted from the start and end time of the entire command after we know this region. The server-side verification is something we can track using server telemetry.
    derrickstolee authored and dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    cf4c1ae View commit details
    Browse the repository at this point in the history
  78. rebase/stash: make post-command hook work again

    William Baker reported that the non-built-in rebase and stash fail to
    run the post-command hook (which is important for VFS for Git, though).
    
    The reason is that an `exec()` will replace the current process by the
    newly-exec'ed one (our Windows-specific emulation cannot do that, and
    does not even try, so this is only an issue on Linux/macOS). As a
    consequence, not even the atexit() handlers are run, including the
    one running the post-command hook.
    
    To work around that, let's spawn the legacy rebase/stash and exit with
    the reported exit code.
    dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    7709e5e View commit details
    Browse the repository at this point in the history
  79. read-cache: add post-indexchanged hook

    benpeart authored and dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    f7f0dbc View commit details
    Browse the repository at this point in the history
  80. Configuration menu
    Copy the full SHA
    6f11ade View commit details
    Browse the repository at this point in the history
  81. Merge pull request microsoft#36 Avoid sane_execvp in git rebase a…

    …nd `git stash`
    
    William Baker reported that the non-built-in rebase and stash fail to
    run the post-command hook (which is important for VFS for Git, though).
    
    The reason is that an `exec()` will replace the current process by the
    newly-exec'ed one (our Windows-specific emulation cannot do that, and
    does not even try, so this is only an issue on Linux/macOS). As a
    consequence, not even the atexit() handlers are run, including the
    one running the post-command hook.
    
    To work around that, let's spawn the legacy rebase/stash and exit with
    the reported exit code.
    derrickstolee authored and dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    77eefa1 View commit details
    Browse the repository at this point in the history
  82. Configuration menu
    Copy the full SHA
    984275e View commit details
    Browse the repository at this point in the history
  83. send-pack: do not check for sha1 file when GVFS_MISSING_OK set

    Kevin Willford authored and dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    4e8852f View commit details
    Browse the repository at this point in the history
  84. Merge pull request microsoft#24 Match multi-pack-index feature from u…

    …pstream
    
    This includes commits that fixup!-revert all the midx-related commits from our GVFS branch and replaces them with the exact commits that are being merged upstream. This should automatically remove the commits during our next version rebase-and-merge action.
    
    Changes upstream:
    - The builtin is called 'git multi-pack-index'.
    - The command-line takes a 'write' verb and an '--object-dir' parameter.
    - We no longer have a 'midx-head' or '*.midx' files.
    - Instead, we have a 'multi-pack-index' file in the pack-dir.
    - It no longer makes sense to specify '--update-head'
    dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    c5b4b4c View commit details
    Browse the repository at this point in the history
  85. Add documentation for the post-indexchanged hook

    Kevin Willford authored and dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    886eddb View commit details
    Browse the repository at this point in the history
  86. Merge pull request microsoft#68 send-pack do not check for sha1 file …

    …when GVFS_MISSING_OK set
    
    send-pack: do not check for sha1 file when GVFS_MISSING_OK set
    Kevin Willford authored and dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    09e3b51 View commit details
    Browse the repository at this point in the history
  87. vfs: fix case where directories not handled correctly

    The vfs does not correctly handle the case when there is a file
    that begins with the same prefix as a directory. For example, the
    following setup would encounter this issue:
    
        A directory contains a file named `dir1.sln` and a directory
        named `dir1/`.
    
        The directory `dir1` contains other files.
    
        The directory `dir1` is in the virtual file system list
    
    The contents of `dir1` should be in the virtual file system, but
    it is not. The contents of this directory do not have the skip
    worktree bit cleared as expected. The problem is in the
    `apply_virtualfilesystem(...)` function where it does not include
    the trailing slash of the directory name when looking up the
    position in the index to start clearing the skip worktree bit.
    
    This fix is it include the trailing slash when finding the first
    index entry from `index_name_pos(...)`.
    jamill authored and dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    d5866d6 View commit details
    Browse the repository at this point in the history
  88. Merge pull request microsoft#64 Index changed hook

    Index changed hook
    Kevin Willford authored and dscho committed Dec 10, 2018
    Configuration menu
    Copy the full SHA
    376b902 View commit details
    Browse the repository at this point in the history

Commits on Dec 11, 2018

  1. Merge pull request microsoft#70 from jamill/jamill/virtual_filesystem…

    …_directories
    
    virtualfilesystem: fix case where directories not handled correctly
    jamill authored and derrickstolee committed Dec 11, 2018
    Configuration menu
    Copy the full SHA
    db2e92b View commit details
    Browse the repository at this point in the history
  2. BRANCHES.md: Add explanation of branches and using forks

    Kevin Willford committed Dec 11, 2018
    Configuration menu
    Copy the full SHA
    ebb10b5 View commit details
    Browse the repository at this point in the history