1. 22 Feb, 2019 1 commit
    • Jeff Hostetler's avatar
      trace2: create new combined trace facility · ee4512ed
      Jeff Hostetler authored
      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
      * 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*
      Signed-off-by: default avatarJeff Hostetler <jeffhost@microsoft.com>
      Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
  2. 14 Jan, 2019 3 commits
  3. 05 Dec, 2018 1 commit
    • Stefan Beller's avatar
      repository: repo_submodule_init to take a submodule struct · d5498e08
      Stefan Beller authored
      When constructing a struct repository for a submodule for some revision
      of the superproject where the submodule is not contained in the index,
      it may not be present in the working tree currently either. In that
      situation giving a 'path' argument is not useful. Upgrade the
      repo_submodule_init function to take a struct submodule instead.
      The submodule struct can be obtained via submodule_from_{path, name} or
      an artificial submodule struct can be passed in.
      While we are at it, rename the repository struct in the repo_submodule_init
      function, which is to be initialized, to a name that is not confused with
      the struct submodule as easily. Perform such renames in similar functions
      as well.
      Also move its documentation into the header file.
      Reviewed-by: default avatarJonathan Tan <jonathantanmy@google.com>
      Signed-off-by: Stefan Beller's avatarStefan Beller <sbeller@google.com>
      Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
  4. 15 Aug, 2018 1 commit
  5. 03 Aug, 2018 1 commit
  6. 17 May, 2018 1 commit
  7. 09 May, 2018 1 commit
    • Stefan Beller's avatar
      repository: introduce parsed objects field · 99bf115c
      Stefan Beller authored
      Convert the existing global cache for parsed objects (obj_hash) into
      repository-specific parsed object caches. Existing code that uses
      obj_hash are modified to use the parsed object cache of
      the_repository; future patches will use the parsed object caches of
      other repositories.
      Another future use case for a pool of objects is ease of memory management
      in revision walking: If we can free the rev-list related memory early in
      pack-objects (e.g. part of repack operation) then it could lower memory
      pressure significantly when running on large repos. While this has been
      discussed on the mailing list lately, this series doesn't implement this.
      Signed-off-by: Stefan Beller's avatarStefan Beller <sbeller@google.com>
      Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
  8. 12 Apr, 2018 1 commit
  9. 29 Mar, 2018 1 commit
    • Stefan Beller's avatar
      submodule: fixup nested submodules after moving the submodule · da62f786
      Stefan Beller authored
      connect_work_tree_and_git_dir is used to connect a submodule worktree with
      its git directory and vice versa after events that require a reconnection
      such as moving around the working tree. As submodules can have nested
      submodules themselves, we'd also want to fix the nested submodules when
      asked to. Add an option to recurse into the nested submodules and connect
      them as well.
      As submodules are identified by their name (which determines their git
      directory in relation to their superproject's git directory) internally
      and by their path in the working tree of the superproject, we need to
      make sure that the mapping of name <-> path is kept intact. We can do
      that in the git-mv command by writing out the gitmodules file first
      and then forcing a reload of the submodule config machinery.
      Signed-off-by: Stefan Beller's avatarStefan Beller <sbeller@google.com>
      Reviewed-by: default avatarJonathan Tan <jonathantanmy@google.com>
      Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
  10. 23 Mar, 2018 2 commits
  11. 05 Mar, 2018 4 commits
  12. 13 Nov, 2017 1 commit
    • brian m. carlson's avatar
      Integrate hash algorithm support with repo setup · 78a67668
      brian m. carlson authored
      In future versions of Git, we plan to support an additional hash
      algorithm.  Integrate the enumeration of hash algorithms with repository
      setup, and store a pointer to the enumerated data in struct repository.
      Of course, we currently only support SHA-1, so hard-code this value in
      read_repository_format.  In the future, we'll enumerate this value from
      the configuration.
      Add a constant, the_hash_algo, which points to the hash_algo structure
      pointer in the repository global.  Note that this is the hash which is
      used to serialize data to disk, not the hash which is used to display
      items to the user.  The transition plan anticipates that these may be
      different.  We can add an additional element in the future (say,
      ui_hash_algo) to provide for this case.
      Include repository.h in cache.h since we now need to have access to
      these struct and variable definitions.
      Signed-off-by: brian m. carlson's avatarbrian m. carlson <sandals@crustytoothpaste.net>
      Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
  13. 18 Jul, 2017 1 commit
  14. 24 Jun, 2017 5 commits
    • Brandon Williams's avatar
      repository: enable initialization of submodules · 96dc883b
      Brandon Williams authored
      Introduce 'repo_submodule_init()' which performs initialization of a
      'struct repository' as a submodule of another 'struct repository'.
      The resulting submodule 'struct repository' can be in one of three states:
        1. The submodule is initialized and has a worktree.
        2. The submodule is initialized but does not have a worktree.  This
           would occur when the submodule's gitdir is present in the
           superproject's 'gitdir/modules/' directory yet the submodule has not
           been checked out in superproject's worktree.
        3. The submodule remains uninitialized due to an error in the
           initialization process or there is no matching submodule at the
           provided path in the superproject.
      Signed-off-by: default avatarBrandon Williams <bmwill@google.com>
      Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    • Brandon Williams's avatar
      submodule-config: store the_submodule_cache in the_repository · bf12fcdf
      Brandon Williams authored
      Refactor how 'the_submodule_cache' is handled so that it can be stored
      inside of a repository object.  Also migrate 'the_submodule_cache' to be
      stored in 'the_repository'.
      Signed-off-by: default avatarBrandon Williams <bmwill@google.com>
      Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    • Brandon Williams's avatar
    • Brandon Williams's avatar
      config: read config from a repository object · 3b256228
      Brandon Williams authored
      Teach the config machinery to read config information from a repository
      object.  This involves storing a 'struct config_set' inside the
      repository object and adding a number of functions (repo_config*) to be
      able to query a repository's config.
      The current config API enables lazy-loading of the config.  This means
      that when 'git_config_get_int()' is called, if the_config_set hasn't
      been populated yet, then it will be populated and properly initialized by
      reading the necessary config files (system wide .gitconfig, user's home
      .gitconfig, and the repository's config).  To maintain this paradigm,
      the new API to read from a repository object's config will also perform
      this lazy-initialization.
      Since both APIs (git_config_get* and repo_config_get*) have the same
      semantics we can migrate the default config to be stored within
      'the_repository' and just have the 'git_config_get*' family of functions
      redirect to the 'repo_config_get*' functions.
      Signed-off-by: default avatarBrandon Williams <bmwill@google.com>
      Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    • Brandon Williams's avatar
      repository: introduce the repository object · 359efeff
      Brandon Williams authored
      Introduce the repository object 'struct repository' which can be used to
      hold all state pertaining to a git repository.
      Some of the benefits of object-ifying a repository are:
        1. Make the code base more readable and easier to reason about.
        2. Allow for working on multiple repositories, specifically
           submodules, within the same process.  Currently the process for
           working on a submodule involves setting up an argv_array of options
           for a particular command and then launching a child process to
           execute the command in the context of the submodule.  This is
           clunky and can require lots of little hacks in order to ensure
           correctness.  Ideally it would be nice to simply pass a repository
           and an options struct to a command.
        3. Eliminating reliance on global state will make it easier to
           enable the use of threading to improve performance.
      Signed-off-by: default avatarBrandon Williams <bmwill@google.com>
      Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>