Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: git/git
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: fa82be982d
Choose a base ref
...
head repository: git/git
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 0c0f8a7f28
Choose a head ref
  • 8 commits
  • 20 files changed
  • 1 contributor

Commits on Mar 12, 2020

  1. builtin/checkout: pass branch info down to checkout_worktree

    In the future, we're going to want to use the branch info in
    checkout_worktree, so let's pass the whole struct branch_info down, not
    just the revision name.  We hoist the definition of struct branch_info
    so it's in scope.
    
    Signed-off-by: brian m. carlson <[email protected]>
    Signed-off-by: Junio C Hamano <[email protected]>
    bk2204 authored and gitster committed Mar 12, 2020
    Configuration menu
    Copy the full SHA
    a860476 View commit details
    Browse the repository at this point in the history

Commits on Mar 16, 2020

  1. convert: permit passing additional metadata to filter processes

    There are a variety of situations where a filter process can make use of
    some additional metadata.  For example, some people find the ident
    filter too limiting and would like to include the commit or the branch
    in their smudged files.  This information isn't available during
    checkout as HEAD hasn't been updated at that point, and it wouldn't be
    available in archives either.
    
    Let's add a way to pass this metadata down to the filter.  We pass the
    blob we're operating on, the treeish (preferring the commit over the
    tree if one exists), and the ref we're operating on.  Note that we won't
    pass this information in all cases, such as when renormalizing or when
    we're performing diffs, since it doesn't make sense in those cases.
    
    The data we currently get from the filter process looks like the
    following:
    
      command=smudge
      pathname=git.c
      0000
    
    With this change, we'll get data more like this:
    
      command=smudge
      pathname=git.c
      refname=refs/tags/v2.25.1
      treeish=c522f061d551c9bb8684a7c3859b2ece4499b56b
      blob=7be7ad34bd053884ec48923706e70c81719a8660
      0000
    
    There are a couple things to note about this approach.  For operations
    like checkout, treeish will always be a commit, since we cannot check
    out individual trees, but for other operations, like archive, we can end
    up operating on only a particular tree, so we'll provide only a tree as
    the treeish.  Similar comments apply for refname, since there are a
    variety of cases in which we won't have a ref.
    
    This commit wires up the code to print this information, but doesn't
    pass any of it at this point.  In a future commit, we'll have various
    code paths pass the actual useful data down.
    
    Signed-off-by: brian m. carlson <[email protected]>
    Signed-off-by: Junio C Hamano <[email protected]>
    bk2204 authored and gitster committed Mar 16, 2020
    Configuration menu
    Copy the full SHA
    ab90eca View commit details
    Browse the repository at this point in the history
  2. convert: provide additional metadata to filters

    Now that we have the codebase wired up to pass any additional metadata
    to filters, let's collect the additional metadata that we'd like to
    pass.
    
    The two main places we pass this metadata are checkouts and archives.
    In these two situations, reading HEAD isn't a valid option, since HEAD
    isn't updated for checkouts until after the working tree is written and
    archives can accept an arbitrary tree.  In other situations, HEAD will
    usually reflect the refname of the branch in current use.
    
    We pass a smaller amount of data in other cases, such as git cat-file,
    where we can really only logically know about the blob.
    
    This commit updates only the parts of the checkout code where we don't
    use unpack_trees.  That function and callers of it will be handled in a
    future commit.
    
    In the archive code, we leak a small amount of memory, since nothing we
    pass in the archiver argument structure is freed.
    
    Signed-off-by: brian m. carlson <[email protected]>
    Signed-off-by: Junio C Hamano <[email protected]>
    bk2204 authored and gitster committed Mar 16, 2020
    Configuration menu
    Copy the full SHA
    c397aac View commit details
    Browse the repository at this point in the history
  3. builtin/checkout: compute checkout metadata for checkouts

    Provide commit metadata for checkout code paths that use unpack_trees
    and friends.  When we're checking out a commit, use the commit
    information, but don't provide commit information if we're checking out
    from the index, since there need not be any particular commit associated
    with the index, and even if there is one, we can't know what it is.
    
    Signed-off-by: brian m. carlson <[email protected]>
    Signed-off-by: Junio C Hamano <[email protected]>
    bk2204 authored and gitster committed Mar 16, 2020
    Configuration menu
    Copy the full SHA
    13e7ed6 View commit details
    Browse the repository at this point in the history
  4. builtin/clone: compute checkout metadata for clones

    When checking out a commit, provide metadata to the filter process
    including the ref we're using.
    
    Signed-off-by: brian m. carlson <[email protected]>
    Signed-off-by: Junio C Hamano <[email protected]>
    bk2204 authored and gitster committed Mar 16, 2020
    Configuration menu
    Copy the full SHA
    dfc8cdc View commit details
    Browse the repository at this point in the history
  5. builtin/rebase: compute checkout metadata for rebases

    Signed-off-by: brian m. carlson <[email protected]>
    Signed-off-by: Junio C Hamano <[email protected]>
    bk2204 authored and gitster committed Mar 16, 2020
    Configuration menu
    Copy the full SHA
    3f26785 View commit details
    Browse the repository at this point in the history
  6. builtin/reset: compute checkout metadata for reset

    Pass the commit, and if we have it, the ref to the filters when we
    perform a checkout.  This should only be the case when we invoke git
    reset --hard; the metadata will be unused otherwise.
    
    Signed-off-by: brian m. carlson <[email protected]>
    Signed-off-by: Junio C Hamano <[email protected]>
    bk2204 authored and gitster committed Mar 16, 2020
    Configuration menu
    Copy the full SHA
    4cf76f6 View commit details
    Browse the repository at this point in the history
  7. t0021: test filter metadata for additional cases

    Check that we get the expected data when performing a merges or
    generating archives.  Note that we don't expect a ref for merges,
    because we won't be checking out any particular ref, but instead a tree
    of the merged data.  For archives, however, we expect a ref as normal if
    we have one.
    
    Signed-off-by: brian m. carlson <[email protected]>
    Signed-off-by: Junio C Hamano <[email protected]>
    bk2204 authored and gitster committed Mar 16, 2020
    Configuration menu
    Copy the full SHA
    0c0f8a7 View commit details
    Browse the repository at this point in the history
Loading